Using MCP in Visual Studio Code
Visual Studio Code supports the Model Context Protocol (MCP) through several paths, allowing AI agents to use tools from your HasMCP servers directly in your editor.1. Native Agent Mode (GitHub Copilot)
Add Server
Open the Command Palette (
Ctrl+Shift+P or Cmd+Shift+P), type and select MCP: Add Server, then choose HTTP (Http or Server-Sent Events).Configure
- Enter a name for your server (e.g.,
hasmcp-db). - Select Workspace Settings to create a
.vscode/mcp.jsonfile. - Enter your HasMCP server URL (e.g.,
https://app.hasmcp.com/mcp/<SERVER_ID>).
2. Extensions (Cline / Roo Code)
Open Configuration
Click the MCP icon (a plug or network icon) in the extension’s sidebar, then
click Configure MCP Servers or Edit Global Config. This opens the
configuration JSON file.
Verifying Connections
- In Native Mode: Open the Chat panel, select Agent Mode, and click the 🛠️ (tools) icon. Your HasMCP server and its tools should appear in the list.
- In Extensions: The MCP sidebar tab will show a green status indicator once the server is successfully initialized.
Troubleshooting
SSE Support
SSE Support
If using native VS Code support, ensure you are on version 1.101 or later
for full remote MCP compatibility.
Logs
Logs
You can view detailed connection logs by selecting your server in the MCP:
List Servers view or checking the Output panel in VS Code.