Get the FREE Ultimate OpenClaw Setup Guide →

SharpToolsMCP

A suite of MCP tools for AIs to analyze and modify C# solutions with high signal, Roslyn powered context.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio kooshi-sharptoolsmcp docker run -i kooshi/sharptoolsmcp:latest \
  --env PORT="8080" \
  --env LOG_LEVEL="info" \
  --env SSE_ENABLED="true"

How to use

SharpToolsMCP exposes a Roslyn-powered set of analysis and modification tools via the MCP interface. It offers a range of Solution, Analysis, Document, Modification, and Misc tools (for example SharpTool_LoadSolution, SharpTool_ViewDefinition, SharpTool_AddMember, and SharpTool_FindReferences) that let an AI agent load a solution, inspect and navigate code, and perform precise code edits with automated git integration. The server can communicate over Server-Sent Events for remote clients and via standard I/O for local process communication, enabling integration with agents, copilots, or automated workflows. To use it, start the Docker image (or your preferred deployment method), connect an MCP client, and invoke the SharpTool_* functions to load your project, query symbol definitions, view or modify source, and commit changes automatically with contextual diffs and compilation feedback.

How to install

Prerequisites:

  • Docker installed on your host (Docker Desktop on Windows/macOS, or Docker Engine on Linux).
  • Sufficient disk space for the target solution and dependencies.

Installation steps:

  1. Pull the SharpTools MCP image (or build your own if you have a custom setup): docker pull kooshi/sharptoolsmcp:latest

  2. Run the MCP server container: docker run -i --rm -p 8080:8080 kooshi/sharptoolsmcp:latest

  3. If you need to customize environment variables (recommended for production): docker run -i --rm -p 8080:8080
    -e PORT=8080
    -e SSE_ENABLED=true
    -e LOG_LEVEL=info
    kooshi/sharptoolsmcp:latest

  4. Connect an MCP client to the server at http://localhost:8080 (adjust host/port as configured). Ensure your client supports MCP via SSE and Stdio as described in the README.

Optional: If you prefer a local build/debug workflow, you would need a .NET environment and expose equivalent commands; this document assumes Docker deployment for simplicity and portability.

Additional notes

Tips and notes:

  • The server exposes a rich set of SharpTool_* endpoints. Use SharpTool_LoadSolution first to initialize the workspace, then explore symbols with SharpTool_GetMembers and view/modify code with SharpTool_ViewDefinition, SharpTool_AddMember, or SharpTool_OverwriteRoslynDocument.
  • Changes are tracked with a dedicated sharptools/ timestamped branch and commits are made automatically. You can undo the last modification via SharpTool_Undo.
  • Ensure your .NET projects follow SDK-style or legacy formats supported by SharpTools; the server aims to work with a wide range of .NET versions. Respect .editorconfig for consistent formatting.
  • When running over a network, consider enabling SSE and securing access to avoid exposing the workspace to untrusted clients.
  • If you encounter issues with code formatting or newline handling around overwritten members, verify the editorconfig and update prompts or prompts usage as needed.

Related MCP Servers

Sponsor this space

Reach thousands of developers