Skip to content

MCP servers

An MCP server is the most common thing you’ll manage. Add it once; by default it fans out to all enabled agents.

Terminal window
agentsync mcp add github \
--command npx \
--args "-y,@modelcontextprotocol/server-github" \
--env "GITHUB_TOKEN=\${secret:github.token}"
Terminal window
agentsync mcp list
agentsync mcp remove github

Each server becomes one small, hand-editable file at ~/.agentsync/mcp/<name>.toml:

~/.agentsync/mcp/github.toml
[server]
type = "stdio"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]
[server.env]
GITHUB_TOKEN = "${secret:github.token}"
# source-only: which agents this server fans out to ("*" = all enabled)
agents = ["*"]

You can edit this file by hand or via the CLI — both are first-class.

By default a server fans out to all enabled agents (agents = ["*"]). Narrow it with an allowlist, either on the CLI (--agents "claude,opencode") or by editing the agents array in the TOML.

Never put a credential in the TOML. Reference it:

[server.env]
GITHUB_TOKEN = "${secret:github.token}"

agentsync resolves ${secret:…} at apply time and writes the value into native config — but never captures the cleartext back into your source.