- Explore MCP Servers
- CSharpMCP
Csharpmcp
What is Csharpmcp
CSharpMCP is a Roslyn-based MCP server designed for dynamically executing C# code snippets on a local machine.
Use cases
Use cases include executing code snippets for testing purposes, dynamically running scripts in applications, and providing an interactive coding environment for learning C#.
How to use
To use CSharpMCP, compile your existing C# project and provide the path of the compiled DLL as a startup parameter. You can then execute C# code snippets using the available tools.
Key features
Key features include RunAsync for executing C# code while preserving state, CleanExecuteContext for clearing the execution context, and GetHistoryCode for retrieving previously executed code.
Where to use
CSharpMCP can be used in software development environments where dynamic code execution is needed, such as testing, scripting, and educational purposes.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Csharpmcp
CSharpMCP is a Roslyn-based MCP server designed for dynamically executing C# code snippets on a local machine.
Use cases
Use cases include executing code snippets for testing purposes, dynamically running scripts in applications, and providing an interactive coding environment for learning C#.
How to use
To use CSharpMCP, compile your existing C# project and provide the path of the compiled DLL as a startup parameter. You can then execute C# code snippets using the available tools.
Key features
Key features include RunAsync for executing C# code while preserving state, CleanExecuteContext for clearing the execution context, and GetHistoryCode for retrieving previously executed code.
Where to use
CSharpMCP can be used in software development environments where dynamic code execution is needed, such as testing, scripting, and educational purposes.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
CSharpMCP
The CSharpMCP is a mcp server designed for executing C# code base roslyn.
Warning: This will execute code on the local machine. Use with caution.
Available Tools
-
RunAsync: Execute the provided C# code, and the state (like variables) will be preserved each time.
-
CleanExecuteContext: Clean the code execution context, all states will be cleared.
-
GetHistoryCode: Get the history code.
How to reference existing projects
- Compile the existing project
- Use the path of the compiled dll as the startup parameter of CSharpMCP (references will be added automatically)
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










