MCP (Model Context Protocol) servers extend AI coding assistants by connecting them to external tools and APIs. In VS Code, MCP servers give GitHub Copilot’s agent mode access to tools like AWS documentation search and cloud resource management. In Claude Desktop and Claude Code CLI, MCP servers let Claude interact with your filesystem, GitHub repos, databases, and more: all from within the conversation. This guide shows you how to configure MCP servers across all three tools on WSL, with practical examples for each.
The examples in this guide are run on WSL2 Ubuntu in Windows, but the MCP configuration format works the same on any platform.
Prerequisites
- VS Code with the WSL extension connected to your Ubuntu instance
- GitHub Copilot extension installed (with an active Copilot subscription)
- For Claude Desktop: the Claude Desktop app installed
- For Claude Code: the Claude Code CLI installed on WSL
- For AWS MCP servers:
uvinstalled (the Python package runner from Astral) and AWS CLI configured with credentials Node.jsandnpminstalled (required fornpx-based MCP servers)
How MCP Servers Work
MCP servers expose tools over a standard protocol. When an AI assistant supports MCP, it can discover and call these tools during a conversation. For example, a GitHub MCP server lets the assistant create pull requests, and a filesystem server lets it read and write files on your machine.
Each tool: VS Code (Copilot), Claude Desktop, and Claude Code CLI: reads MCP server definitions from a JSON config file, starts the server processes, and makes their tools available in the chat. Use the examples for the specific host; local processes and remote HTTP connections have different configuration and authentication requirements.
Configuration Overview by Tool
| Tool | Config File | Top-Level Key |
|---|---|---|
| VS Code (Copilot) | .vscode/mcp.json or user mcp.json |
"servers" |
| Claude Desktop | claude_desktop_config.json |
"mcpServers" |
| Claude Code CLI | .mcp.json (project) or ~/.claude.json (user) |
"mcpServers" |
Local stdio entries commonly use command, args, and env. Remote HTTP servers instead use a URL and host-specific authentication. Client schemas, secret expansion, and process environments differ; do not copy one host’s JSON into another without adapting it.
VS Code (GitHub Copilot) Configuration
When you switch Copilot Chat to Agent mode (click the mode selector in the chat panel), Copilot can use tools provided by MCP servers. VS Code reads server definitions from a mcp.json file and starts them automatically.
Configuration Scopes
| Scope | File Location | Use Case |
|---|---|---|
| Workspace | .vscode/mcp.json in your project |
Project-specific servers. Can be committed to source control. |
| User (Global) | User profile mcp.json |
Servers available across all workspaces. |
Use the Command Palette (Ctrl+Shift+P) to open the MCP configuration for the intended execution environment. The local user configuration belongs to Windows, while WSL remote-user configuration belongs to the remote environment (commonly ~/.vscode-server/data/User/mcp.json). Use the remote-user configuration command when available, or a workspace .vscode/mcp.json opened in the WSL window. Confirm the server runs where its executable and filesystem paths exist.
Workspace settings override global ones if they define the same server name.
VS Code Configuration Format
{
"servers": {
"server-name": {
"command": "uvx",
"args": ["package-name@latest"],
"env": {
"ENV_VAR": "value"
}
}
},
"inputs": []
}
servers: maps server names to their configurationcommand: the executable to run (uvx,npx,node,python, etc.)args: command arguments (package name, flags, paths)env: environment variables passed to the server processinputs: optional input variable definitions for secrets like API keys
Example: AWS MCP Servers in VS Code
AWS provides official open-source MCP servers through awslabs. Here’s how to add the AWS Documentation server (searches AWS docs) and the AWS IaC server (helps with infrastructure as code).
{
"servers": {
"aws-documentation": {
"command": "uvx",
"args": ["awslabs.aws-documentation-mcp-server@latest"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
}
},
"aws-iac": {
"command": "uvx",
"args": ["awslabs.aws-iac-mcp-server@latest"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}
aws-documentation: lets Copilot search official AWS documentation, API references, and getting-started guidesaws-iac: provides CDK construct lookup and IaC guidance for AWS CloudFormation and CDK projects@latest: ensures you always run the newest versionFASTMCP_LOG_LEVEL: set toERRORto reduce noise in the output panel
After saving mcp.json, VS Code detects the change and shows a Start button at the top of the file. Click it to start all configured servers. You can also run MCP: List Servers from the Command Palette to see their status.
Claude Desktop Configuration
Claude Desktop reads MCP server definitions from a single config file. On Linux/WSL, you’ll typically access this through the Claude Desktop app on the Windows side.
Config File Location
| Platform | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
You can also open this file from Claude Desktop by going to Settings → Developer → Edit Config.
Claude Desktop Configuration Format
Claude Desktop uses mcpServers as the top-level key (not servers like VS Code):
{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "package-name"],
"env": {
"ENV_VAR": "value"
}
}
}
}
Example: Filesystem in WSL and Official GitHub Options
For Windows Claude Desktop, this example launches the filesystem server inside WSL explicitly. Replace Ubuntu with the name from wsl --list --quiet, the npx path with its absolute WSL path, and the allowed project directory. For nvm installations, npx is usually under a versioned home-directory path rather than /usr/bin/npx:
{
"mcpServers": {
"filesystem": {
"command": "wsl.exe",
"args": [
"-d",
"Ubuntu",
"--exec",
"/usr/bin/npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"/home/youruser/projects"
]
}
}
}
filesystem: gives Claude read/write access to the specified directory. Add multiple paths as additional arguments to grant access to more folders.- For GitHub, use the official GitHub MCP server and its Claude installation instructions. Remote connectors are configured through the Desktop UI where supported; do not assume Claude Code’s HTTP JSON schema belongs in Desktop’s local-server config.
-y: auto-confirms thenpxinstall prompt so the server starts without manual intervention.
After saving the config, fully quit Claude Desktop and reopen it. The app needs a restart to load new MCP server configurations.
Claude Code CLI Configuration
Claude Code CLI supports MCP servers natively with both a CLI command and direct config file editing. This is the most flexible option for developers working in the terminal.
Configuration Scopes
| Scope | File | Use Case |
|---|---|---|
| Local (default) | ~/.claude.json (project-specific entry) |
Private to you, only active in the current project. |
| Project | .mcp.json in project root |
Shared with team via source control. |
| User | ~/.claude.json (global entry) |
Available across all projects on your machine. |
Adding Servers via CLI
The fastest way to add MCP servers to Claude Code is with the claude mcp add command:
# Filesystem server runs in the WSL terminal where Claude Code is installed.
claude mcp add filesystem --scope user -- npx -y @modelcontextprotocol/server-filesystem ~/projects
# Official GitHub remote server. Authenticate using /mcp when supported.
claude mcp add --transport http github --scope user https://api.githubcopilot.com/mcp/
claude mcp add context7 --scope user -- npx -y @upstash/context7-mcp@latest
claude mcp add sequential-thinking --scope user -- npx -y @modelcontextprotocol/server-sequential-thinking
claude mcp list
# Remove a configuration only when you no longer need it:
# claude mcp remove github
-s user: sets user scope so the server is available across all projects-s local: (default) restricts the server to the current project-e KEY=VALUE: passes environment variables to the server process--: separates theclaude mcp addoptions from the server command and arguments
Adding Servers via Config File
For complex configurations, edit the config file directly. Create a .mcp.json file in your project root to share servers with your team:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/home/youruser/projects"
]
},
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer ${GITHUB_TOKEN}"
}
},
"context7": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp@latest"
]
},
"aws-documentation": {
"command": "uvx",
"args": [
"awslabs.aws-documentation-mcp-server@latest"
],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}
Claude Code supports environment variable expansion in .mcp.json files using ${VAR} and ${VAR:-default} syntax. This lets you share the config file without exposing secrets: each team member sets their own environment variables.
Use /mcp to inspect or reconnect servers. If changes are not picked up, exit and restart claude; /mcp is a management command, not a restart of the entire CLI.
Install uv and Python (for AWS MCP Servers)
The AWS MCP servers use uvx as their runtime. If you plan to use them in any of the tools above, install uv and Python first.
1. Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
Restart your terminal or run source $HOME/.local/bin/env to add uv and uvx to your PATH.
2. Install Python 3.10+
uv python install 3.10
Using Input Variables for Secrets (VS Code)
If an MCP server needs an API key in VS Code, never hardcode it in mcp.json. Use input variables instead: VS Code will prompt you for the value when the server starts:
{
"inputs": [
{
"type": "promptString",
"id": "github-token",
"description": "Fine-grained GitHub Personal Access Token",
"password": true
}
],
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer ${input:github-token}"
}
}
}
}
The password: true flag hides the VS Code prompt. The official GitHub server also supports OAuth in compatible hosts: omit the headers and inputs for the VS Code OAuth example. For Claude Code, supply GITHUB_TOKEN through a secret manager or a hidden shell prompt, not a literal token in a CLI command or tracked file. Windows Claude Desktop does not read WSL’s ~/.bashrc; configure its connector authentication in the Windows app or pass secrets through an explicitly configured process environment. Environment-variable expansion is host-specific.
Troubleshooting
“spawn npm ENOENT” or “spawn uvx ENOENT”
This means the tool can’t find the command binary. In VS Code on WSL, the server process doesn’t inherit your shell’s PATH. In Claude Desktop on Windows, the same issue occurs when binaries aren’t in the system PATH.
Fix it by using the full absolute path to the command:
which uvx
If it returns /home/youruser/.local/bin/uvx, use that full path in your config:
{
"command": "/home/youruser/.local/bin/uvx",
"args": ["awslabs.aws-documentation-mcp-server@latest"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
For WSL-native clients, the same fix applies to npx. For Windows Desktop, keep wsl.exe as the command and use the absolute Linux executable path inside its arguments. A Windows process cannot directly execute /home/....
Server starts but tools don’t appear (VS Code)
- Select Agent mode and enable the required tools in the tool picker. Mode names and available tools depend on the installed VS Code version.
- Run
MCP: List Serversto check if the server status shows “Running”. If it shows an error, check the Output panel (Ctrl+Shift+U) and select the MCP server from the dropdown. - Try
MCP: Reset Cached Toolsfrom the Command Palette to clear stale tool data.
Claude Desktop doesn’t load new servers
Claude Desktop requires a full restart after editing the config. Closing the window is not enough: fully quit the app (right-click the tray icon → Quit) and reopen it.
Claude Code CLI servers not connecting
Run claude mcp list to check server status. If a server shows errors, verify the command path exists and any required environment variables are set. You can also run /mcp inside a Claude Code session to see server status and restart them.
Invalid JSON in config files
A single syntax error breaks all servers. Validate the file:
# For VS Code
python3 -m json.tool ~/.vscode-server/data/User/mcp.json
# For Claude Code project config
python3 -m json.tool .mcp.json
If it prints the formatted JSON, the syntax is valid. If it shows an error, fix the line it points to.
AWS credentials not found
The AWS MCP servers use your local AWS credentials. If you get authentication errors, make sure ~/.aws/credentials or ~/.aws/config is set up correctly in your WSL environment. See How to Configure AWS SSO CLI Access for Linux Ubuntu if you use SSO.
Conclusion
MCP servers work across VS Code (GitHub Copilot), Claude Desktop, and Claude Code CLI with a nearly identical configuration format. Important differences include the execution environment, transport, authentication, and top-level JSON key (servers for VS Code, mcpServers for Claude). Once you understand the pattern, you can add any MCP server to any tool in seconds. For more on setting up your WSL development environment, see How to Install Claude Code CLI on WSL2 Ubuntu.


