Downloads · 30 days
0
MCP-1st-Birthday/Roslyn-Stone
Roslyn-Stone is a machine learning model from MCP-1st-Birthday. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Note: This project was collaboratively built with GitHub Copilot, embracing the future of AI-assisted development.
Downloads · 30 days
0
Access
Public
Updated Nov 26, 2025
Repo size
18.6 MB
Likes
1
Public
Click a slice to open those files.
.json111 MB · 71%
From the Hugging Face model README
Note: This project was collaboratively built with GitHub Copilot, embracing the future of AI-assisted development.
A developer- and LLM-friendly C# sandbox for creating single-file utility programs through the Model Context Protocol (MCP). Named as a playful nod to the Rosetta Stone—the ancient artifact that helped decode languages—Roslyn-Stone helps AI systems create runnable C# programs using file-based apps (top-level statements).
Build complete, runnable .cs files using the power of the Roslyn compiler. Execute C# code, validate syntax, load NuGet packages, and lookup documentation through MCP for seamless integration with Claude Code, VS Code, and other AI-powered development tools.
Perfect for creating command-line utilities, data processing scripts, automation tools, and quick C# programs without project scaffolding.
The fastest way to get started is using the pre-built Docker container with your favorite MCP-enabled editor:
Add this to your MCP configuration file:
Linux/macOS: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
{
"mcpServers": {
"roslyn-stone": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "DOTNET_USE_POLLING_FILE_WATCHER=1",
"ghcr.io/dylanlangston/roslyn-stone:latest"
]
}
}
}
Using Podman? Just replace "docker" with "podman" in the command field.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or equivalent:
{
"mcpServers": {
"roslyn-stone": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "DOTNET_USE_POLLING_FILE_WATCHER=1",
"ghcr.io/dylanlangston/roslyn-stone:latest"
]
}
}
}
That's it! The container provides isolated execution of C# code with minimal setup and enhanced security.
File-Based C# Apps - Create single-file utilities using top-level statements aligned with .NET 10's dotnet run app.cs feature
Inline Package Loading - Use nugetPackages parameter to load packages during testing, finalize with #:package directive for self-contained apps
C# Execution via Roslyn - Execute and test C# code with full .NET 10 support and recursive NuGet dependency resolution
Iterative Development - Build programs incrementally with optional stateful sessions and context management
Real-time Error Feedback - Get detailed compilation errors and warnings with actionable messages
Resources & Tools - Proper MCP separation: Resources (data) vs Tools (operations)
Documentation Access - Query .NET type/method docs via doc:// resource URIs (includes core SDK types like System.String)
NuGet Integration - Search packages via nuget:// resources, load with tools, full dependency tree resolution
MCP Protocol - Official ModelContextProtocol SDK with stdio and HTTP transports
Dual Transport - Support for both stdio (local) and HTTP (remote) MCP connections
AI-Friendly - Designed for LLM interactions via Model Context Protocol
Token-Optimized Prompts - Efficient guidance for creating utility programs with .NET 10 directive examples
Containerized - Docker support with .NET Aspire orchestration
OpenTelemetry - Built-in observability with logs, metrics, and traces
Roslyn-Stone implements the Model Context Protocol (MCP) to help LLMs create single-file C# utility programs. It follows best practices by properly distinguishing between:
doc://), NuGet packages (nuget://), and execution state (repl://)The solution follows clean architecture principles with functional programming patterns. It implements best practices for dynamic code compilation and execution, including proper AssemblyLoadContext usage for memory management.
See MCP_ARCHITECTURE.md for detailed design documentation and DYNAMIC_COMPILATION_BEST_PRACTICES.md for compilation details.
RoslynStone/
├── src/
│ ├── RoslynStone.Api/ # Console Host with MCP Server
│ ├── RoslynStone.Core/ # Domain models (ExecutionResult, PackageMetadata, etc.)
│ ├── RoslynStone.Infrastructure/ # MCP Tools, Roslyn services, functional helpers
│ ├── RoslynStone.ServiceDefaults/# OpenTelemetry and Aspire defaults
│ └── RoslynStone.AppHost/ # Aspire orchestration
└── tests/
├── RoslynStone.Tests/ # xUnit unit and integration tests
├── RoslynStone.Benchmarks/ # BenchmarkDotNet performance tests
└── RoslynStone.LoadTests/ # HTTP load and concurrency tests
Resources provide URI-based access to passive data sources:
doc://{symbolName} - .NET XML documentation lookup
doc://System.String, doc://System.Linq.Enumerable.Selectdoc://{packageId}@{symbolName}doc://[email protected]nuget://search?q={query} - Search NuGet packages
nuget://search?q=json&take=10nuget://packages/{id}/versions - Get package version list
nuget://packages/Newtonsoft.Json/versionsnuget://packages/{id}/readme - Get package README
nuget://packages/Newtonsoft.Json/readme?version=13.0.3repl://state - General REPL information and capabilitiesrepl://sessions - List active REPL sessionsrepl://sessions/{contextId}/state - Session-specific metadataTools perform operations and can modify state. All tools support optional context management:
Execution Tools:
contextId parameter for iterative developmentcontextId for session continuitycontextId for context-aware validationcontextId to reset specific session or all sessionscontextId for session-specific stateNuGet Tools:
query, skip, take for paginationnuget://search resource for clients without resource supportpackageIdnuget://packages/{id}/versions resourcepackageId, optional versionnuget://packages/{id}/readme resourceDocumentation Tools:
symbolName, optional packageIddoc:// resource for clients without resource supportNote: Both Resources and Tools are provided for maximum client compatibility. Resources are preferred for passive data access, while Tools work in all MCP clients.
Roslyn-Stone includes built-in prompts to help LLMs create single-file C# utility programs:
These prompts provide detailed guidance on creating runnable .cs files, including examples, common patterns, and tips for success.
Once configured, your AI assistant can help you create single-file C# utility programs aligned with .NET 10's file-based app feature:
Build a simple utility:
User: "Create a utility that lists files in the current directory"
Assistant: [Calls EvaluateCsharp with complete file-based app code]
→ Returns complete .cs file using top-level statements
→ Can be run directly with: dotnet run utility.cs
Create self-contained apps with packages:
User: "Create a JSON formatter utility"
Assistant:
1. [Searches packages: nuget://search?q=json]
2. [Tests with nugetPackages parameter: EvaluateCsharp(..., nugetPackages: [{packageName: "Newtonsoft.Json", version: "13.0.3"}])]
3. [Returns complete json-formatter.cs with #:package directive]
→ Complete self-contained app:
#:package [email protected]
using Newtonsoft.Json;
// ... utility code ...
→ Run with: dotnet run json-formatter.cs (no .csproj needed!)
Query documentation for .NET types:
User: "Show me how to use System.String.Split"
Assistant: [Option 1: Reads doc://System.String.Split resource]
[Option 2: Calls GetDocumentation("System.String.Split")]
→ Returns XML documentation with summary, parameters, examples
Validate before execution:
User: "Check if this C# code is valid: <code>"
Assistant: [Calls ValidateCsharp with code]
→ Returns syntax validation results with detailed diagnostics
Iterative development with context:
User: "Start a CSV processor utility"
Assistant: [EvaluateCsharp with createContext=true, nugetPackages: CsvHelper]
→ Returns contextId for session
User: "Add filtering by date"
Assistant: [EvaluateCsharp with contextId, adds filtering logic]
→ Builds incrementally on previous code
The AI assistant creates complete, runnable single-file C# programs using .NET 10's modern syntax—no class, Main method, or project file boilerplate needed.
Want to contribute, run from source, or learn more about the internals? Check out our comprehensive Getting Started Guide for:
⚠️ Important: This is a code execution service. Deploy with appropriate security measures:
Contributions are welcome! Please see our Getting Started Guide for development setup instructions. Feel free to submit issues and pull requests.
See LICENSE file for details.
For the best experience creating C# utility programs, we recommend using Roslyn-Stone alongside the Microsoft Learn MCP server (github.com/microsoftdocs/mcp).
Why pair these tools?
Together they enable:
Example workflow:
User: "Create a utility to parse JSON files"
Assistant:
1. [microsoft-learn MCP: Searches for JSON documentation]
2. [microsoft-learn MCP: Gets System.Text.Json code samples]
3. [roslyn-stone: Tests code with EvaluateCsharp]
4. [roslyn-stone: Returns complete json-parser.cs]
→ Best of both worlds: Official docs + live execution
Setup both servers:
{
"mcpServers": {
"roslyn-stone": {
"command": "docker",
"args": ["run", "-i", "--rm", "ghcr.io/dylanlangston/roslyn-stone:latest"]
},
"microsoft-learn": {
"command": "npx",
"args": ["-y", "@microsoft/docs-mcp-server"]
}
}
}
This combination provides comprehensive .NET documentation alongside live C# execution for the ultimate utility program development experience.
dotnet run app.cs