How to connect AI agents to MCP servers and APIs with Executor
By Flavio
Updated
Tagged: AI
Learn how Executor lets AI agents safely use multiple accounts for the same MCP, OpenAPI, or GraphQL integration through one catalog.
I first saw Executor as a way to connect AI agents to lots of tools. What I need more often is a way to handle several accounts for the same service.
I might have a personal Notion workspace and another one for a course. The tools are identical, but the data and credentials are different.
Executor lets me add the service once, then create a named connection for each account.

In this tutorial we’ll install Executor, connect an agent, and try the complete flow with a public API. Then we’ll look at how to set it up for several real accounts.
What Executor does
MCP lets an AI application use external tools.
Without Executor, you add each MCP server to every agent. Three accounts across Codex, Cursor, and Claude Code can mean repeating the same setup many times.
Executor sits in the middle:
Codex ───────┐
Cursor ──────┼──> Executor ──> your tools and accounts
Claude Code ─┘
Each agent connects to Executor, and Executor takes care of the services behind it.
It works with MCP servers, OpenAPI APIs, and GraphQL APIs, putting all their tools into one catalog.
An agent can search the catalog, read the schema it needs, and call the tool:
search → describe → call
That way, the agent doesn’t need every tool schema loaded from the start.
The difference between an integration and a connection
Executor uses two words that sound similar at first.
An integration describes a service and its tools. A connection gives that integration access to one account.
One Notion integration can have several connections:
Notion
├── personal
├── flaviocopes
└── ai-workshop
Every connection has its own credentials and data, and its name becomes part of the tool path too. The agent can pick personal or ai-workshop without guessing.
With Notion, each connection authorizes a workspace rather than an email address. The Notion authorization guide explains how that works.
You can do the same with separate Stripe accounts:
Stripe
├── courses
├── software-products
└── consulting
That multi-account setup is the main reason Executor caught my eye.
Run it locally first
Executor has a desktop app, a CLI, a cloud service, and a self-hosted option.

Start locally. You can always move to a remote setup later if remote agents need the same catalog.
Mark Phelps shared one remote setup. He runs the Executor MCP server and his Hermes bot on an exe.dev VM. The VM stays online, so his agents can reach Executor without depending on his laptop. The built-in agent can also inspect the machine, answer questions like “how secure is this VM from the public?”, and fix what it finds.
We’ll use the CLI here.
Install Executor
The Executor CLI needs Node.js 20 or newer.
Check your installed version:
node --version
Then install Executor:
npm install -g executor
Install its background service:
executor install
Executor prints the local address and its data directory.

You can open the web interface with:
executor web
The usual port is 4788. Executor picks another one if that port is busy.
Mine picked port 4789:
http://localhost:4789
The commands below use that address. Replace it with the one printed on your machine.
I tested these commands with Executor 1.6.2 on macOS.
Connect an agent
Open the Integrations page in Executor.
At the top, you’ll find a command for connecting an MCP client:

Choose Remote HTTP and copy the whole command.
It includes the local MCP URL, the Executor server name, --transport http, and an authorization header. Keep the authorization header in place.
You can use Standard I/O instead, where the client starts executor mcp itself.
I prefer Remote HTTP so Cursor and Codex can share one running Executor service.
Restart the MCP client after adding it. A chat that was already open may not see the new server.
Try it with HTTPBin
Before connecting an important account, it’s safer to test the flow with something harmless.
Let’s use HTTPBin instead. Its /get endpoint returns details about the request, and it needs no credentials.
Executor needs an OpenAPI 3 document. We’ll use this one from APIs.guru:
https://api.apis.guru/v2/specs/httpbin.org/0.9.2/openapi.json
Add HTTPBin
Run this command:
executor call executor openapi addSpec '{
"spec": {
"kind": "url",
"url": "https://api.apis.guru/v2/specs/httpbin.org/0.9.2/openapi.json"
},
"slug": "httpbin",
"name": "HTTPBin",
"authenticationTemplate": []
}' --base-url http://localhost:4789
Adding an integration changes the catalog, so Executor asks for approval.
You can approve it in the browser. Executor also prints a command like this:
executor resume \
--execution-id EXECUTION_ID \
--base-url http://localhost:4789 \
--action accept \
--content '{}'
Replace EXECUTION_ID with the value Executor printed.
Create the public connection
We added the HTTPBin tools, but we still need a connection before calling them.
Create one named public:
executor call executor coreTools connections create '{
"owner": "user",
"name": "public",
"integration": "httpbin",
"template": "none"
}' --base-url http://localhost:4789
HTTPBin has no credentials, so its template is none.
Approve this change too. Then check the integration:
executor tools integrations \
--query httpbin \
--base-url http://localhost:4789
You should see a toolCount of 78.
The current CLI calls these items integrations. You might still find older examples that call them sources.
Find the GET tool
Search the catalog using a description of what you need:
executor tools search "show request query parameters" \
--namespace httpbin \
--limit 10 \
--base-url http://localhost:4789
The result should include:
httpbin.user.public.httpMethods.getGet
The path follows this shape:
integration.owner.connection.tool
Our connection name, public, appears right in the middle.
If you get no results, check executor tools integrations again. HTTPBin needs a connection, and its toolCount must be greater than zero.
Read the schema and call the tool
First ask Executor to describe the tool:
executor tools describe \
httpbin.user.public.httpMethods.getGet \
--base-url http://localhost:4789
This tool has no required input.
The call command takes each part of the path as a separate argument:
executor call tools httpbin user public httpMethods getGet \
--base-url http://localhost:4789
A successful call returns ok: true and an HTTP status of 200.
We’ve now gone through the whole process:
integration → connection → search → describe → call
Ask the agent to do the same
Open a new chat in the agent you connected.
Give it a narrow job:
Use Executor to find the HTTPBin tool that performs a GET request.
Describe its schema first, then call it.
Do not call POST, PUT, PATCH, or DELETE operations.
The agent should search the catalog, load the schema, and call the GET tool.
If it succeeds, the MCP connection works.
Add your real accounts
Now you can replace HTTPBin with a service you use.
For Notion, add the integration once and create a separate connection for each workspace:
Notion
├── personal
├── flaviocopes
└── ai-workshop
Name connections after the data they hold. An email address tells the agent much less than personal or ai-workshop.
You can list your connections from the terminal:
executor call executor coreTools connections list '{"owner":"user"}' \
--base-url http://localhost:4789
This read-only command returns their names, integrations, identity labels, and health information without exposing any credential values.
With those names in place, you can give the agent a clear request:
Use only the ai-workshop Notion connection.
Find the participant onboarding page and summarize it.
The connection name tells the agent which account to target. Your credentials and Executor policies are what control its permissions.
Start with strict policies
Executor lets you set each tool to allow, require approval, or block.
Start strict. Allow read operations, require approval before creating or changing data (and before sending email or publishing content), and block destructive actions like deletion, billing changes, and permission changes.
Treat that as a baseline and inspect the real tool list before connecting an account you care about.
Executor keeps credentials out of the code the agent writes, so the model never needs to read the raw token. Even so, that token still carries whatever permissions you gave it. Use narrow credentials and don’t grant more access than the agent needs.
How I would use Executor
My plan is to start small: Notion with two or three connections, and Cursor and Codex sharing the same local Executor service.
Begin with a read-only search in each workspace:
Use only the flaviocopes Notion connection.
Find notes about upcoming blog posts.
Do not create or edit anything.
Once those searches work reliably, turn on page creation with approval.
Resist adding GitHub, Cloudflare, and ten other services on day one. Two accounts on a single service are enough to see if Executor improves your workflow.
Executor v2 is in beta
The walkthrough above uses stable Executor 1.6.2. Meanwhile, the team is building Executor 2.0 in public beta (2.0.0-beta.x, tracked on the GitHub releases page).
I haven’t moved my local setup to the beta yet, though a few changes in the v2 docs are worth knowing if you try npm i -g executor@beta or the standalone installer from executor.sh:
- launcher binaries and local state move under
~/.executor/v2/(with the local MCP server defaulting to port4312instead of4788) - integrations move toward TypeScript apps with cached sessions and background tool-list cache renewal (configured with
EXECUTOR_TOOL_LISTING_RENEW_SECONDSon self-hosted instances) - self-hosting (
ghcr.io/usefulsoftwareco/executor-selfhost) updates OAuth configuration withBETTER_AUTH_URL, provider client env vars, and a/oauth/client-metadata.jsondiscovery endpoint
If you just want to try the multi-account MCP workflow today, stick with stable 1.6.2 until v2 graduates from beta.
When I would skip Executor
Executor adds another moving part, so it’s not always worth the extra layer.
If you’re using one agent, one account, and a small MCP server, connect that server directly instead. That’s what I do in Cursor with the MCP servers I actually use.
Executor starts paying off when several agents need the same tools, when you juggle multiple accounts for the same service, or when you have enough schemas to crowd the agent’s context window.
Keep in mind that the local service becomes a dependency too: if it stops, every tool behind it stops working.
Executor also moves fast, so check the current documentation if a command or label looks slightly different.
In short, the setup looks like this:
one integration → several named accounts → one endpoint for every agent
Start with HTTPBin, then add one real service with two connections. You’ll know quickly whether it solves a problem you have.
Want me to talk about your product? You can sponsor this site.
Related posts about ai: