|
| 1 | +# 🤖 VS MCP Server |
| 2 | + |
| 3 | +**Let AI assistants like Claude control Visual Studio through the Model Context Protocol!** |
| 4 | + |
| 5 | +[](https://github.com/CodingWithCalvin/VS-VSMCP/blob/main/LICENSE) |
| 6 | +[](https://github.com/CodingWithCalvin/VS-VSMCP/actions/workflows/build.yml) |
| 7 | +[](https://marketplace.visualstudio.com/items?itemName=CodingWithCalvin.VS-VSMCP) |
| 8 | +[](https://marketplace.visualstudio.com/items?itemName=CodingWithCalvin.VS-VSMCP) |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## 🤔 What is this? |
| 13 | + |
| 14 | +**VS MCP Server** exposes Visual Studio features through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), enabling AI assistants like Claude to interact with your IDE programmatically. Open files, read code, build projects, and more - all through natural conversation! |
| 15 | + |
| 16 | +## ✨ Features |
| 17 | + |
| 18 | +### 📂 Solution Tools |
| 19 | +- **solution_info** - Get information about the current solution |
| 20 | +- **solution_open** - Open a solution file |
| 21 | +- **solution_close** - Close the current solution |
| 22 | +- **project_list** - List all projects in the solution |
| 23 | +- **project_info** - Get detailed project information |
| 24 | + |
| 25 | +### 📝 Document Tools |
| 26 | +- **document_list** - List all open documents |
| 27 | +- **document_active** - Get the active document |
| 28 | +- **document_open** - Open a file in the editor |
| 29 | +- **document_close** - Close a document |
| 30 | +- **document_read** - Read document contents |
| 31 | +- **document_write** - Write to a document |
| 32 | + |
| 33 | +### ✏️ Editor Tools |
| 34 | +- **selection_get** - Get the current text selection |
| 35 | +- **selection_set** - Set the selection range |
| 36 | +- **editor_insert** - Insert text at cursor position |
| 37 | +- **editor_replace** - Find and replace text |
| 38 | +- **editor_goto_line** - Navigate to a specific line |
| 39 | +- **editor_find** - Search within documents |
| 40 | + |
| 41 | +### 🔨 Build Tools |
| 42 | +- **build_solution** - Build the entire solution |
| 43 | +- **build_project** - Build a specific project |
| 44 | +- **clean_solution** - Clean the solution |
| 45 | +- **build_cancel** - Cancel a running build |
| 46 | +- **build_status** - Get current build status |
| 47 | + |
| 48 | +## 🛠️ Installation |
| 49 | + |
| 50 | +### Visual Studio Marketplace |
| 51 | + |
| 52 | +1. Open Visual Studio 2022 or 2026 |
| 53 | +2. Go to **Extensions > Manage Extensions** |
| 54 | +3. Search for "VS MCP Server" |
| 55 | +4. Click **Download** and restart Visual Studio |
| 56 | + |
| 57 | +### Manual Installation |
| 58 | + |
| 59 | +Download the latest `.vsix` from the [Releases](https://github.com/CodingWithCalvin/VS-VSMCP/releases) page and double-click to install. |
| 60 | + |
| 61 | +## 🚀 Usage |
| 62 | + |
| 63 | +### Starting the Server |
| 64 | + |
| 65 | +1. Open Visual Studio |
| 66 | +2. Go to **Tools > VSMCP > Start Server** (or enable auto-start in settings) |
| 67 | +3. The MCP server starts on `http://localhost:5050` |
| 68 | + |
| 69 | +### Configuring Claude Desktop |
| 70 | + |
| 71 | +Add this to your Claude Desktop MCP settings: |
| 72 | + |
| 73 | +```json |
| 74 | +{ |
| 75 | + "mcpServers": { |
| 76 | + "visual-studio": { |
| 77 | + "url": "http://localhost:5050" |
| 78 | + } |
| 79 | + } |
| 80 | +} |
| 81 | +``` |
| 82 | + |
| 83 | +### Settings |
| 84 | + |
| 85 | +Configure the extension at **Tools > Options > VSMCP**: |
| 86 | + |
| 87 | +- **Auto-start server** - Start the MCP server when Visual Studio launches |
| 88 | +- **HTTP Port** - Port for the MCP server (default: 5050) |
| 89 | + |
| 90 | +## 🏗️ Architecture |
| 91 | + |
| 92 | +``` |
| 93 | +┌─────────────────┐ ┌─────────────────────┐ named pipes ┌─────────────────┐ |
| 94 | +│ Claude Desktop │ HTTP/SSE │ VSMCP.Server.exe │ ◄────────────────► │ VS Extension │ |
| 95 | +│ (MCP Client) │ ◄────────────► │ (MCP Server) │ JSON-RPC │ (Tool Impl) │ |
| 96 | +└─────────────────┘ :5050 └─────────────────────┘ └─────────────────┘ |
| 97 | +``` |
| 98 | + |
| 99 | +## 🤝 Contributing |
| 100 | + |
| 101 | +Contributions are welcome! Whether it's bug reports, feature requests, or pull requests - all feedback helps make this extension better. |
| 102 | + |
| 103 | +### Development Setup |
| 104 | + |
| 105 | +1. Clone the repository |
| 106 | +2. Open `src/CodingWithCalvin.VSMCP.slnx` in Visual Studio 2022 |
| 107 | +3. Ensure you have the "Visual Studio extension development" workload installed |
| 108 | +4. Ensure you have .NET 10.0 SDK installed |
| 109 | +5. Press F5 to launch the experimental instance |
| 110 | + |
| 111 | +## 📄 License |
| 112 | + |
| 113 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 114 | + |
| 115 | +--- |
| 116 | + |
| 117 | +## 👥 Contributors |
| 118 | + |
| 119 | +<!-- readme: contributors -start --> |
| 120 | +<!-- readme: contributors -end --> |
| 121 | + |
| 122 | +--- |
| 123 | + |
| 124 | +Made with ❤️ by [Coding With Calvin](https://github.com/CalvinAllen) |
0 commit comments