Skip to content
Roslyn Bridge MCP

Developer guide

Roslyn Bridge MCP is a native executable that serves C# tools over the Model Context Protocol (MCP). It starts the official Roslyn language server, keeps it in sync with the workspace files and turns tool calls into Language Server Protocol (LSP) requests.

Design rules

  • Keep the bridge standalone and usable from any MCP client.
  • Use the official MCP SDK for the tools and StreamJsonRpc for Roslyn.
  • Reserve standard output for MCP messages. Send logs to standard error.
  • Run in invariant globalization mode, so behavior does not depend on the machine’s culture.
  • Before applying Roslyn changes, check that each file still matches the version used to compute them.
  • .gitignore is an allowlist. Allow each new project path explicitly.

Sections

Layout

Path Contents
src/RoslynBridge/Tools MCP tools and the dispatcher they share
src/RoslynBridge/Requests What a tool call asks for
src/RoslynBridge/Results What a tool call returns, as records
src/RoslynBridge/Output Text rendering of results
src/RoslynBridge/Queries Read-only Roslyn queries
src/RoslynBridge/Changes Rename and code action proposals and their application
src/RoslynBridge/Symbols Symbol name resolution
src/RoslynBridge/Editing Workspace file edits, snapshots and preview diffs
src/RoslynBridge/Lsp Roslyn process, protocol and document synchronization
src/RoslynBridge/Settings Command-line options, the project settings file and the options they produce
src/RoslynBridge Entry point, commands, and the errors and workspace paths that every layer shares
tests/RoslynBridge.Tests Unit tests, integration tests and fixtures
eng Analyzer rules and CI tasks
docs Starlight pages and configuration

Common changes

Change Start with
Change an analyzer or style rule Analyzers
Report a new kind of failure Errors
Add or change a test Testing conventions
Name a branch or write a commit Branches and commits
Publish a release Releases
Add or change a documentation page Documentation