Configuration format¶
agent-align reads two YAML files:
- MCP definitions – the source of truth for your servers (default
agent-align-mcp.ymlnext to the target config). This file is required. - Target config – describes which agents to update, optional path overrides,
and any extra copy tasks (default
/etc/agent-align.yml).
MCP definitions file (agent-align-mcp.yml)¶
The MCP file lists every server in a neutral JSON-style shape:
servers:
github:
type: streamable-http
url: https://api.example.com/mcp/
headers:
Authorization: "Bearer REPLACE_WITH_GITHUB_TOKEN"
tools: []
claude-cli:
command: npx
args:
- '@example/mcp-server@latest'
env:
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
prompts:
command: ./scripts/run-prompts.sh
args:
- --watch
You can also use the legacy mcpServers key instead of servers. Each server
entry is a mapping; the keys match the fields you would normally place in the
agent-specific files (for example, command, args, env, headers,
alwaysAllow, autoApprove, disabled, tools, type, and url).
Target config file (agent-align.yml)¶
The target config points to the MCP file (optional if you accept the default path) and lists the destinations to update:
mcpServers:
configPath: agent-align-mcp.yml
targets:
agents:
- name: copilot
- name: vscode
- name: codex
path: /custom/.codex/config.toml # optional override
- claudecode
- gemini
- kilocode
additionalTargets:
json:
- filePath: /path/to/additional_targets.json
jsonPath: .mcpServers
jsonc:
- filePath: /path/to/additional_targets.jsonc
jsonPath: .mcpServers
extraTargets:
files:
- source: /path/to/AGENTS.md
destinations:
- /path/to/other/AGENTS.md
directories:
- source: /path/to/prompts
destinations:
- path: /path/to/another/prompts
excludeGlobs:
- 'troubleshoot/**'
flatten: true
Fields¶
mcpServers(mapping, required) – nests MCP sync settings.configPath(string, optional) – path to the MCP definitions file. Defaults toagent-align-mcp.ymlnext to the target config when omitted.targets(mapping, required) – agents to write plus optional extras.agents(sequence, required) – list of agent names or objects withnameand optionalpathoverride for the destination file. Repeat an agent with differentpathvalues to write the same format to multiple destinations. Exact duplicatename + pathcombinations and blank entries are ignored.additionalTargets.json(sequence, optional) – mirror the MCP payload into other JSON files. Each entry must specifyfilePathand may setjsonPath(dot-separated) where the servers should be placed; omitjsonPathto replace the entire file.additionalTargets.jsonc(sequence, optional) – mirror the MCP payload into other JSONC (JSON with Comments) files. Each entry must specifyfilePathand may setjsonPath(dot-separated) where the servers should be placed; omitjsonPathto replace the entire file. Comments in the original file will be stripped when writing the updated content.
extraTargets(mapping, optional) – copies additional content alongside the MCP sync.files(sequence) – mirror a single source file to multiple destinations. Each entry must specifysourceand at least onedestinationsvalue. Each destination may be provided as a plain string (the destination path) or as a mapping. Destinations support an optionalpathToSkills(string). When set,agent-alignwill append theskills.mdtemplate from the config directory and any discoveredSKILL.mdfiles found under the provided path to the copied destination file.directories(sequence) – copy every file withinsourceto each entry indestinations. Every destination entry must specify apathand may setexcludeGlobs(sequence of glob patterns) to skip matching files, and/orflatten: trueto drop the source directory structure while copying. Glob patterns support**for recursive matching (e.g.,dir/**excludes all files underdir/,*.logexcludes all log files).
Supported Agents and defaults¶
| Agent | Config File | Format | Root |
|---|---|---|---|
| copilot | ~/.copilot/mcp-config.json |
JSON | mcpServers |
| vscode | ~/.config/Code/User/mcp.json |
JSON | servers |
| codex | ~/.codex/config.toml |
TOML | mcp_servers |
| claudecode | ~/.claude.json |
JSON | mcpServers |
| gemini | ~/.gemini/settings.json |
JSON | mcpServers |
| kilocode | Platform-dependent (see note below) | JSON | mcpServers |
Every agent accepts a path override in targets.agents if your installation
lives elsewhere.
Note: Kilocode config paths
- Windows:
~/AppData/Roaming/Code/user/mcp.json - Linux:
~/.config/Code/User/globalStorage/kilocode.kilo-code/settings/mcp_settings.json
CLI flags and init command¶
-config– Path to the target config. Defaults to the platform-specific location listed above.-mcp-config– Path to the MCP definitions file. Defaults toagent-align-mcp.ymlnext to the selected config.-agents– Override the target agents defined in the config. Overrides still honor per-agentpathentries if they exist in the file.-dry-run– Preview changes without writing.-confirm– Skip the confirmation prompt when applying writes.
Destinations also accept an optional frontmatterPath (string).
When provided, the referenced file's contents will be written (as a
frontmatter/template block) to the destination before any skills.md
content is appended. This is useful when copying prompt files that need
YAML frontmatter or a fixed header.
Run agent-align init -config ./agent-align.yml to generate a starter config via
prompts if you prefer not to edit YAML manually. The wizard collects the agent
list plus optional additional JSON destinations and writes the final file for you.