# MCP server

> Let outside agents such as Claude Code or Cursor look up your agents and give them work over MCP. Only the agents you turn on can be run.

The **MCP server** is the address where an outside agent such as Claude Code or Cursor looks up your endue agents and gives them work over MCP. It is the fourth way in, beside a [conversation](/docs/work/conversations/), a [channel](/docs/automate/channels/), and the [Agent API](/docs/build/agent-api/). This one is for other agents.

```
https://platform.endue.ai/mcp
```

## When to use it

When a coding agent you already use needs help from one of your endue agents in the middle of its work: Claude Code is fixing code and asks your support agent to summarize last week's refund tickets.

If the caller is code you wrote, use the [Agent API](/docs/build/agent-api/). It streams the answer.

## Connect

<Steps>

1. **Open Settings → Account → MCP connection** and select **Create connection**. The **MCP** section in [Agent Builder](/docs/build/agent-builder/) has the same button.

2. **Create a key.** Set its name and expiration. Its permissions are fixed to **Read** and **MCP run**.

3. **Paste the configuration.** Pick your client and the window shows a configuration with the key filled in. Copy it to the place the window names. The key cannot be shown again after the window closes.

4. **Check the connection.** When the outside agent sends its first request, the window changes to **Connected**.

5. **Turn on MCP for the agent you want to run.** In the **MCP** section of Agent Builder, turn on **Run this agent over MCP**. An agent with the switch off can be read but not run.

</Steps>

These are the configurations the window shows. Your key goes where `sk_...` is.

<Tabs syncKey="mcp-client">
  <TabItem label="Claude Code">
    Run this in your terminal.

    ```bash
    claude mcp add --transport http endue https://platform.endue.ai/mcp --header "Authorization: Bearer sk_..."
    ```
  </TabItem>
  <TabItem label="Cursor">
    Put this in `~/.cursor/mcp.json`.

    ```json
    {
      "mcpServers": {
        "endue": {
          "url": "https://platform.endue.ai/mcp",
          "headers": { "Authorization": "Bearer sk_..." }
        }
      }
    }
    ```
  </TabItem>
  <TabItem label="VS Code">
    Put this in `.vscode/mcp.json`.

    ```json
    {
      "servers": {
        "endue": {
          "type": "http",
          "url": "https://platform.endue.ai/mcp",
          "headers": { "Authorization": "Bearer sk_..." }
        }
      }
    }
    ```
  </TabItem>
  <TabItem label="Other clients">
    Enter the server address and the header yourself. The transport is HTTP.

    ```
    https://platform.endue.ai/mcp
    Authorization: Bearer sk_...
    ```
  </TabItem>
</Tabs>

To keep the key out of the configuration file, select **Show with environment variable** in the window. The configuration changes to one that reads the key from `ENDUE_API_KEY`.

<Aside type="note" title="Connecting with a key you already have">
  A key created in **Settings → Account → API Keys** with the **MCP connection** purpose works the same
  way. A key issued before permissions could be chosen is shown as **All permissions** and works over
  MCP too.
</Aside>

## Tools the outside agent gets

| Tool | What it does | What it needs |
| --- | --- | --- |
| `list_agents` | Returns the name and description of your agents, and whether each can be run over MCP. | The **Read** permission |
| `get_agent` | Returns a summary of one agent's setup: model, skills, connectors, channels. | The **Read** permission |
| `invoke_agent` | Gives the agent work and returns its answer. | The **MCP run** permission, and the agent's MCP switch |
| `get_session` | Returns the status and answer of work given earlier. | The **MCP run** permission |

`get_agent` returns names and summaries. The contents of the system prompt and memory, and the accounts linked to connectors, are not sent.

The answer from `invoke_agent` carries a session id. Send that id on the next call and the agent continues in the same conversation. When a run does not finish within about 50 seconds, the `running` status and the session id are returned first, and the outside agent collects the answer with `get_session`. The run finishes even if the outside agent disconnects first.

## What you set for each agent

The **MCP** section in Agent Builder has two switches. Both start off.

- **Run this agent over MCP.** `invoke_agent` works only when this is on. Details such as the name and description can be read either way.
- **Also allow connectors and outputs.** When off, work that comes in over MCP does not use [connectors](/docs/connect/overview/) or [outputs](/docs/capabilities/outputs/). When on, sending and deleting still ask for your [approval](/docs/work/approvals/) every time, and **Always allow** does not apply here.

**Recent calls** in the same section lists the MCP calls that reached this agent. Refused calls are listed with the reason, such as **No permission** or **Turned off**.

## See what came in

- **Notification.** You get one notification when an outside agent starts a new conversation, and none while that conversation continues.
- **Conversation.** It is listed under **MCP** for that agent in the sidebar. Open it to see which key and which client made the call.
- **Approval.** The run pauses at an action that needs approval and the request comes to you. After you approve, the run continues and the outside agent collects the answer with `get_session`.

An MCP conversation is read-only. It continues only through MCP calls.

## Limits

- A client that cannot send a token in a header (one that connects through OAuth only) cannot connect.
- Work that comes in over MCP does not use [devices](/docs/build/devices/). No switch opens them.
- The outside agent cannot choose the model or the number of steps. The run uses what the agent is set to.
- The agent's [question](/docs/work/questions/) cards are not sent out. When the agent needs to ask, it asks in the text of its answer.
- The outside caller cannot write to the agent's [memory](/docs/capabilities/memory/).
- A session started over MCP is continued and read over MCP only. It does not mix with Agent API sessions.
- `list_agents` returns up to 50 agents.
- A key's permissions cannot be changed after it is issued. Create another key when you need different ones.
- Runs and charges go to the account that created the key.

## Related

<CardGrid>
  <LinkCard
    title="Agent API"
    href="/docs/build/agent-api/"
    description="When the caller is code rather than an agent."
  />
  <LinkCard
    title="Approvals"
    href="/docs/work/approvals/"
    description="Why sending and deleting wait for you."
  />
  <LinkCard
    title="Direct connections"
    href="/docs/connect/direct-connections/"
    description="The other direction: your agent uses an outside MCP server."
  />
  <LinkCard
    title="Security and permissions"
    href="/docs/account/security/"
    description="What a key can reach, and how to withdraw it."
  />
</CardGrid>
