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.
Option 1 — Install an integration
Section titled “Option 1 — Install an integration”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:
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.
Option 2 — Register your own MCP server
Section titled “Option 2 — Register your own MCP server”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.
A local (stdio) server
Section titled “A local (stdio) server”Give the command Alfe should launch, plus any arguments and environment variables:
alfe mcp add my-tools \ --transport stdio \ --command my-mcp-server \ --args --port 0 \ --env API_TOKEN=...A remote (HTTP) server
Section titled “A remote (HTTP) server”Point the agent at a URL over Streamable HTTP (or SSE for older servers), with any headers the server needs:
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.
Manage registered servers
Section titled “Manage registered servers”alfe mcp list # show every registered server and who owns italfe mcp test <id> # connect briefly and list the tools it advertisesalfe mcp remove <id> # drop a serveralfe 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 removerefuses to drop these unless you pass--force. To remove an integration’s server, remove the integration instead (alfe integration remove <name>).
Which option to choose
Section titled “Which option to choose”| 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.
Next steps
Section titled “Next steps”- Use MCP servers with your agent — how tools surface.
- MCP and integrations — the connection between the integrations catalog and MCP.
alfe mcpreference — every flag.