Roslyn-backed MCP adapter for C# navigation.
Architecture:
backend daemon- Owns the Roslyn process and workspace state.
- Exposes a local HTTP API for
health,find_definition,find_references,find_implementations,document_symbols,search_symbols, andread_span.
MCP stdio adapter- Does not own Roslyn state.
- Receives MCP tool calls and forwards them to the backend daemon.
Install:
python3 -m pip install -e .- LangGraph demo:
python3 -m pip install -e '.[demo]'
Entrypoints:
roslyn-mcp-backend config.json- Runs the Roslyn backend daemon.
roslyn-mcp-server config.json- Runs the MCP stdio adapter.
roslyn-mcp-client --config config.json health- Calls the backend daemon directly over HTTP.
MCP tools:
healthfind_definitionfind_referencesfind_implementationsdocument_symbolssearch_symbolsread_span
Coordinate system:
- All
lineandcharacterfields are0-based, matching LSP.
Testing:
pytestnow runs real integration tests against:- a real backend daemon process
- a real MCP adapter process
- the real Roslyn Language Server from
config.json
- To enable real
find_definitionandfind_referencestests, set:ROSLYN_MCP_TEST_FILE_PATHROSLYN_MCP_TEST_LINEROSLYN_MCP_TEST_CHARACTER
Structure:
src/roslyn_mcp_server/backend/: backend daemon and HTTP clientsrc/roslyn_mcp_server/main.py: MCP stdio adapter entrypointsrc/roslyn_mcp_server/mcp/: MCP transport and tool handlerssrc/roslyn_mcp_server/application/: services and request/result modelssrc/roslyn_mcp_server/roslyn/: Roslyn session and LSP adaptersrc/roslyn_mcp_server/infrastructure/: config, logging, and compatibility wrapper for the old HTTP bridge path
Examples:
- Start the backend:
PYTHONPATH=src python3 -m roslyn_mcp_server.backend.server config.json
- Search workspace symbols:
PYTHONPATH=src python3 -m roslyn_mcp_server.client_cli --config config.json search-symbols --query IDataContractCalculator
- List document symbols:
PYTHONPATH=src python3 -m roslyn_mcp_server.client_cli --config config.json document-symbols --file /absolute/path/to/file.cs
- Find implementations from an interface or abstract member position:
PYTHONPATH=src python3 -m roslyn_mcp_server.client_cli --config config.json implementations --file /absolute/path/to/file.cs --line 10 --character 15
- Run the LangGraph demo:
python3 misc/langgraph_demo.py --config config.json- Then type your prompt in the terminal when you see
Prompt>.