Skip to main content

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 article shows you how to connect your Cequence AI Gateway MCP server to VS Code.

Copilot Required

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)

The fastest way to configure your MCP server:

npx @cequenceai/mcp-cli@latest vscode --url "your-mcp-server-url" --name "your-server-name"

Options​

FlagDescriptionRequired
-u, --urlCequence MCP server URLYes
-n, --nameServer name (default: "cequence-mcp")No
-g, --globalConfigure globally instead of workspaceNo
-k, --api-keyAPI key for authenticationNo

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 (for example, "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:

  1. Open VS Code
  2. Open the Copilot chat panel (Ctrl+Shift+I or Cmd+Shift+I)
  3. Check for available MCP tools in the chat interface
  4. Try a command related to your configured service

Check MCP Status​

  1. Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
  2. Search for "MCP" related commands
  3. 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​

ScopePlatformLocation
WorkspaceAll.vscode/mcp.json in project root
GlobalmacOS~/Library/Application Support/Code/User/mcp.json
GlobalWindows%APPDATA%\Code\User\mcp.json
GlobalLinux~/.config/Code/User/mcp.json

Tips​

  1. Use Workspace Config for Projects: Keep project-specific servers in .vscode/mcp.json
  2. Use Global Config for Personal Tools: Configure frequently used servers globally
  3. Descriptive Names: Use clear names that indicate the service purpose
  4. Secure Credentials: Use input variables for sensitive data like API keys
  5. Version Control: Consider adding .vscode/mcp.json to .gitignore if 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"
}
}
}

Additional Resources​