Skip to content

Configure MCP Servers

Fresh

Model Context Protocol (MCP) servers extend agent mode with additional tools — GitHub, databases, search, and more.

VS Code Configuration

Edit ~/.gemini/settings.json:

json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
      }
    },
    "gitlab": {
      "command": "npx",
      "args": ["mcp-remote", "https://your-gitlab.com/api/v4/mcp"]
    },
    "cloudflare-observability": {
      "command": "npx",
      "args": ["mcp-remote", "https://observability.mcp.cloudflare.com/sse"]
    },
    "cloudflare-bindings": {
      "command": "npx",
      "args": ["mcp-remote", "https://bindings.mcp.cloudflare.com/sse"]
    }
  }
}

After editing: Command Palette > Developer: Reload Window

IntelliJ Configuration

Create mcp.json in your IDE config directory:

json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Find config directory: IDE and Project Settings > About > Config folder

Authentication

Local servers (environment variables)

json
{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["./my-mcp-server/index.js"],
      "env": { "API_KEY": "your_api_key" }
    }
  }
}

Remote servers (HTTP headers)

json
{
  "mcpServers": {
    "github-remote": {
      "httpUrl": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer YOUR_ACCESS_TOKEN"
      }
    }
  }
}

Check MCP Status

In VS Code agent mode, type:

/mcp

Shows all configured servers, connection status, and available tools.

ServerInstall commandUse case
GitHubnpx @modelcontextprotocol/server-githubIssues, PRs, repos
Filesystemnpx @modelcontextprotocol/server-filesystemExternal file access
Brave Searchnpx @modelcontextprotocol/server-brave-searchWeb search
PostgreSQLnpx @modelcontextprotocol/server-postgresDatabase queries
CloudflareRemote: observability.mcp.cloudflare.comCF monitoring

More servers: modelcontextprotocol.io/examples and GitHub MCP servers

Based on official Google Gemini Code Assist documentation.