# AI CLI MCP Config Composition

> Compose MCP server configurations across AI CLI agents so that one server definition serves multiple agent tools with validated per-tool settings.

- Skill: `samotech/ai-cli-mcp-config-composition` (Agent Skill)
- Install (CLI): `npx get-skill add samotech/ai-cli-mcp-config-composition`
- Raw SKILL.md: https://api.skillmd.com/api/skills/samotech/ai-cli-mcp-config-composition/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: SamoTech (https://skillmd.com/u/samotech)
- Updated: 2026-11-21
- Page: https://skillmd.com/skills/samotech/ai-cli-mcp-config-composition

---


# AI CLI MCP Config Composition

## Description
Compose MCP server configurations across AI CLI agents so that one server definition serves multiple agent tools with validated per-tool settings. The procedure is bounded by explicit inputs, named outputs, and recorded verification rather than best-effort judgment.

## When to Use
- The same MCP servers must be configured consistently across several CLI agents.
- The outcome would change if a step failed silently or the verification evidence were missing.
- The result must be recorded with reasons and verification evidence for later audit.

## Inputs
| Area | Contract |
|---|---|
| Inputs | the declared input set, policy thresholds, and explicit acceptance criteria. |
| Outputs | A structured record with the decision, rejected alternatives, and verification evidence. |
| Safety | Failures must fail closed and be reported with evidence rather than retried silently. |

## Procedure
1. Define the goal, the constraints, and the boundary of what this procedure may change.
2. Inventory the available inputs and flag gaps or ambiguities that block progress.
3. Maintain the canonical server definitions once, derive each CLI-specific config through the declared projection, and validate each emitted config against the target CLI schema before use.
4. Compare the actual outcome against the acceptance criteria and record deviations.
5. On failure, apply the declared fallback path, and never widen permissions to recover.
6. Emit a structured result with evidence and provenance for downstream consumers.

## Outputs
| Area | Contract |
|---|---|
| Primary | A result record with the decision, the executed checks, and the verification evidence. |
| Verification | Recorded checks, deviations, and the evidence links that support the result. |
| Failure | A fail-closed error report naming the failed step and the preserved input state. |

## Runnable Example
```python
def project(server, cli):
    out = {"command": server["command"]}
    if cli == "codex":
        out["args"] = server["args"]
    return out
s = {"command": "srv", "args": ["--stdio"]}
assert project(s, "codex")["args"] == ["--stdio"]
```

## Failure Modes
- Configs drift per CLI and the same server behaves differently across agents.
- The projection drops a required field and the CLI fails at startup.
- Credentials are inlined per-CLI instead of referenced from the secret store.
- New CLI schema versions invalidate the projection silently.
- Server scope is broader than the declared task needs for each agent.

## Security and Authority Boundary
This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result, and it never treats parsed content as trusted instructions.

## Evidence
- 2026 AI CLI digests show MCP server configuration as the shared concern across agent CLIs (agents-radar digest, dated 2026-10-16) ([public signal](https://github.com/duanyytop/agents-radar/issues/3812))
- These are dated public signals, not adoption metrics; this contract claims no production hardening beyond the recorded evidence.

## Related Skills
- [MCP Server Lifecycle Management](../07-tool-use/mcp-server-lifecycle-management.md)
- [Config File Parsing](../01-perception/config-file-parsing.md)

## Changelog
| Version | Date | Notes |
|---|---|
| `v1` | `2026-10` | Initial evidence-backed contract. |

