docs/content/Guides/Integrations/mcp-tool-integration.mdx
import { Callout } from 'nextra/components' import { Steps } from 'nextra/components'
The Model Context Protocol (MCP) integration lets you connect external tool servers to DocsGPT. Your agents can then discover and call tools provided by those servers during conversations — for example, querying a CRM, running code, or accessing a database.
Only needed if your MCP servers use OAuth authentication:
MCP_OAUTH_REDIRECT_URI=https://yourdomain.com/api/mcp_server/callback
If not set, falls back to API_URL/api/mcp_server/callback.
Go to Settings > Tools > Add Tool > MCP Server. Enter the server URL, select an auth type, and click Test Connection to verify, then Save.
In your agent configuration, enable the MCP tools you want the agent to use.
</Steps>| Auth Type | Config Fields |
|---|---|
| None | — |
| Bearer | bearer_token |
| API Key | api_key, api_key_header (default: X-API-Key) |
| Basic | username, password |
| OAuth | oauth_scopes (optional) |
| Endpoint | Method | Description |
|---|---|---|
/api/mcp_server/test | POST | Test a connection without saving |
/api/mcp_server/save | POST | Save or update a server configuration |
/api/mcp_server/callback | GET | OAuth callback handler |
/api/mcp_server/oauth_status/<task_id> | GET | Poll OAuth flow status |
/api/mcp_server/auth_status | GET | Batch check auth status for all MCP tools |
MCP_OAUTH_REDIRECT_URI is correct and Redis is running.