Other tools read your files. MCP AI Server understands your code. The first and only Visual Studio extension that gives AI assistants access to the C compiler (Roslyn) through the Model Context Protocol. 20 tools. 12 powered by Roslyn. Semantic understanding, not text matching. Install from Visual Studio Marketplace Or search for "MCP AI Server" in Visual Studio Extensions Manager. Click to watch
Add this skill
npx mdskills install LadislavSopko/mcp-ai-server-visual-studioExposes Roslyn semantic analysis as 20 MCP tools for C# understanding and refactoring
1# MCP AI Server for Visual Studio23**Other tools read your files. MCP AI Server understands your code.**45[](https://marketplace.visualstudio.com/items?itemName=LadislavSopko.mcpserverforvs)6[](https://visualstudio.microsoft.com/)7[](https://marketplace.visualstudio.com/items?itemName=LadislavSopko.mcpserverforvs)8[](https://modelcontextprotocol.io/)9[](https://www.0ics.com/static/vs-mcp.html)1011The first and only Visual Studio extension that gives AI assistants access to the C# compiler (Roslyn) through the Model Context Protocol. 20 tools. 12 powered by Roslyn. Semantic understanding, not text matching.1213## Install1415**[Install from Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=LadislavSopko.mcpserverforvs)**1617Or search for **"MCP AI Server"** in Visual Studio Extensions Manager.1819### See it in Action2021[](https://youtu.be/fYV4oqY9n5g)2223*Click to watch on YouTube*2425---2627## Why MCP AI Server?2829AI coding tools (Claude Code, Codex CLI, Gemini CLI, OpenCode, Cursor, Copilot, Windsurf...) operate at the filesystem level — they read text, run grep, execute builds. They don't understand your code the way Visual Studio does.3031MCP AI Server bridges this gap by exposing IntelliSense-level intelligence as MCP tools. Your AI assistant gets the same semantic understanding that powers F12 (Go to Definition), Shift+F12 (Find All References), and safe refactoring.3233### What becomes possible:3435| You ask | Without MCP AI Server | With MCP AI Server |36|---------|---------------|-------------|37| "Find WhisperFactory" | grep returns 47 matches | `Class, Whisper.net, line 16` — one exact answer |38| "Rename ProcessDocument" | sed breaks ProcessDocumentAsync | Roslyn renames 23 call sites safely |39| "What implements IDocumentService?" | Impossible via grep | Full inheritance tree with interfaces |40| "What calls AuthenticateUser?" | Text matches, can't tell direction | Precise call graph: callers + callees |4142---4344## 20 Tools4546### Semantic Navigation (Roslyn-powered)47| Tool | Description |48|------|-------------|49| `FindSymbols` | Find classes, methods, properties by name — semantic, not text |50| `FindSymbolDefinition` | Go to definition (F12 equivalent) |51| `FindSymbolUsages` | Find all references, compiler-verified (Shift+F12 equivalent) |52| `GetSymbolAtLocation` | Identify the symbol at a specific line and column |53| `GetDocumentOutline` | Semantic structure: classes, methods, properties, fields |5455### Code Understanding (Roslyn-powered)56| Tool | Description |57|------|-------------|58| `GetInheritance` | Full type hierarchy: base types, derived types, interfaces |59| `GetMethodCallers` | Which methods call this method (call graph UP) |60| `GetMethodCalls` | Which methods this method calls (call graph DOWN) |6162### Refactoring (Roslyn-powered)63| Tool | Description |64|------|-------------|65| `RenameSymbol` | Safe rename across the entire solution — compiler-verified |66| `FormatDocument` | Visual Studio's native code formatter |6768### Project & Build69| Tool | Description |70|------|-------------|71| `ExecuteCommand` | Build or clean solution/project with structured diagnostics |72| `ExecuteAsyncTest` | Run tests asynchronously with real-time status |73| `GetSolutionTree` | Solution and project structure |74| `GetProjectReferences` | Project dependency graph |75| `TranslatePath` | Convert paths between Windows and WSL formats |7677### Editor Integration78| Tool | Description |79|------|-------------|80| `GetActiveFile` | Current file and cursor position |81| `GetSelection` / `CheckSelection` | Read active text selection |82| `GetLoggingStatus` / `SetLogLevel` | Extension diagnostics |8384---8586## Compatible Clients8788Works with any MCP-compatible AI tool:8990**CLI Agents:**91- **Claude Code** — Anthropic's terminal AI coding agent92- **Codex CLI** — OpenAI's terminal coding agent93- **Gemini CLI** — Google's open-source terminal agent94- **OpenCode** — Open-source AI coding agent (45k+ GitHub stars)95- **Goose** — Block's open-source AI agent96- **Aider** — AI pair programming in terminal9798**Desktop & IDE:**99- **Claude Desktop** — Anthropic's desktop app100- **Cursor** — AI-first code editor101- **Windsurf** — Codeium's AI IDE102- **VS Code + Copilot** — GitHub Copilot with MCP103- **Cline** — VS Code extension104- **Continue** — Open-source AI assistant105106**Any MCP client** — open protocol, universal compatibility107108---109110## Quick Start1111121. **[Install](https://marketplace.visualstudio.com/items?itemName=LadislavSopko.mcpserverforvs)** from Visual Studio Marketplace1132. **Open** your .NET solution in Visual Studio1143. **Configure port** in MCP Server Settings (default: 3010)1154. **Add to your MCP client:**116117```json118"vs-mcp": {119 "type": "http",120 "url": "http://localhost:3010/sdk/"121}122```1231245. **Start** asking your AI semantic questions about your code125126---127128## MCP Client Configuration129130| AI Tool | Type | Config File |131|---------|------|-------------|132| **[Claude Code](https://claude.ai/code)** | CLI | `CLAUDE.md` |133| **[Claude Desktop](https://claude.ai/download)** | App | `claude_desktop_config.json` |134| **[Cursor](https://cursor.sh)** | IDE | `.cursor/rules/*.mdc` or `.cursorrules` |135| **[Windsurf](https://codeium.com/windsurf)** | IDE | `.windsurfrules` |136| **[Cline](https://cline.bot)** | VS Code Extension | `.clinerules/` directory |137| **[VS Code + Copilot](https://code.visualstudio.com/)** | IDE | `.github/copilot-instructions.md` |138| **[Continue](https://continue.dev)** | IDE Extension | `.continue/config.json` |139| **[Gemini CLI](https://github.com/google-gemini/gemini-cli)** | CLI | `GEMINI.md` |140| **[OpenAI Codex CLI](https://github.com/openai/codex)** | CLI | `AGENTS.md` |141| **[Goose](https://github.com/block/goose)** | CLI | `.goose/config.yaml` |142143Any tool supporting [Model Context Protocol](https://modelcontextprotocol.io/) will work.144145---146147## Configure AI Preferences (Recommended)148149Add these instructions to your project's AI config file (see table above) to ensure your AI **automatically** prefers MCP tools:150151```markdown152## MCP Tools - ALWAYS PREFER153154When `mcp__vs-mcp__*` tools are available, ALWAYS use them instead of Grep/Glob/LS:155156| Instead of | Use |157|------------|-----|158| `Grep` for symbols | `FindSymbols`, `FindSymbolUsages` |159| `LS` to explore projects | `GetSolutionTree` |160| Reading files to find code | `FindSymbolDefinition` then `Read` |161| Searching for method calls | `GetMethodCallers`, `GetMethodCalls` |162163**Why?** MCP tools use Roslyn semantic analysis - 10x faster, 90% fewer tokens.164```165166---167168## Multi-Solution: Understand Your Dependencies169170Need the AI to understand a library you depend on? Clone the source from GitHub, open it in a second Visual Studio — each instance runs its own MCP server on a **configurable port**.171172```173Your project → port 3010174Library source (cloned from GitHub) → port 3011175Framework source → port 3012176```177178Your AI connects to all of them. It can trace calls, find usage patterns, and understand inheritance **across your code and library code**.179180**MCP client configuration — three options depending on your client:**181182Clients with native HTTP support (Claude Desktop, Claude Code):183```json184{185 "mcpServers": {186 "vs-mcp": {187 "type": "http",188 "url": "http://localhost:3010/sdk/"189 },190 "vs-mcp-whisper": {191 "type": "http",192 "url": "http://localhost:3011/sdk/"193 }194 }195}196```197198Clients without HTTP support (via mcp-remote proxy):199```json200{201 "mcpServers": {202 "vs-mcp": {203 "command": "npx",204 "args": ["-y", "mcp-remote", "http://localhost:3010/sdk/"]205 },206 "vs-mcp-whisper": {207 "command": "npx",208 "args": ["-y", "mcp-remote", "http://localhost:3011/sdk/"]209 }210 }211}212```213214Codex CLI (TOML):215```toml216[mcp_servers.vs-mcp]217type = "stdio"218command = "npx"219args = ["mcp-remote", "http://localhost:3010/sdk/"]220221[mcp_servers.vs-mcp-whisper]222type = "stdio"223command = "npx"224args = ["mcp-remote", "http://localhost:3011/sdk/"]225```226227---228229## Settings230231**Tools** → **MCP Server Settings**232233| Setting | Default | Description |234|---------|---------|-------------|235| **Port** | 3001 | Server port (configurable per VS instance) |236| **Path Format** | WSL | Output as `/mnt/c/...` or `C:\...` |237| **Tools** | All enabled | Enable/disable individual tool groups |238239Changes apply on next server start.240241---242243## vs. Other Approaches244245| Approach | Symbol Search | Inheritance | Call Graph | Safe Rename |246|----------|:---:|:---:|:---:|:---:|247| **MCP AI Server (Roslyn)** | Semantic | Full tree | Callers + Callees | Compiler-verified |248| AI Agent (grep/fs) | Text match | No | No | Text replace |249| Other MCP servers | No | No | No | No |250251---252253## Requirements254255- **Visual Studio 2022** (17.13+) or **Visual Studio 2026**256- **Windows** (amd64 or arm64)257- Any MCP-compatible AI tool258259---260261## Issues & Feature Requests262263Found a bug or have an idea? [Open an issue](https://github.com/LadislavSopko/mcp-ai-server-visual-studio/issues/new/choose)!264265---266267## About268269**[0ics srl](https://0ics.it)** — Italian software company specializing in AI-powered development tools.270271Built by **Ladislav Sopko** — 30 years of software development, from assembler to enterprise .NET.272273---274275*MCP AI Server: Because your AI deserves the same intelligence as your IDE.*276
Full transparency — inspect the skill content before installing.