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

# MCP Server

> Connect your own MCP server and let the AI Agent use its tools autonomously.

The **MCP Server** tool lets you extend the [AI Agent](/nodes/ai/ai_agent) with tools from any **MCP (Model Context Protocol) server** — your own internal APIs, third-party MCP servers, or services that expose an MCP endpoint.

When your workflow runs, the AI Agent connects to your server, discovers the tools it exposes, and decides on its own when and how to call them — exactly like it does with built-in Markifact AI tools.

<Note>
  MCP Server is an **AI tool only**. It cannot be used as a standalone workflow node — connect it to the AI Agent's bottom **tools** handle.
</Note>

***

## What is MCP?

[Model Context Protocol](https://modelcontextprotocol.io) is an open standard for exposing tools to AI models. A growing number of products ship official MCP servers (documentation search, project management, databases, and more), and you can build your own to give the agent access to internal systems.

Markifact supports MCP servers using **streamable HTTP** transport — the current standard for remote MCP servers.

***

## Adding an MCP Server

1. Click the **+** button on the AI Agent's bottom **tools** handle
2. Select **MCP → MCP Server**
3. Enter your server's URL and optional settings

You can attach **multiple MCP Server tools** to the same agent — one per server. Give each node a descriptive label so you can tell them apart in run logs.

***

## Inputs

| Field             | Type            | Required | Description                                                                                                                |
| ----------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------- |
| **Server URL**    | Dynamic Text    | ✅        | The streamable HTTP endpoint of your MCP server (e.g., `https://your-server.com/mcp`). Only `https://` URLs are supported. |
| **Headers**       | Key/Value Pairs | ❌        | HTTP headers sent with every request — typically used for authentication (e.g., `Authorization: Bearer your-token`).       |
| **Allowed Tools** | Text List       | ❌        | Limit which tools the agent can use from this server. Leave empty to allow all tools.                                      |

***

## Authentication

Authenticate with static headers — an API key or long-lived token your MCP server accepts:

```
Authorization: Bearer your-api-key
```

Header values are treated as secrets: they are **masked in run logs** and never shown in the workflow run history.

<Warning>
  MCP servers that require an interactive **OAuth login** are not supported yet. Use a server that accepts API keys or tokens via headers.
</Warning>

***

## How It Works

1. **At run start**: the agent connects to your MCP server and lists its available tools
2. **During the run**: the agent calls tools as needed based on your instructions and the user's message
3. **In run logs**: MCP tool calls appear in the **Tool Calls** section of the AI Agent's output, with their inputs and outputs — just like built-in tools

### Limiting Tools

If your server exposes many tools, use **Allowed Tools** to list only the ones the agent should see. Fewer, more relevant tools make the agent faster and more accurate.

***

## Example: Docs Assistant

Give your agent access to a documentation MCP server so it can answer product questions:

```
Slack: On New Message → AI Agent → Slack: Send Channel Message
                           ↓
                      AI Tools:
                      • MCP Server (your docs server)
                      • GA4 Get Report
```

**Instructions:**

```
You are a support assistant. Use the documentation tools to answer
product questions. Always cite which page your answer comes from.
```

The agent combines your MCP server's tools with built-in Markifact tools in the same conversation.

***

## Credit Cost

MCP tool usage is included in the AI Agent's cost, which is calculated from the model's actual token usage. There is no separate charge per MCP tool call. See the [Credits & Usage](/core-concepts/credits) page for details.

***

## Frequently Asked Questions

<Accordion title="Which MCP servers are supported?">
  Any MCP server reachable over **streamable HTTP** with an `https://` URL.

  Not supported:

  * **stdio servers** (local command-line servers) — these run on your machine, not over the network
  * **SSE-only servers** (the older transport, deprecated by the MCP spec)
  * Servers requiring an **interactive OAuth login**

  If a product offers a "remote MCP server" URL, it's most likely streamable HTTP and will work.
</Accordion>

<Accordion title="I get 'Failed to connect to MCP server'. What should I check?">
  1. **URL is correct** and includes the full path (many servers use `/mcp` at the end)
  2. **Server is reachable** from the internet — internal-only servers won't work
  3. **Authentication headers** are correct if your server requires them
  4. **The server speaks streamable HTTP** — SSE-only or stdio servers won't connect

  The error message includes the label of the MCP node that failed, which helps when you have several connected.
</Accordion>

<Accordion title="Can I connect multiple MCP servers to one agent?">
  Yes. Add one **MCP Server** tool per server — there's no limit. Give each node a clear label (e.g., "Docs Server", "CRM Server") so tool calls are easy to trace in run logs.

  One thing to watch: if two servers expose a tool with the **same name**, the run will fail with a naming conflict. Use **Allowed Tools** to exclude the duplicate from one of the servers.
</Accordion>

<Accordion title="Are my API keys in headers safe?">
  Header values are masked (`***`) in all run logs and workflow history. They are only used to make requests to the MCP server you configured.
</Accordion>

<Accordion title="Can I use dynamic values in the URL or headers?">
  Yes. Both fields support the `{{nodeId__data}}` syntax, so you can reference values from earlier workflow nodes — for example, a token fetched by a previous step.
</Accordion>

<Accordion title="Why don't I see my server's tools anywhere in the editor?">
  Tool discovery happens **at run time**, not in the editor. The agent lists your server's tools when the workflow runs. To verify your setup, run the workflow with a prompt like *"What tools do you have access to?"*
</Accordion>
