# MCP

> How to connect external services to the agent over the Model Context Protocol — by asking the agent or editing .mcp.json by hand, which kinds of servers exist and how to keep their keys.

Source: https://eggent.ai/docs/mcp/

**MCP** (Model Context Protocol) is an open standard through which external services give the agent their tools: spreadsheets, CRMs, task trackers, databases, social networks, exchanges. Connect an MCP server and the agent gains new actions, such as "create a task in the tracker" or "read rows from the sheet".

## Where it applies {#scope}

MCP servers, like skills, are connected to the orchestrator or to a specific project. A project's server is available to the agent only in that project. The settings are stored in a `.mcp.json` file in the project's (or the orchestrator's) folder.

## Connect through the agent {#via-agent}

The easiest way is to ask in chat, saying what the server is:

> "Connect the Notion MCP server. Launch: `npx -y @notionhq/notion-mcp-server`, I will paste the token myself."

> "Connect the MCP at `https://mcp.example.com/mcp` with the header `Authorization: Bearer …`."

The agent adds the server to the current project's `.mcp.json`, and its tools are available right away, in the same conversation.

> [!WARNING]
> Service tokens and keys end up in `.mcp.json`. That file is not synced to your computer, but a key pasted into a message stays in the chat history. Better to type the secret into **Settings → MCP** yourself.

## Connect by hand {#manual}

**Settings → MCP.** In the top right, pick the orchestrator or a project. The screen shows the connected servers and, below them, the `.mcp.json` file itself for editing. After editing, press **Save .mcp.json**.

The format is the same as in Cursor and Claude Desktop:

```json
{
  "mcpServers": {
    "notion": {
      "command": "npx",
      "args": ["-y", "@notionhq/notion-mcp-server"],
      "env": { "NOTION_TOKEN": "secret_…" }
    },
    "tracker": {
      "url": "https://mcp.example.com/mcp",
      "headers": { "Authorization": "Bearer …" }
    }
  }
}
```

## Two kinds of servers {#types}

| Kind | Set with | Where it runs |
| --- | --- | --- |
| **Local (stdio)** | `command`, `args`, `env` | Started inside the workspace as a program, usually with `npx` or `uvx` |
| **Remote (HTTP)** | `url`, `headers` | Runs at the service's side; the agent reaches it over the network |

If a service offers both, the remote one is usually simpler: nothing to install.

## How the agent uses MCP {#usage}

The agent sees the connected servers and their tools and calls them when the task needs it. You can point it there explicitly: "use the tracker MCP to see my tasks for today".

## If it does not work {#troubleshooting}

- Ask the agent: "check the tracker MCP server" — it will show the start-up or response error.
- For a local server, check that the command runs: the package exists and the Node or Python version fits.
- For a remote one, check the address and the authorization header.
- If the cloud workspace was [asleep](https://eggent.ai/docs/sleep.md), the first call to a local server can take a few extra seconds while it starts.
