From keycard-cli
Add or update an MCP server entry in .mcp.json. TRIGGER when: user wants to add or update an MCP server in .mcp.json. DO NOT TRIGGER when: user wants to set a keycard.toml field (use keycard-upsert-config); user wants to discover which MCP servers are available (use keycard-discover-entities).
How this skill is triggered — by the user, by Claude, or both
Slash command
/keycard-cli:keycard-upsert-mcp-config add "<name>" command="<cmd>" args=[...] env={...}add "<name>" command="<cmd>" args=[...] env={...}The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Add an MCP server entry to `.mcp.json`. Writes to the project-local `.mcp.json` only (user-global config is out of scope). Supports stdio MCP servers only; HTTP/SSE transport is not supported in this version.
Add an MCP server entry to .mcp.json. Writes to the project-local .mcp.json only (user-global config is out of scope). Supports stdio MCP servers only; HTTP/SSE transport is not supported in this version.
The arguments for this invocation are: $ARGUMENTS
Read .mcp.json. If the file is absent or empty, start from:
{
"mcpServers": {}
}
Parse name, command, args, and env from $ARGUMENTS.
Expected format: add "<name>" command="<cmd>" args=[...] env={...}
args is a JSON array of strings (omit key when empty).env is a JSON object of string key/value pairs (omit key when empty).Validate name matches [A-Za-z0-9._-]{1,64}. If it does not, stop with:
Server name
<name>contains invalid characters. Use only letters, digits,.,_, and-(max 64 chars).
If mcpServers["<name>"] already exists, stop with this error:
MCP server
<name>already exists in.mcp.json. Use a different name or remove the existing entry first.
Do not overwrite silently.
Set mcpServers["<name>"] to:
{
"command": "<cmd>",
"args": [...],
"env": {...}
}
Omit the args key entirely when the array is empty. Omit the env key entirely when the object is empty.
Write the updated config to .mcp.json with 2-space indentation. Example format:
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "@my/mcp-server"]
}
}
}
Re-read .mcp.json and show the user the added mcpServers["<name>"] entry to confirm the write succeeded.
/keycard-upsert-mcp-config add "my-server" command="npx" args=["-y", "@my/mcp-server"] env={}
/keycard-upsert-mcp-config add "local-tool" command="/usr/local/bin/my-mcp"
npx claudepluginhub keycardai/plugins --plugin keycard-cliCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.