Skip to content

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.

Terminal window
npx talonctl add-mcp --skill web-search --name filesystem \
--transport stdio --command npx --args -y @modelcontextprotocol/server-filesystem /userdata

This 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-search

Talon passes the persona’s MCP servers to the provider runtime when an agent run starts.

Talon supports three MCP transport types. --transport is required.

TransportDescription
stdioSpawn a child process, communicate over stdin/stdout
sseConnect to a remote server via Server-Sent Events
httpConnect to a remote server via HTTP
Terminal window
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}'

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:

Terminal window
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 fieldRequiredDescription
nameNoServer name. Defaults to the top-level name of the file. Must not start with __talond_
transportYesstdio, sse, or http
commandYes (stdio)Command to spawn the server process
argsNoAdditional arguments (stdio only)
urlYes (sse/http)Remote server URL
headersNoCustom HTTP headers. Values support ${ENV_VAR} substitution
envNoEnvironment variables passed to the server process (stdio only). Values support ${ENV_VAR} substitution
authNoOAuth config. The daemon resolves it before the server list reaches a provider (see below)
timeoutMsNoPer-request timeout in milliseconds (see Per-server limits)
toolOutputCapNoCap 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.

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.

Add the server with --auth oauth2:

Terminal window
npx talonctl add-mcp --skill work-search --name glean --transport http \
--url https://search.example.com/mcp --auth oauth2

By 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:

Terminal window
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
FlagDescription
--auth oauth2Enable 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.

Run the OAuth flow once per server:

Terminal window
# Native install on your desktop. Opens your local browser
npx talonctl auth-mcp work-search:glean
# Docker starter on the same desktop. Open the printed URL in the host browser
talonctl auth-mcp work-search:glean --docker
# Remote native daemon over SSH. Prints the URL and an ssh -L forward command
npx talonctl auth-mcp work-search:glean --headless
OptionDescriptionDefault
--headlessDo not open a browser. Print the auth URL and a suggested SSH forward commandoff
--dockerUse the callback that the Docker starter publishes on host loopbackoff
--port <port>Localhost callback port. A custom port must match the SSH forward or the Compose mapping8788
--config <path>Path to talond.yamltalond.yaml
--skills-dir <path>Path to the skills directoryskills

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 bundles live at <dataDir>/mcp-auth/<tokenStore>.json with mode 0600
  • 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
  • Token files are readable and writable by the owner only (0600)
  • The daemon resolves and removes the auth field 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.

A persona receives only the MCP servers of the skills in its skills list.

personas:
- name: researcher
skills:
- web-search
- name: coder
skills:
- github-tools

researcher sees the servers in skills/web-search/mcp/. coder sees the servers in skills/github-tools/mcp/. Neither sees the other’s servers.

Each MCP server can carry two optional numeric keys in its skill JSON. talonctl add-mcp accepts them as flags:

Terminal window
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
KeyFlagDescription
timeoutMs--timeout-msTimeout 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-capCap, 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.

Talon uses the __talond_ prefix for its internal MCP servers:

ServerPurpose
__talond_host_toolsThe built-in host tools (schedule, memory, channel, persona delegation, and others)
__talond_skill_loaderLazy skill loading via skill_load

Talon rejects skill-defined servers that use the __talond_ prefix.

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.