GitHub Copilot Integration

Connect DocRouter to GitHub Copilot

Use the Model Context Protocol (MCP) to search, read, and manage your documents from Copilot Chat or the Copilot coding agent.

Get started in 3 steps

1

Install the MCP server

Run npm install -g @docrouter/mcp to install the DocRouter MCP server.

2

Configure Copilot

Add the DocRouter MCP server in Copilot Chat (VS Code) or in your repository’s Copilot coding agent settings.

3

Use DocRouter from Copilot

Ask Copilot to list documents, create schemas, run prompts, and more. The organization ID is resolved automatically from your API token.


What is GitHub Copilot Integration?

By connecting DocRouter to GitHub Copilot via MCP, Copilot can search, read, and manage your documents and extraction schemas. Use it in Copilot Chat (in VS Code or GitHub.com) or in the Copilot coding agent (repository-level).

  • Direct data access: Use real extraction results as context when building or debugging code
  • Schema management: Update DocRouter schemas and prompts without leaving your editor
  • Same MCP server: The same @docrouter/mcp server works with Cursor, Claude Code, and Copilot

Copilot Chat (VS Code)

If you use GitHub Copilot Chat in Visual Studio Code (1.99 or later), configure the DocRouter MCP server so Copilot can call DocRouter tools.

  1. Ensure docrouter-mcp is installed: npm install -g @docrouter/mcp
  2. In VS Code, open Settings and search for MCP (or add a .mcp.json in your project or user config).
  3. Add the DocRouter MCP server. Example structure:
{
  "mcpServers": {
    "docrouter": {
      "command": "docrouter-mcp",
      "env": {
        "DOCROUTER_API_URL": "https://app.docrouter.ai/fastapi",
        "DOCROUTER_ORG_API_TOKEN": "your-org-api-token"
      }
    }
  }
}

Replace your-org-api-token with your organization API token from the DocRouter dashboard. The organization ID is resolved automatically.


Copilot coding agent (repository)

Repository admins can configure MCP servers for the Copilot coding agent so it can use DocRouter when working in your repo.

  1. In your GitHub repository, go to SettingsCode & automationCopilotCoding agent.
  2. In MCP configuration, add the DocRouter MCP server in the required JSON format (same mcpServers structure as above).
  3. For the API token, use a repository or organization secret (e.g. prefixed with COPILOT_MCP_ as required by Copilot) so the agent can authenticate to DocRouter.

See GitHub’s docs on extending the Copilot coding agent with MCP for the exact schema and secret naming.


Example usage

Once configured, you can ask Copilot to:

  • “List the last 5 documents uploaded to DocRouter.”
  • “Show me the schema for ‘Invoices’.”
  • “Create a new prompt that uses the ‘Receipt’ tag.”
  • “Run the extraction prompt on document doc_123.”

Best practices

Secure credentials — Store your API token in VS Code secrets or GitHub repository/org secrets; never commit it.

Test in Chat first — Use Copilot Chat to list documents or read a schema before asking the coding agent to perform DocRouter operations.

Same as Cursor/Claude — The DocRouter MCP server and token work the same across Cursor, Claude Code, and Copilot.


Learn more


Ready to connect GitHub Copilot?

Get API Credentials