home / mcp / sharptools mcp server
Provides Roslyn-based C# analysis and precise code modifications via an MCP interface over SSE and Stdio for seamless AI-assisted development.
Configuration
View docs{
"mcpServers": {
"kooshi-sharptoolsmcp": {
"command": "/path/to/repo/SharpToolsMCP/SharpTools.StdioServer/bin/Debug/net8.0/SharpTools.StdioServer",
"args": [
"--log-directory",
"/var/log/sharptools/",
"--log-level",
"Debug"
]
}
}
}SharpTools MCP Server exposes Roslyn-based tooling over MCP, enabling your AI agents to analyze, navigate, modify, and reason about C# code with precise, Roslyn-driven operations. It provides a practical bridge between code understanding and autonomous edits, supported by automated Git integration and clear, incremental feedback.
You connect to the SharpTools MCP Server from an MCP client to load your solution, inspect namespaces and types, view symbol definitions, and perform surgical code changes. Use the provided tools to load a solution, examine members, view definitions, find references, analyze complexity, and apply safe edits with automatic diff-based feedback and in-tool compilation checks.
Prerequisites: install the .NET 8+ SDK and ensure your target solution’s .NET version is installed.
1. Build the SharpTools solution to produce all server components. 2. Run the Stdio MCP server or the SSE HTTP server as described below to expose MCP endpoints.
The MCP interface is exposed via two main methods: Server-Sent Events for remote clients and standard I/O for local process communication. The Stdio server is configured to log its activity and operate with a named log directory and log level.
{
"mcpServers": {
"SharpTools": {
"type": "stdio",
"command": "/path/to/repo/SharpToolsMCP/SharpTools.StdioServer/bin/Debug/net8.0/SharpTools.StdioServer",
"args": [
"--log-directory",
"/var/log/sharptools/",
"--log-level",
"Debug"
],
"env": []
}
}
}If you need to inspect the exact changes that SharpTools proposes, you will see precise diffs rather than full code blocks. If a modification introduces compile-time errors, you’ll receive immediate feedback so you can adjust before committing.
Initializes the workspace with a given .sln file to load the solution into SharpTools for subsequent analysis and modifications.
Provides a detailed structural overview of a specific project within the loaded solution, including namespaces and types.
Lists members (methods, properties, etc.) of a type, including signatures and XML documentation.
Displays the source code of a symbol, with contextual information such as call graphs and type references.
Finds all implementations of an interface or abstract method, or derived classes of a base class.
Locates all usages of a symbol across the solution, with contextual code snippets.
Performs a regex-based search across symbol declarations and signatures in source code and assemblies.
Reads or overwrites using directives in a document.
Reads or overwrites attributes on a declaration.
Performs complexity analysis (cyclomatic, cognitive, coupling, etc.) on methods, classes, or projects.
Reads the raw content of a file with indentation omitted.
Creates a new file with specified content.
Overwrites an existing file with new content.
Lists all types and their members defined within a specific source file.
Adds a new member (method, property, field, nested type, etc.) to a specified type.
Replaces the definition of an existing member or type with new code, or deletes it.
Renames a symbol and updates all its references throughout the solution.
Performs regex-based find and replace operations within a symbol's declaration or across files matching a glob pattern.
Moves a member from one type or namespace to another.
Reverts the last applied change using Git integration.