One endpoint#
Every agent and MCP client connects to the same URL, https://mcp.bastn.ai/mcp. There are no per-server URLs. The credential decides what the caller sees: a key or OAuth sign-in for a team gets that team's servers, merged into one tool list.
Tool names are qualified as <server>__<tool>. A server named github with a tool create_issue appears as github__create_issue. The name before the first __ picks the server, so server names cannot contain __.
Server names are unique within an organization. A tool your credential cannot see is answered exactly like one that does not exist, so /mcp never reveals another team's or another organization's servers.
The path of a call#
1. Identity#
The agent presents a bastn virtual key (bastn-sk-...) or an OAuth access token from signing in with a dashboard account. bastn resolves it to a user, a team and, when the key or grant is bound to one, an agent. A call without a valid credential is refused with HTTP 401.
The agent's status is checked first. A paused, killed or retired agent is refused before anything else happens.
bastn never forwards the agent's credential upstream. Upstream tokens are stored by bastn or held on your connector, and the agent never sees them.
2. Policy#
The call goes to the server that owns the tool, and that server's policy decides:
- whether the tool is allowed by the server's allow and deny lists, the caller's role and any policy bundle;
- whether the tool is in the agent's category, if it has one;
- whether the arguments pass the server's argument rules;
- whether the call fits the rate limits;
- whether the tool is pinned, on a server that hides new tools, and whether its definition still matches the pin.
A denied call returns an error to the agent, is recorded, and never reaches the upstream. The tool list an agent receives is filtered by the same policy, so it only sees tools it may call. Policies covers each layer.
3. Approvals#
If an allowed call also matches an approval policy, bastn holds it instead of sending it upstream. A team admin approves or rejects it in the dashboard under Approvals. If the decision comes within a short wait, the call simply runs. Otherwise the agent gets an error saying the call is held, with an approval id, and retries the same call once it is approved. See Approvals.
4. The upstream#
An allowed call goes to the upstream server. For a remote MCP server, bastn proxies it over HTTP. For a server behind a connector, bastn sends it down the connector's own connection, and the connector calls the local service and adds any credential there.
5. Audit#
The outcome is sealed into the audit log: who called, which tool, the decision and why, and hashes of the arguments and the result. The log stores the hashes, not the content. Each row is chained to the one before it, so a change to any sealed row is detected when the chain is verified. See Audit log.
Connectors dial out#
Some services live on private networks or laptops that bastn cannot reach. A connector is a small program you run next to them. It opens an outbound, mutually authenticated TLS connection to bastn's connector hub and keeps it open. Calls travel down that connection, so you open no inbound port on your side.
A connector offers capabilities: a local MCP server (a stdio program or an HTTP server), a REST API described by an OpenAPI spec, or a single REST call mapped by hand. A REST credential is read on the connector and is never sent to bastn. Each capability you mount as a server is governed like any other server. See Connectors.
What is not proxied#
/mcp serves tool listing and tool calls, plus initialize, ping and notifications. MCP resources and prompts from upstream servers are not passed through.