Skip to content

🧠 GitHub Copilot + ContextForge¢

Super-charge Copilot (or any VS Code chat agent that speaks MCP) with tools, prompts and resources from your own ContextForge.

With Copilot β†’ MCP you can:

  • πŸ”§ call custom / enterprise tools from chat
  • πŸ“‚ pull live resources (configs, docs, snippets)
  • 🧩 render prompts or templates directly inside the IDE

Copilot supports both SSE streams and Streamable HTTP out-of-the-box.

Gateway URL

  • Direct installs (uvx, pip, or docker run): http://localhost:4444
  • Docker Compose (nginx proxy): http://localhost:8080

πŸ›  PrerequisitesΒΆ

  • VS Code β‰₯ 1.99
  • "chat.mcp.enabled": true in your settings.json
  • ContextForge running (make serve, Docker, or container image)
  • A JWT or Basic credentials (admin / changeme in dev)

πŸ”— Option 1 - Direct SSE (best for prod / remote)ΒΆ

1 - Create .vscode/mcp.jsonΒΆ

{
  "servers": {
    "mcp-gateway": {
      "type": "sse",
      "url": "https://mcpgateway.example.com/servers/UUID_OF_SERVER_1/sse",
      "headers": {
        "Authorization": "Bearer <YOUR_JWT_TOKEN>"
      }
    }
  }
}

Tip - generate a token

python3 -m mcpgateway.utils.create_jwt_token -u admin@example.com --exp 10080 --secret my-test-key-but-now-longer-than-32-bytes

πŸ”— Option 2 - Streamable HTTP (best for prod / remote)ΒΆ

2 - Create .vscode/mcp.jsonΒΆ

{
  "servers": {
    "mcp-gateway": {
      "type": "http",
      "url": "https://mcpgateway.example.com/servers/UUID_OF_SERVER_1/mcp/",
      "headers": {
        "Authorization": "Bearer <YOUR_JWT_TOKEN>"
      }
    }
  }
}

πŸ§ͺ Verify inside CopilotΒΆ

  1. Open Copilot Chat β†’ switch to Agent mode.
  2. Click Tools - your Gateway tools should list.
  3. Try:
#echo { "message": "Hello from VS Code" }

Copilot routes the call β†’ Gateway β†’ tool, and prints the reply.


πŸ“ Good to knowΒΆ

  • Use SSE for production, stdio for local/offline.
  • You can manage servers, tools and prompts from the Gateway Admin UI (/admin).
  • Need a bearer quickly? export MCP_AUTH=$(python3 -m mcpgateway.utils.create_jwt_token -u admin@example.com --secret my-test-key-but-now-longer-than-32-bytes)

πŸ“š Further ReadingΒΆ