How to Set Up MCP Servers in VS Code
Guide to vscode mcp server setup: Model Context Protocol (MCP) servers in VS Code connect GitHub Copilot Chat to external tools and data sources, letting the AI assistant read files, query databases, and interact with APIs directly from your editor. While Claude Desktop was the first to support MCP, VS Code now offers native integration through its chat interface. This guide covers the setup process using the `.vscode/mcp.json` configuration file, security best practices, and top servers to impr
What Are MCP Servers in VS Code?
MCP (Model Context Protocol) servers are bridges that standardize how AI agents interact with external data and tools. In VS Code, an MCP server runs locally or remotely and exposes capabilities like reading a database schema, executing a terminal command, or uploading a file to the GitHub Copilot Chat extension. Until now, AI coding assistants have been limited to the context you manually provide: the open files in your editor or the code snippets you paste into the chat. MCP changes this by giving the AI "arms and legs." Instead of just reading code, it can now query systems to fetch the information it needs.
Key capabilities MCP adds:
- File System Access: Read and write files outside the current workspace for cross-project refactoring.
- Database Querying: Connect to PostgreSQL, SQLite, or other DBs to fetch schemas and rows without writing temporary query scripts.
- API Interaction: Send requests to third-party APIs like Slack, Linear, GitHub, or Fast.io to manage tasks and deployments.
- Browser Automation: Control a headless browser to fetch web content, take screenshots, or test UI components. Anthropic open-sourced the protocol, but it has been quickly adopted by the wider AI ecosystem, including Microsoft's GitHub Copilot. This interoperability means the same server you write for Claude Desktop can work in VS Code with minimal reconfiguration.
Helpful references: Fast.io Workspaces, Fast.io Collaboration, and Fast.io AI.
Prerequisites for VS Code MCP Setup
Before configuring MCP servers, check that your environment meets these requirements. Support for MCP in VS Code is new and depends on specific extensions and runtime environments.
Required Components: 1.
Visual Studio Code: Use the latest release (version 1.96 or higher recommended). The MCP integration is actively evolving, so staying current gives you the latest protocol support. 2.
GitHub Copilot Extension: You need an active GitHub Copilot subscription. The free tier of Copilot may have limited access to advanced agent features, so a Pro or Business plan is usually required. 3.
GitHub Copilot Chat Extension: This is the interface that communicates with MCP servers. Make sure it is installed and enabled.
Runtime Requirements: Most MCP servers are built as executable scripts that VS Code spawns as background processes.
- Node.js: Many servers (like the filesystem or Fast.io servers) are distributed as NPM packages. You need Node.js v18+ installed (
node -v). - Python: Data science and database tools are written in Python. You need Python 3.10+ installed (
python --version) and a tool likeuvorpipfor package management.
Step-by-Step: Configuring .vscode/mcp.json
VS Code uses a workspace configuration file to manage MCP connections. Unlike Claude Desktop, which uses a global configuration file, VS Code lets you define different sets of tools for different projects via the .vscode folder.
1. Create the Configuration File
In the root of your project, create a folder named .vscode if it doesn't exist. Inside that folder, create a file named mcp.json.
2. Define the Server Structure
The mcp.json file uses a standard JSON structure. You define a dictionary of mcpServers, where each key is the server's unique name, and the value describes how to run it. Here is a template configuration connecting a SQLite database and a filesystem tool:
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": ["mcp-server-sqlite", "--db-path", "./my-database.db"]
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/username/desktop"]
}
}
}
3. Understanding the Configuration Fields
- command: The executable to run (e.g.,
npx,uvx,python,node). It must be available in your system PATH. - args: An array of string arguments passed to the command. This includes the package name and any server flags (like database paths).
- env: (Optional) A dictionary of environment variables. Use this for API keys or configuration secrets.
4. Reload the Window
VS Code does not always hot-reload changes to mcp.json. After saving the file, open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) and run "Developer: Reload Window". This forces the Copilot extension to restart and spawn the defined MCP servers. You should see a notification if a server fails to start.
Top 5 MCP Servers for VS Code Developers
Now that your environment is set up, which servers should you install? Here are the most valuable MCP servers for general software development.
1. Filesystem Server
- Package:
@modelcontextprotocol/server-filesystem - Use Case: Lets Copilot read/write files outside the current workspace. Great for checking reference code in other projects or writing logs to a desktop folder.
2. SQLite Server
- Package:
mcp-server-sqlite - Use Case: Direct database introspection. Ask "Show me the schema for the users table" or "Check if user X exists" without writing SQL manually.
3. GitHub Server
- Package:
@modelcontextprotocol/server-github - Use Case: Manage your repository. Ask Copilot to "Create an issue for this bug," "Search recent PRs," or "Check CI status" directly from the editor.
4. PostgreSQL Server
- Package:
@modelcontextprotocol/server-postgres - Use Case: Similar to SQLite but for production databases. Useful for generating complex SQL queries based on the live schema.
5. Fast.io Server
- Package:
@fastio/mcp-server - Use Case: Cloud file storage and sharing. Lets agents upload artifacts, share huge video files, or manage project assets programmatically.
Connecting the Fast.io MCP Server
For developers building AI agents, file storage is a major bottleneck. Agents generate logs, images, and data exports that clutter local drives and are hard to share. The Fast.io MCP server solves this by providing 50GB of persistent, scalable cloud storage that agents can access via standard tools.
Why add Fast.io to VS Code?
- Persistent Memory: Store agent outputs permanently, not just for the session.
- Easy Sharing: Agent generates a file, Fast.io uploads it, and the agent returns a shareable link to you.
- Large Files: Handle video or datasets that are too large for git.
Configuration:
Update your .vscode/mcp.json to include the Fast.io server:
{
"mcpServers": {
"fastio": {
"command": "npx",
"args": ["-y", "@fastio/mcp-server"],
"env": {
"FASTIO_API_KEY": "your-api-key"
}
}
}
}
Once connected, you can ask Copilot to "Upload the 'dist' folder to Fast.io" or "List all PDF files in my 'contracts' bucket." The agent executes the real API calls, handling authentication and transfer automatically.
Give Your AI Agents Persistent Storage
Stop relying on ephemeral files. Connect the Fast.io MCP server to give your AI agents 50GB of persistent, shareable cloud storage.
Security & Permissions in VS Code MCP
Granting an AI agent access to your shell, filesystem, and databases carries risks. VS Code implements a permission model to keep you in control.
The Permission Dialog When you ask Copilot to perform an action that uses an MCP tool (like "Delete this file" or "Query the production DB"), VS Code shows a permission dialog before executing.
- Allow Once: Grants permission for this tool call only.
- Always Allow: Approves this server for the current workspace.
Best Practices:
- Read-Only Database Users: When connecting to a database, use a read-only user credential in your
mcp.jsonunless you want the agent to modify data. - Scope Filesystem Access: Don't give the filesystem server access to your entire root drive (
/). Restrict it to project or scratch directories (e.g.,/Users/me/projects). - Review
envVariables: Make sure yourmcp.jsonis in.gitignoreif it contains API keys. If the server supports it, use a.envfile loader, or use VS Code's secret storage if/when supported by the extension.
VS Code MCP vs. Claude Desktop MCP
If you are coming from Claude Desktop, here's how the VS Code experience compares.
Configuration Location
- Claude Desktop: Uses a global
config.jsonfile (in~/Library/Application Support/Claude). Tools are available across all conversations. - VS Code: Uses a workspace
.vscode/mcp.json. Tools are scoped to the project. This is better for keeping project tools (like a DB connection) isolated.
Interface Integration
- Claude Desktop: Tools appear as generic functions. The UI is chat-focused.
- VS Code: Deeply integrated with the editor. Copilot can reference open files and the active selection alongside MCP tool data.
Ecosystem Both use the same underlying protocol. A server written for Claude Desktop works in VS Code, assuming the command and arguments are compatible with your OS environment.
Troubleshooting Common MCP Issues
If Copilot isn't seeing your tools, check these common pitfalls:
- JSON Syntax Errors: Make sure your
mcp.jsonis valid JSON. A missing comma or mismatched bracket will prevent all servers from loading. Use a JSON validator or VS Code's built-in linter. - Path Resolution: Use absolute paths for arguments like database locations or file directories. Relative paths (like
./db.sqlite) are resolved relative to the workspace root, which can be unclear in multi-root workspaces. - Node/Python Version: If a server fails to start, try running the command manually in your terminal (e.g.,
npx -y @fastio/mcp-server) to see if it errors out due to version mismatches. - Extension Conflicts: Other chat extensions can interfere. Try disabling non-Copilot AI extensions if connection issues persist.
- Server Logs: Use the "Output" panel in VS Code (
Cmd+Shift+U), select "GitHub Copilot" or "GitHub Copilot Chat" from the dropdown, and look for "MCP" related logs. This is the source of truth for connection errors.
Frequently Asked Questions
Does VS Code support MCP servers natively?
Yes, VS Code supports MCP servers through the GitHub Copilot Chat extension. Support was added to enable 'Agent Mode,' allowing the AI to use tools defined in a workspace configuration file.
Where is the MCP config file located in VS Code?
The configuration file is located at `.vscode/mcp.json` in the root of your workspace. This file defines the server commands, arguments, and environment variables.
Can I use Claude Desktop MCP servers in VS Code?
Yes, the underlying protocol is the same. You can use the same server packages (like `@modelcontextprotocol/server-sqlite`), but you must format the configuration for VS Code's `mcp.json` structure, which differs slightly from Claude Desktop's config.
Is the Fast.io MCP server free?
Yes, the Fast.io MCP server is free to use. It connects to the Fast.io agent tier, which provides 50GB of storage, 5,000 monthly credits, and 251 file management tools without requiring a credit card.
How do I restart the MCP server in VS Code?
The most reliable way to restart MCP servers is to reload the VS Code window. Open the Command Palette (Cmd+Shift+P) and run 'Developer: Reload Window'.
Related Resources
Give Your AI Agents Persistent Storage
Stop relying on ephemeral files. Connect the Fast.io MCP server to give your AI agents 50GB of persistent, shareable cloud storage.