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

# Use MCP Tools

Connect external tools from [MCP servers](https://modelcontextprotocol.io/docs/getting-started/intro) to your Dify apps. Instead of just built-in tools, you can use tools from the growing [MCP ecosystem](https://mcpservers.org/).

<Note>
  This covers using MCP tools in Dify. To publish Dify apps as MCP servers, see [here](/en/3.8.x/use/publish/publish-mcp).
</Note>

<Info>
  Only supports MCP servers with [HTTP transport](https://modelcontextprotocol.io/docs/learn/architecture#transport-layer) right now.
</Info>

## Add MCP servers

Go to **Tools** → **MCP** in your workspace.

<Frame>
  <img src="https://mintcdn.com/dify-enterprise-docs/zvhvyUvEpyoIONBf/images/use-dify/workspace/mcp-server-list.png?fit=max&auto=format&n=zvhvyUvEpyoIONBf&q=85&s=83c69e2db43013cf5cd343b5c2255106" alt="MCP Server List" width="3048" height="1988" data-path="images/use-dify/workspace/mcp-server-list.png" />
</Frame>

Click **Add MCP Server (HTTP)**:

<Frame>
  <img src="https://mintcdn.com/dify-enterprise-docs/zvhvyUvEpyoIONBf/images/use-dify/workspace/mcp-add-server-dialog.png?fit=max&auto=format&n=zvhvyUvEpyoIONBf&q=85&s=cc3a95e72805d12d5882c5a754c78fd2" alt="MCP Add Server Dialog" width="1120" height="912" data-path="images/use-dify/workspace/mcp-add-server-dialog.png" />
</Frame>

**Server URL**: Where the MCP server lives (like `https://api.notion.com/mcp`)

**Name & Icon**: Call it something useful. Dify tries to grab icons automatically.

**Server ID**: Unique identifier (lowercase, numbers, underscores, hyphens, max 24 chars)

<Note>
  * Apps reference a server by its identifier. If you change it later, the server's tools stop working in apps that used the old one; re-add the tools in each affected app to restore them.
  * Exported apps reference servers by identifier too, so to run one in another workspace, recreate the same servers there with matching identifiers.
</Note>

## What happens next

Dify automatically:

1. Connects to the server
2. Handles any OAuth stuff
3. Gets the list of available tools
4. Makes them available in your app builder

You'll see a server card once it finds tools:

<Frame>
  <img src="https://mintcdn.com/dify-enterprise-docs/zvhvyUvEpyoIONBf/images/use-dify/workspace/mcp-server-card.png?fit=max&auto=format&n=zvhvyUvEpyoIONBf&q=85&s=2c2b9546c927470bf0aca37fe2623407" alt="MCP Server Card" width="1564" height="550" data-path="images/use-dify/workspace/mcp-server-card.png" />
</Frame>

## Authentication

**Dynamic Client Registration** (on by default) lets Dify obtain OAuth credentials from the server automatically, so you don't register an application yourself. Leave it on whenever the server supports it.

Turn it off when the server doesn't support automatic registration, or when you must use your team's existing OAuth application. Enter its **Client ID** and **Client Secret**, then register the redirect URL Dify shows.

## Timeouts

Control how long Dify waits on the server. Raise the request timeout when the server is slow to respond, and the SSE read timeout for long-running, streamed results. Change them only if you hit timeout errors.

## Manage servers

Click any server card to:

**Update Tools**: Refresh when the external service adds new tools

<Frame>
  <img src="https://mintcdn.com/dify-enterprise-docs/zvhvyUvEpyoIONBf/images/use-dify/workspace/mcp-server-tools-list.png?fit=max&auto=format&n=zvhvyUvEpyoIONBf&q=85&s=95f9c56888866ec511db2084ffc8fdf1" alt="MCP Server Tools List" width="916" height="942" data-path="images/use-dify/workspace/mcp-server-tools-list.png" />
</Frame>

**Re-authorize**: Fix auth when tokens expire

**Edit Settings**: Change server details (but not the ID!)

**Remove**: Disconnect the server (this breaks apps using its tools)

## Use MCP tools

Once connected, MCP tools show up everywhere you'd expect:

**In agents**: Tools appear grouped by server ("Notion MCP » Create Page")

**In workflows**: MCP tools become available as nodes

**In agent nodes**: Same as regular agents

## Customize tools

When you add an MCP tool, you can customize it:

<Frame>
  <img src="https://mintcdn.com/dify-enterprise-docs/zvhvyUvEpyoIONBf/images/use-dify/workspace/mcp-tool-settings.png?fit=max&auto=format&n=zvhvyUvEpyoIONBf&q=85&s=1cbedf8abf1c67db91d008f8dc413147" alt="MCP Tool Settings" width="798" height="1020" data-path="images/use-dify/workspace/mcp-tool-settings.png" />
</Frame>

**Description**: Override the default description to be more specific

**Parameters**: For each tool parameter, choose:

* **Auto**: Let the AI decide the value
* **Fixed**: Set a specific value that never changes

**Example**: For a search tool, set `numResults` to 5 (fixed) but keep `query` on auto.

## Share apps

When you export apps that use MCP tools:

* The export includes server IDs
* To use the app elsewhere, add the same servers with identical IDs
* Document which MCP servers your app needs

## Troubleshooting

**"Unconfigured Server"**: Check the URL and re-authorize

**Missing tools**: Hit "Update Tools"

**Broken apps**: You probably changed a server ID. Add it back with the original ID.

## Tips

* Use permanent, descriptive server IDs like `github-prod` or `crm-system`
* Keep the same MCP setup across dev/staging/production
* Set fixed values for config stuff, auto for dynamic inputs
* Test MCP integrations before deploying
