Add an MCP server
An MCP server gives your agent tools it can call. Connect one over HTTP and keep its key in an Agenta project secret. To learn how MCP compares with built-in integrations, see Tools and integrations.
Before you start
Have these ready:
- The server's HTTP URL, such as
https://example.com/mcp. Agenta supports HTTP connections, but not local processes over stdio. - The authentication header and key, if the server requires them. Check the server's documentation for the header name, such as
x-api-key. - An agent on the Claude Code harness. MCP servers are available on Claude Code. If the agent runs on Pi, the MCP servers section does not appear in its configuration. See Choose a harness and model.
Store the key as a project secret first
Skip this if the server needs no authentication.
The MCP form does not store the key directly. It references a project secret that Agenta resolves when the agent runs.
- Go to
Settingsin the sidebar, thenSecrets. - Click
+ Createand save the key.
Add the server
- In the playground, set Playground mode to
Build. - In the Configuration column, find MCP servers, between Tools and Skills. Its summary reads
Nonewhen the agent has no MCP servers yet. - Click the
+button on that row, labelledAdd MCP server. - Fill in the fields below, then click
Create. - Click
Commitin the Configuration header to make the server part of a version.
| Field | What to enter |
|---|---|
Server name | Letters, numbers, dots, hyphens, or underscores, up to 128 characters, such as exa. The server's tools are labelled with this name. |
MCP URL | The server's HTTP endpoint, such as https://example.com/mcp. |
Authentication | None when the server is open. Secret header when it needs a key in a request header. OAuth is listed but not available yet. |
Header name | Shown for Secret header. The header the server requires, such as x-api-key. |
Project secret | Shown for Secret header. Pick the secret you created. The list reads No project secrets found when the project has none, so go back and create one in Settings > Secrets. |
The server's actions become tools
The server's actions appear as tools labelled with the server name. When the agent calls one, it appears in the conversation and on any approval card.
The agent's Policy in the Advanced dialog governs MCP tools. They do not support per-tool Permission or Auto-approve. Under the default Allow reads policy, every MCP call asks for approval. To run MCP tools without approval, including on a schedule, set Policy to Allow all. See Control what an agent can do.
Next
- Control what an agent can do covers the policy that decides when an MCP call waits for you.
- Choose a harness and model covers switching an agent to Claude Code.