Skip to content

Add an MCP server to your agent

There are two ways to give an agent MCP tools: install an integration (the curated, credential-aware path), or register your own MCP server directly with the CLI. Both end up in the agent’s unified toolset; they differ in how they’re managed and where credentials come from.

Many Alfe integrations are MCP servers under the hood. When you install one, Alfe registers its MCP server for the agent and wires in the credentials from your connected account — you don’t touch any server config yourself.

This is the recommended path whenever the tool you want is in the catalog, because it’s:

  • Cloud-tracked — the integration is part of the agent’s desired state, so it follows the agent across reprovisioning and rides the org / team / project / agent scope hierarchy.
  • Credential-aware — OAuth and other credentials from your connected account are injected into the server automatically, and refreshed for you.
  • Lifecycle-managed — install, connect, and remove are the same across every integration.

You can install an integration from the dashboard, from the CLI, or from the agent itself:

Terminal window
alfe integration search <query>
alfe integration install <name>
alfe integration configure <name>

See How integrations work for the full lifecycle and MCP and integrations for how the two connect.

For anything not in the catalog — an internal tool server, a third-party MCP server, or one you wrote yourself — attach it directly with the alfe mcp commands. Servers you register this way are managed on the agent’s own machine and are scoped to that agent.

Give the command Alfe should launch, plus any arguments and environment variables:

Terminal window
alfe mcp add my-tools \
--transport stdio \
--command my-mcp-server \
--args --port 0 \
--env API_TOKEN=...

Point the agent at a URL over Streamable HTTP (or SSE for older servers), with any headers the server needs:

Terminal window
alfe mcp add my-remote \
--transport streamable-http \
--url https://example.com/mcp \
--header "Authorization=Bearer ..."

Once registered, the agent’s MCP host picks the server up and its tools join the agent’s toolset — no restart needed.

Terminal window
alfe mcp list # show every registered server and who owns it
alfe mcp test <id> # connect briefly and list the tools it advertises
alfe mcp remove <id> # drop a server

alfe mcp list shows an owner for each server:

  • manual — servers you added yourself with alfe mcp add.
  • cli / integration — servers registered by the CLI or by an installed integration. To keep you from breaking a managed setup by accident, alfe mcp remove refuses to drop these unless you pass --force. To remove an integration’s server, remove the integration instead (alfe integration remove <name>).
Integration Your own server (alfe mcp add)
Best for Tools that exist in the catalog Anything custom, internal, or one-off
Credentials Wired from your connected account automatically You supply them (env or headers)
Where it’s managed Cloud desired state, dashboard/CLI/agent Locally on the agent’s machine, via the CLI
Scope hierarchy Org / team / project / agent The agent whose machine you ran it on

When a tool is available as an integration, prefer it — you get managed credentials and cloud tracking for free. Reach for alfe mcp add when you need a server the catalog doesn’t cover.