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
Install the MCP server
Run npm install -g @docrouter/mcp to install the DocRouter MCP server.
Configure Copilot
Add the DocRouter MCP server in Copilot Chat (VS Code) or in your repository’s Copilot coding agent settings.
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/mcpserver 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.
- Ensure
docrouter-mcpis installed:npm install -g @docrouter/mcp - In VS Code, open Settings and search for MCP (or add a
.mcp.jsonin your project or user config). - 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.
- In your GitHub repository, go to Settings → Code & automation → Copilot → Coding agent.
- In MCP configuration, add the DocRouter MCP server in the required JSON format (same
mcpServersstructure as above). - 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
- MCP Server — Model Context Protocol and DocRouter tools
- Cursor Integration — Similar integration for Cursor
- Claude Code Integration — Similar integration for Claude Code
- REST API — Full API reference