> ## Documentation index
> Fetch the complete documentation index at: https://cynrath-agent-context-kit-git-feat-unified-local-toolkit-eedde3.docs7.io/llms.txt
> Ask it with GET https://cynrath-agent-context-kit-git-feat-unified-local-toolkit-eedde3.docs7.io/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.

# ADR 0037 project mcp client setup

# ADR-0037: User-initiated project MCP setup

Status: Accepted · Date: 2026-11-27

## Decision

Extend the existing command family with `ackit mcp setup`. A command with
no write flag previews setup. `--status`, `--apply` and `--uninstall`
are mutually exclusive. A mutation requires the selected client, explicit
canonical project root and a verified installation entry point. A CLI invocation
can preview or update one registration. Global locations require explicit
selection and format support. Routine ACKit commands never trigger registration.

Adapters must validate the installed configuration format and edit one owned
entry with lossless parsing where comments are supported. Refuse ambiguous
formats, malformed files, duplicate keys, user-owned name collisions and
unexpected edits since reading. Maintain a scoped ownership record and backup
for reversible changes. Handle symlinks and link count safely, stage in the
same directory, and condition publication on the expected prior state.
Preserve sibling entries and top-level settings. Write the actual local
paths only into the approved config. Logs and generated public guidance use
portable placeholders.

Provide manual config for clients without an implemented lossless writer, and
distinguish documentation validation, stdio smoke and an actual client
connection. Start from the following reference contracts:

| Client | Candidate project adapter |
|---|---|
| Codex | Trusted project `.codex/config.toml`, `mcp_servers` |
| Claude Code | `.mcp.json`, `mcpServers` |
| Claude Desktop | User-scoped config with `mcpServers`; manual flow unless explicitly selected |
| Cursor | `.cursor/mcp.json`, `mcpServers` |
| VS Code native Copilot | Workspace `.mcp.json`, `mcpServers` |
| VS Code editor-managed | Compatibility adapter for `.vscode/mcp.json`, `servers` |
| OpenCode | `opencode.json` or `opencode.jsonc`, match the installed client's versioned shape |
| Gemini CLI | `.gemini/settings.json`, `mcpServers` |

The argv specifies the already installed Node and ACKit entrypoint with the
explicit root. Never start a hosted connection, install runtime dependencies,
start an agent or trust a client workspace as a permission grant.

Use the pinned jsonc-parser and smol-toml implementations for input
validation. The JSONC adapter applies targeted edits; the TOML adapter
maintains an owned block after parsing the complete file. Store the backup
and ownership records in private local user application state, keyed to the
canonical configuration location. Uninstall restores the original bytes
when the full file still matches the managed version. Otherwise it removes
the owned entry and preserves other configuration.

References: [Codex](https://learn.chatgpt.com/docs/extend/mcp?surface=cli),
[Claude Code](https://code.claude.com/docs/en/mcp),
[Claude Desktop](https://modelcontextprotocol.io/docs/2026-07-28/develop/connect-local-servers),
[Cursor](https://cursor.com/docs/mcp),
[VS Code](https://code.visualstudio.com/docs/agents/reference/mcp-configuration),
[OpenCode](https://opencode.ai/docs/mcp-servers/),
[Gemini CLI](https://geminicli.com/docs/tools/mcp-server/).

## Verification and rollback

Use isolated client configs to verify preview, apply, update, repeated
uninstall, conflicts, concurrent edits and recovery. No test writes into a
live user config or starts a hosted AI session. Uninstall can restore an
ACKit-owned configuration to its previous state or remove only its entry
when unrelated edits were made. Leave live client configuration to a separate
user-initiated setup action.
