A Roslyn-based mcp server for dynamically executing C# code snippets
Overview
What is CSharpMCP?
CSharpMCP is a Roslyn-based MCP server designed for dynamically executing C# code snippets on the local machine.
How to use CSharpMCP?
To use CSharpMCP, compile your existing C# project and provide the path of the compiled DLL as the startup parameter. You can then execute C# code snippets using the available tools.
Key features of CSharpMCP?
- RunAsync: Execute provided C# code while preserving the state (like variables) across executions.
- CleanExecuteContext: Clear the execution context and reset all states.
- GetHistoryCode: Retrieve previously executed code snippets.
Use cases of CSharpMCP?
- Testing and executing C# code snippets in a controlled environment.
- Preserving state between code executions for iterative development.
- Retrieving and reviewing historical code executions for debugging purposes.
FAQ from CSharpMCP?
- Is it safe to execute code with CSharpMCP?
Caution is advised as this will execute code on the local machine. Ensure you trust the code being executed.
- Can I use CSharpMCP for any C# project?
Yes, as long as you compile the project and provide the correct DLL path, CSharpMCP can execute it.