Configuring MCP Server with VS Code
Overview
Visual Studio Code provides support for Model Context Protocol (MCP) servers through GitHub Copilot's MCP integration. This guide shows you how to connect your Cequence AI Gateway MCP server to VS Code.
VS Code MCP support requires GitHub Copilot. Ensure you have Copilot enabled in your VS Code installation.
Configuration Methods
VS Code supports two configuration scopes:
- Workspace: Configuration stored in
.vscode/mcp.json(project-specific) - Global: Configuration stored in user settings (available across all projects)
Method 1: Quick Setup with NPX (Recommended)
The fastest way to configure your MCP server:
npx @cequenceai/mcp-cli@latest vscode --url "your-mcp-server-url" --name "your-server-name"
Options
| Flag | Description | Required |
|---|---|---|
-u, --url | Cequence MCP server URL | Yes |
-n, --name | Server name (default: "cequence-mcp") | No |
-g, --global | Configure globally instead of workspace | No |
-k, --api-key | API key for authentication | No |
Examples
Workspace configuration:
npx @cequenceai/mcp-cli@latest vscode --url "https://mcp.aigateway.cequence.ai/v1/servers/abc123" --name "salesforce"
Global configuration:
npx @cequenceai/mcp-cli@latest vscode --url "https://mcp.aigateway.cequence.ai/v1/servers/abc123" --name "salesforce" --global
Method 2: Manual Configuration
2.1 Workspace Configuration
Create or edit .vscode/mcp.json in your project root:
{
"servers": {
"your-server-name": {
"type": "http",
"url": "your-mcp-server-url"
}
}
}
2.2 Global Configuration
Edit your VS Code user settings to add MCP servers globally:
macOS:
~/Library/Application Support/Code/User/mcp.json
Windows:
%APPDATA%\Code\User\mcp.json
Linux:
~/.config/Code/User/mcp.json
Configuration Parameters
Replace the following placeholders:
your-server-name: A descriptive name for your MCP server (e.g., "salesforce-crm", "github-repo", "jira-project")your-mcp-server-url: The URL provided by Cequence AI Gateway after creating your MCP server
Multiple MCP Servers
To configure multiple MCP servers:
{
"servers": {
"github": {
"type": "http",
"url": "https://mcp.aigateway.cequence.ai/v1/servers/github-abc"
},
"jira": {
"type": "http",
"url": "https://mcp.aigateway.cequence.ai/v1/servers/jira-xyz"
},
"salesforce": {
"type": "http",
"url": "https://mcp.aigateway.cequence.ai/v1/servers/sf-123"
}
}
}
Configuration with Authentication
If your MCP server requires API key authentication, use input variables:
{
"inputs": [
{
"type": "promptString",
"id": "salesforce-api-key",
"description": "Salesforce API Key",
"password": true
}
],
"servers": {
"salesforce": {
"type": "http",
"url": "https://mcp.aigateway.cequence.ai/v1/servers/sf-123",
"headers": {
"Authorization": "Bearer ${input:salesforce-api-key}"
}
}
}
}
VS Code will prompt for the API key when the MCP server is first accessed.
Verification
Once configured, verify your MCP server is working:
- Open VS Code
- Open the Copilot chat panel (
Ctrl+Shift+IorCmd+Shift+I) - Check for available MCP tools in the chat interface
- Try a command related to your configured service
Check MCP Status
- Open Command Palette (
Ctrl+Shift+PorCmd+Shift+P) - Search for "MCP" related commands
- Verify your server appears in the list
Using MCP Servers in VS Code
In Copilot Chat
Interact with your MCP server through natural language:
"List my open GitHub pull requests"
"Create a Jira ticket for the login bug"
"Query Salesforce for recent opportunities"
In Code Editor
Use Copilot features that leverage your MCP servers:
- Context-aware code suggestions
- Documentation generation
- Automated refactoring with external data
Troubleshooting
MCP Server Not Appearing
Issue: Server doesn't show up after configuration
Solutions:
- Verify JSON syntax is valid (no trailing commas)
- Check the file is in the correct location
- Restart VS Code completely
- Ensure GitHub Copilot extension is installed and enabled
Connection Errors
Issue: "Cannot connect to MCP server"
Solutions:
- Verify your internet connection
- Ensure the MCP server URL is correct and accessible
- Check if the MCP server is deployed and running
- Verify authentication credentials are valid
Authentication Issues
Issue: "Authentication failed" or "Unauthorized"
Solutions:
- Re-enter API key when prompted
- Verify the API key is correct
- Check that OAuth authentication is completed in Cequence AI Gateway
- Review MCP server permissions
Configuration Not Loading
Issue: Changes to mcp.json don't take effect
Solutions:
- Ensure the file is saved
- Restart VS Code
- Check for JSON syntax errors
- Verify file location is correct
Configuration File Locations
| Scope | Platform | Location |
|---|---|---|
| Workspace | All | .vscode/mcp.json in project root |
| Global | macOS | ~/Library/Application Support/Code/User/mcp.json |
| Global | Windows | %APPDATA%\Code\User\mcp.json |
| Global | Linux | ~/.config/Code/User/mcp.json |
Best Practices
- Use Workspace Config for Projects: Keep project-specific servers in
.vscode/mcp.json - Use Global Config for Personal Tools: Configure frequently used servers globally
- Descriptive Names: Use clear names that indicate the service purpose
- Secure Credentials: Use input variables for sensitive data like API keys
- Version Control: Consider adding
.vscode/mcp.jsonto.gitignoreif it contains sensitive URLs
Example Configuration
Complete example with multiple servers:
{
"inputs": [
{
"type": "promptString",
"id": "github-token",
"description": "GitHub Personal Access Token",
"password": true
}
],
"servers": {
"github-devops": {
"type": "http",
"url": "https://mcp.aigateway.cequence.ai/v1/servers/gh-abc123"
},
"jira-project": {
"type": "http",
"url": "https://mcp.aigateway.cequence.ai/v1/servers/jira-xyz789"
}
}
}