> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Context Protocol (MCP)

> Langdock’s implementation of the Model Context Protocol (MCP) enables seamless integration with external tools and services, providing powerful extensibility for AI agents and chat interactions.

## What is MCP?

MCP is an open protocol that standardizes how applications provide context to LLMs.

Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.

> [!NOTE]
>
> MCP integrations in Langdock reuse the existing integration architecture with MCP-specific extensions, allowing the same action execution system to work for both traditional integrations and MCP servers.

## Langdock MCP Key Features

### Transport Types

* **STREAMABLE\_HTTP**: HTTP-based transport with optional streaming support
* **SSE (Server-Sent Events)**: Real-time communication transport for streaming data

### Authentication Methods

* **None:** For public MCP servers that don't require identification
* **API Key:** Simplified key-based authentication with selectable header formats, including HTTP Basic
* **OAuth 2.0 (CIMD):** OAuth 2.0 for servers that advertise Client ID Metadata Documents, without a client ID or client secret
* **OAuth 2.0 (Dynamic Client Registration):** Full OAuth 2.0 with DCR support for secure authorization flows
* **OAuth 2.0 Manual (Authorization Code + PKCE):** Full OAuth 2.0 without DCR support

### Authentication Details

* **Custom headers:** Add static values or the placeholders `{{ access_token }}`, `{{ refresh_token }}`, and `{{ api_key }}`. On dedicated deployments with user OAuth login enabled, you can also use `{{ user_oauth_access_token }}` to forward the user's Langdock login token to the MCP server.
* **OAuth discovery:** Langdock discovers supported OAuth metadata and scopes automatically when available.
* **MCP Apps:** Some MCP Apps expose connection metadata for faster setup.
* **OAuth 2.0 (CIMD):** Choose this when the server advertises Client ID Metadata Documents. You don't register a client. You don't enter a client ID or client secret.
* **OAuth 2.0 Manual (Authorization Code + PKCE):** Use this option when the server doesn't advertise CIMD and doesn't support Dynamic Client Registration.

### Tool Integration

**Automatic Discovery:** Langdock discovers tools and resources from the MCP server during setup. You can enable up to 60 tools and 50 resources per integration. Tools are converted to Langdock actions with the same previews you're familiar with.

* **Tools:** Select the tools you want Agents to call.
* **Descriptions:** Agents use the tool and parameter descriptions from the MCP server to decide when to call a tool and how to fill its inputs. If you operate the server, improve unclear descriptions there.
* **Confirmation:** Newly saved tools and resources do **not** require confirmation before execution by default. You can enable confirmation per tool after saving if you need a confirmation step.

### MCP Resources

MCP resources expose contextual data from the server. Langdock discovers resources during setup and lets you save the ones you want to make available. For file resources, see [MCP File Outputs](https://docs.langdock.com/en/using-langdock/guides/integrations/mcp/mcp-file-outputs.md).

### Langdock as an MCP Server

Langdock also provides its own MCP server endpoint, allowing external AI clients to call your Langdock agents.

> **[Langdock Agent MCP Server](https://docs.langdock.com/en/using-langdock/guides/integrations/mcp/langdock-agent-mcp-server.md)**
>
> Connect external AI clients to your Langdock agents via MCP

## Getting Started

Different authentication methods have slightly different connection flows.

1. **Enter URL**

   Enter the endpoint URL of your MCP server.

> [!NOTE]
>
> Langdock validates MCP server URLs and blocks private and internal network
> addresses by default. If you operate a dedicated deployment, set
> `URL_VALIDATION_ENABLED=false` to reach internal MCP servers. With validation
> disabled, URLs must still be valid and use HTTP or HTTPS.

![Oauth Mcp Config - Enter MCP URL](https://mintcdn.com/langdock-34/xbzAyg08zXujRLuD/images/oauth-mcp-config-1.png?fit=max\&auto=format\&n=xbzAyg08zXujRLuD\&q=85\&s=acd800d2e2814c13cf45fbecc264a50f)

2. **Select Authentication Method**

   Choose one of the five authentication types. Follow the respective guide below:

### **None & API Key**

For public or API key-protected servers, simply enter the server URL (and API key if required).

When you select API Key, choose under **API Key Header Type** which header your server expects the key in:

* **X-API-Key**, **API-Key**, and **X-Auth-Token** send the key in the header of the same name
* **Authorization: Bearer** and **Authorization: Token** send the key in the `Authorization` header with the matching prefix
* **Authorization: Basic (base64-encoded)** base64-encodes the key and sends it as `Authorization: Basic`. For servers that require HTTP Basic Authentication, enter the key as `username:password`.
* **X-API-Key & Bearer (Legacy)** sends the key in both the `X-API-Key` header and as a Bearer token. This is the default when no header type is selected.

### OAuth 2.0 (CIMD)

Choose **OAuth 2.0 (CIMD)** when the server advertises Client ID Metadata Documents. You don't register a client. The form doesn't ask for a Client ID, Client Secret, Authorization URL, or Token URL.

![Authentication method menu open with OAuth 2.0 (CIMD) selected](https://mintcdn.com/langdock-34/KsaE0K8QwtKvt6ml/images/mcp-oauth-cimd.png?fit=max\&auto=format\&n=KsaE0K8QwtKvt6ml\&q=85\&s=5d34759ed96a51ce63780c468edf8c3b)

1. Enter the server URL and select **OAuth 2.0 (CIMD)**.
2. Click **Add connection** to start sign-in.
3. If the server doesn't advertise CIMD, Langdock shows "This server does not advertise CIMD support. Choose Dynamic Client Registration or Manual OAuth." Select **OAuth 2.0 (Dynamic Client Registration)** or **OAuth 2.0 Manual (Authorization Code + PKCE)**.
4. When the connection succeeds, click **List Server Features**. Select the tools you want, then click **Save**.

### OAuth 2.0 (Dynamic Client Registration)

For servers supporting OAuth with PKCE, the connection process is straightforward:

![Oauth Mcp Config - click Add connection](https://mintcdn.com/langdock-34/xbzAyg08zXujRLuD/images/oauth-mcp-config-2.png?fit=max\&auto=format\&n=xbzAyg08zXujRLuD\&q=85\&s=f12e00f6a4fb96d22934d5cac3498b90)

1. Enter the server URL and select **OAuth 2.0 (Dynamic Client Registration)**.
2. Click **Add connection** to initiate the OAuth flow.

![Oauth Mcp Config - Go through the OAuth Flow](https://mintcdn.com/langdock-34/xbzAyg08zXujRLuD/images/oauth-mcp-config-3.png?fit=max\&auto=format\&n=xbzAyg08zXujRLuD\&q=85\&s=4edf0597c042e5149ab294fb40b93d8e)

3. Once connected, a success popup will confirm the connection.
4. Click **List Server Features** to verify access and see available tools. If the test fails, Langdock shows the error returned by the server.

![Mcp Config - Test connection and see available tools](https://mintcdn.com/langdock-34/xbzAyg08zXujRLuD/images/oauth-mcp-config-4.png?fit=max\&auto=format\&n=xbzAyg08zXujRLuD\&q=85\&s=61411bdb0bfb0fa72239578f39edc0df)

5. Select the tools you want to use, then click **Save**. Use `CMD` + `S` on Mac or `Ctrl` + `S` on Windows to save. Use `CMD` + `Enter` on Mac or `Ctrl` + `Enter` on Windows to test.

### OAuth 2.0 Manual (Authorization Code + PKCE)

For servers that don't advertise CIMD and don't support Dynamic Client Registration, you enter the client details yourself:

![Oauth Mcp Config - Advanced OAuth setup](https://mintcdn.com/langdock-34/xbzAyg08zXujRLuD/images/oauth-mcp-config-5.png?fit=max\&auto=format\&n=xbzAyg08zXujRLuD\&q=85\&s=c64a7618d9d121b5ab67e69a53ec426f)

1. Enter the server URL and select **OAuth 2.0 Manual (Authorization Code + PKCE)**.
2. Copy the OAuth redirect URL into your app’s API or developer settings.

![Oauth Mcp Config - Add Client ID and Client Secret to Langdock](https://mintcdn.com/langdock-34/xbzAyg08zXujRLuD/images/oauth-mcp-config-6.png?fit=max\&auto=format\&n=xbzAyg08zXujRLuD\&q=85\&s=2f43dd82e01e48945c5d3e0048fa412b)

3. Copy Client ID and Client Secret from your app into Langdock
4. Add Authorization URL (for permissions) and Token URL (for token exchange)
5. Define required OAuth scopes (space or comma-separated per your server's documentation)
6. Leave **Send resource parameter** enabled to send the MCP server URL as the OAuth resource parameter. Disable it for servers that include the resource in the scope, such as Entra ID.

![Mcp Config - Test connection and see available tools](https://mintcdn.com/langdock-34/xbzAyg08zXujRLuD/images/oauth-mcp-config-8.png?fit=max\&auto=format\&n=xbzAyg08zXujRLuD\&q=85\&s=67cb5a9592b4339b92656eb17a652226)

7. Test the connection and click **Save**.

***

### Zapier MCP Configuration

For Zapier MCP servers, the URL has this format:

`https://mcp.zapier.com/api/mcp/s/[your-api-key]/mcp`

split your URL as follows:

* **Server URL:** [https://mcp.zapier.com/api/mcp/mcp](https://mcp.zapier.com/api/mcp/mcp)
* **API Key:** The encoded string after /s/ in your original URL

***

## Related Documentation

* [Integrations Overview](https://docs.langdock.com/en/using-langdock/integrations/introduction.md) - Learn about Langdock's integration system
* [File Input in MCP Tools](https://docs.langdock.com/en/using-langdock/guides/integrations/mcp/mcp-file-input.md) - Learn how to pass files to MCP tools
* [Agent Actions](https://docs.langdock.com/en/using-langdock/guides/integrations/using-integrations.md) - Understanding how actions work with agents

> **[MCP Server Directory](https://docs.langdock.com/en/using-langdock/integrations/mcp-directory.md)**
>
> 30+ official MCP servers ready to connect

> **[MCP Apps](https://docs.langdock.com/en/using-langdock/integrations/mcp-ui.md)**
>
> Build MCP servers with interactive UIs inside Langdock

## Additional Resources

* [Langdock Cookbook](https://docs.langdock.com/en/developer/overview/cookbook.md) - Runnable MCP recipes, including OAuth and DCR authentication and file handling
* [General introduction to MCP](https://modelcontextprotocol.io/docs/getting-started/intro)
* [Deep Dive into Protocol Specification ](https://modelcontextprotocol.io/specification/2025-06-18)

## FAQ

> **When should I use MCP?**
>
> Use MCP when you want Langdock to connect to external tools or services through the Model Context Protocol. MCP is most useful for extending agents and chats with standardized tool access.

> **What should I check if MCP does not work as expected?**
>
> Check server configuration, authentication, tool definitions, permissions, and whether the MCP server is reachable. If a tool appears but fails at runtime, inspect the tool input schema and the error returned by the server.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.