MCP integration
Talon connects external Model Context Protocol servers to personas through skills. An MCP server belongs to a skill. A persona gets the server when that skill is in its skills list. A server in a skill that the persona does not use is invisible to it.
Adding an MCP server
Section titled “Adding an MCP server”npx talonctl add-mcp --skill web-search --name filesystem \ --transport stdio --command npx --args -y @modelcontextprotocol/server-filesystem /userdataThis writes the server definition to skills/web-search/mcp/filesystem.json:
{ "name": "filesystem", "config": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/userdata"] }}The skill directory must exist first. Create it with talonctl add-skill --name web-search --persona assistant, which also attaches the skill to the persona in talond.yaml:
personas: - name: assistant skills: - web-searchTalon passes the persona’s MCP servers to the provider runtime when an agent run starts.
Transport
Section titled “Transport”Talon supports three MCP transport types. --transport is required.
| Transport | Description |
|---|---|
stdio | Spawn a child process, communicate over stdin/stdout |
sse | Connect to a remote server via Server-Sent Events |
http | Connect to a remote server via HTTP |
npx talonctl add-mcp --skill my-skill --name my-server --transport stdio \ --command node --args /path/to/server/index.js \ --env 'API_KEY=${MY_SERVER_API_KEY}'SSE / HTTP
Section titled “SSE / HTTP”For remote MCP servers, use --url instead of --command. Header values support environment variable substitution. Quote the argument so your shell does not expand it:
npx talonctl add-mcp --skill work-search --name internal-search --transport http \ --url https://search.example.com/mcp \ --headers 'Authorization=Bearer ${SEARCH_API_TOKEN}'Put the real value in .env. Do not place credentials literally in the skill’s MCP JSON file.
Fields in the config object of skills/<skill>/mcp/<server>.json:
| Config field | Required | Description |
|---|---|---|
name | No | Server name. Defaults to the top-level name of the file. Must not start with __talond_ |
transport | Yes | stdio, sse, or http |
command | Yes (stdio) | Command to spawn the server process |
args | No | Additional arguments (stdio only) |
url | Yes (sse/http) | Remote server URL |
headers | No | Custom HTTP headers. Values support ${ENV_VAR} substitution |
env | No | Environment variables passed to the server process (stdio only). Values support ${ENV_VAR} substitution |
auth | No | OAuth config. The daemon resolves it before the server list reaches a provider (see below) |
timeoutMs | No | Per-request timeout in milliseconds (see Per-server limits) |
toolOutputCap | No | Cap on tool output in characters (see Per-server limits) |
Talon expands ${ENV_VAR} references in MCP headers and stdio environment values once. If the result still contains $VAR or ${VAR} syntax, Talon stops before the provider starts. Some provider CLIs expand those references in their own MCP configuration.
talonctl env-check reports missing variables referenced by talond.yaml and by MCP definitions under skills/*/mcp/*.json. It prints names and status only, never values.
OAuth for remote MCP servers
Section titled “OAuth for remote MCP servers”HTTP and SSE MCP servers that require OAuth 2.0 can use Talon-managed tokens. Talon owns the token lifecycle. No mcp-remote or other stdio bridge process runs. Providers never receive the OAuth cache or the client credentials.
OAuth MCP resource URLs must use HTTPS.
Configuring OAuth
Section titled “Configuring OAuth”Add the server with --auth oauth2:
npx talonctl add-mcp --skill work-search --name glean --transport http \ --url https://search.example.com/mcp --auth oauth2By default, talonctl auth-mcp uses Dynamic Client Registration (RFC 7591) when the authorization server advertises it. Some authorization servers return a client secret for a client they register as public. Talon accepts that response and does not store or send the secret.
For a pre-registered client, pass the names of the environment variables that hold the client credentials, not the values:
npx talonctl add-mcp --skill work-search --name enterprise-search --transport http \ --url https://search.example.com/mcp --auth oauth2 \ --scopes search:read \ --client-id-env SEARCH_OAUTH_CLIENT_ID \ --authorization-server-issuer https://identity.example.com \ --client-secret-env SEARCH_OAUTH_CLIENT_SECRET \ --token-endpoint-auth-method client_secret_basic| Flag | Description |
|---|---|
--auth oauth2 | Enable Talon-managed OAuth for this server |
--scopes <scopes...> | OAuth scopes to request. Talon requests no scopes by default |
--client-id-env <name> | Environment variable with a pre-registered client id |
--client-secret-env <name> | Environment variable with the client secret. Omit it for a public client |
--authorization-server-issuer <url> | HTTPS issuer for a pre-registered client. Required with --client-id-env. Metadata discovery is pinned to it |
--token-endpoint-auth-method <method> | client_secret_basic (default with a secret) or client_secret_post |
For a pre-registered client, register http://127.0.0.1:8788/callback as an allowed redirect URI. Use the matching port if you change it.
The resulting skill file, skills/work-search/mcp/enterprise-search.json:
{ "name": "enterprise-search", "config": { "transport": "http", "url": "https://search.example.com/mcp", "auth": { "kind": "oauth2", "clientIdEnv": "SEARCH_OAUTH_CLIENT_ID", "clientSecretEnv": "SEARCH_OAUTH_CLIENT_SECRET", "authorizationServerIssuer": "https://identity.example.com", "scopes": ["search:read"], "tokenEndpointAuthMethod": "client_secret_basic" } }}The skill loader sets auth.tokenStore to <skillName>/<serverName> when you omit it. Before each agent run, the daemon turns the access token into an Authorization: Bearer <token> header and removes the auth field.
Authenticating with talonctl auth-mcp
Section titled “Authenticating with talonctl auth-mcp”Run the OAuth flow once per server:
# Native install on your desktop. Opens your local browsernpx talonctl auth-mcp work-search:glean
# Docker starter on the same desktop. Open the printed URL in the host browsertalonctl auth-mcp work-search:glean --docker
# Remote native daemon over SSH. Prints the URL and an ssh -L forward commandnpx talonctl auth-mcp work-search:glean --headless| Option | Description | Default |
|---|---|---|
--headless | Do not open a browser. Print the auth URL and a suggested SSH forward command | off |
--docker | Use the callback that the Docker starter publishes on host loopback | off |
--port <port> | Localhost callback port. A custom port must match the SSH forward or the Compose mapping | 8788 |
--config <path> | Path to talond.yaml | talond.yaml |
--skills-dir <path> | Path to the skills directory | skills |
The command generates a PKCE challenge, runs the authorization-code flow, and stores the access and refresh tokens. The callback listener binds 127.0.0.1.
The Docker starter publishes the callback on host loopback only (127.0.0.1:8788). With --docker, the command listens on the container interface only while it runs. The callback is not exposed to the LAN.
Token storage and refresh
Section titled “Token storage and refresh”- Token bundles live at
<dataDir>/mcp-auth/<tokenStore>.jsonwith mode0600 - Writes are atomic (temp file, then rename)
- The daemon refreshes access tokens that are within 60 seconds of expiry, using the cached
refresh_token - The daemon picks up a new bundle on the next agent run. No restart is needed
- If both the access token and the refresh token have expired, agent runs fail with a message to re-run
talonctl auth-mcp - If the MCP resource URL or the configured scopes change, re-run
auth-mcp. Talon rejects a cached bundle whose authorization context no longer matches
Security
Section titled “Security”- Token files are readable and writable by the owner only (
0600) - The daemon resolves and removes the
authfield before the server list reaches a provider CLI - For a pre-registered client, the client secret stays in the environment and is not copied into the token bundle
- When a persona uses an OAuth-authenticated HTTP or SSE MCP server, Talon disables the provider’s native shell and filesystem tools for that run. Provider web search and fetch, Talon’s host tools, and configured MCP servers stay available
- Codex CLI cannot disable its native tools. Runs that use an OAuth MCP server with Codex CLI fail closed with a message to switch provider
This restriction limits what the model can call. It is not OS-level isolation from other processes that run as the daemon’s Unix user.
Per-persona binding
Section titled “Per-persona binding”A persona receives only the MCP servers of the skills in its skills list.
personas: - name: researcher skills: - web-search - name: coder skills: - github-toolsresearcher sees the servers in skills/web-search/mcp/. coder sees the servers in skills/github-tools/mcp/. Neither sees the other’s servers.
Per-server limits
Section titled “Per-server limits”Each MCP server can carry two optional numeric keys in its skill JSON. talonctl add-mcp accepts them as flags:
npx talonctl add-mcp --skill work-search --name glean --transport http \ --url https://search.example.com/mcp --auth oauth2 \ --timeout-ms 180000 --tool-output-cap 12000| Key | Flag | Description |
|---|---|---|
timeoutMs | --timeout-ms | Timeout per MCP request in milliseconds. Integer, 1000 or higher. Applies to listTools and callTool. When omitted, the 60 000 ms default applies |
toolOutputCap | --tool-output-cap | Cap, in characters, on a tool result before it enters the agent’s message history. Integer, 0 or higher. 0 disables the cap for that server |
These limits apply only to the openai-compatible provider, in both chat-completions and Responses API mode. Claude Code, Gemini CLI and Codex CLI runs ignore them.
Both keys are Talon runtime metadata. Talon never sends them to the MCP server.
The persona’s queryTimeoutMinutes still bounds the whole query. The per-server timeout bounds single MCP operations only.
Precedence for the output cap: the per-server value, then the provider-level toolOutputCap option, then 4 000 characters.
When a cap is active, Talon keeps the full MCP tool results in memory for the current run. The model can read them in parts of up to 8 000 characters through the built-in fetch_tool_output tool.
To change the limits of an existing server, edit the two keys under config in its JSON file. add-mcp rejects a duplicate server name.
Internal MCP servers
Section titled “Internal MCP servers”Talon uses the __talond_ prefix for its internal MCP servers:
| Server | Purpose |
|---|---|
__talond_host_tools | The built-in host tools (schedule, memory, channel, persona delegation, and others) |
__talond_skill_loader | Lazy skill loading via skill_load |
Talon rejects skill-defined servers that use the __talond_ prefix.
Capability policies
Section titled “Capability policies”Capability labels gate Talon’s host tools. They do not filter the tools of an external MCP server. Talon passes a skill’s MCP servers to the provider runtime, and the provider calls them directly. Attach a skill with an MCP server only to personas that should have all of that server’s tools.