Expand description
Wiring murk mcp into AI-editor MCP client configs — the engine behind
murk agent connect / murk agent disconnect.
Every client stores MCP servers in its own file with its own root key
(mcpServers, or servers for VS Code) and its own formatting, and those
files are frequently hand-edited and full of // comments. So we never
reserialize the whole document: we surgically upsert (or remove) only the
murk entry, leaving every other server, key, and comment byte-for-byte
intact. The only thing written into a config is a MURK_KEY_FILE path plus
MURK_AGENT=1 — never inline key material — so even a committed config leaks
nothing but a machine-local path.
Structs§
- Client
Adapter - A supported MCP client: where its project-local config lives, the root key
its server map uses (or table namespace for TOML), whether an entry needs a
typed
"type": "stdio", the on-disk format, and a marker directory whose presence signals the client is used in a project. - Connect
Outcome - Outcome of wiring one client.
Enums§
- Config
Format - The on-disk format of a client’s MCP config.
Constants§
- ADAPTERS
- Supported clients. Each writes a project-local config so a repo’s grant never leaks into a global, cross-repo config.
Functions§
- adapter
- Look up an adapter by id (case-insensitive).
- connect_
client - Upsert the
murkserver intoadapter’s config underproject_dir, writing only aMURK_KEY_FILEpath (key_file) +MURK_AGENT=1and anyextra_argsaftermcp. Preserves every other server and comment; atomic (temp+rename). - detect
- Adapters whose config file or marker directory already exists under
project_dir— the clients this repo actually uses. - disconnect_
client - Remove the
murkserver fromadapter’s config. Returns the path when a change was written,Nonewhen there was nothing to remove.