From subagent-mcp
Build, package, install, configure, debug, and optimize Model Context Protocol (MCP) servers for Claude (Desktop, Code CLI) and Codex CLI on Windows and macOS. Use when building MCP tools, creating AI tool integrations, give Claude access to database or API or filesystem, connect AI agent to external tools or services, packaging stdio or HTTP servers, configuring mcpServers JSON or TOML, troubleshooting spawn ENOENT or connection errors, designing tool/resource/prompt schemas, implementing JSON-RPC handlers, publishing npm or Python MCP packages, setting up uvx or npx installable servers, debugging tool not appearing in Claude or Codex, writing secure MCP server code, server architecture review, MCP protocol compliance, FastMCP, @modelcontextprotocol/sdk, mcp Python library, MCP Inspector usage, Claude Desktop config, Claude Code CLI mcp add command, Codex config.toml, MCP server security, rate limiting MCP tools, MCP over SSE or HTTP transport, stdio transport pitfalls, environment variable injection for MCP, cross-platform MCP deployment, MCP server instructions field, tool search optimization, alwaysLoad, server descriptions for AI discovery, mcpb Desktop Extensions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/subagent-mcp:mcp-builderThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Build and ship MCP servers for Claude and Codex. Load `references/retrieval-map.md` first to find the right leaf doc for any task.
references/config-claude.mdreferences/config-claude/01-locations-and-json-format.mdreferences/config-claude/02-transport-and-windows-paths.mdreferences/config-claude/03-cli-env-scope-and-oauth.mdreferences/config-codex.mdreferences/implementation-patterns.mdreferences/implementation-patterns/01-handlers-async-progress.mdreferences/implementation-patterns/02-security.mdreferences/implementation-patterns/03-perf-lifecycle-testing-transport.mdreferences/install-macos.mdreferences/install-windows.mdreferences/install-windows/01-msix-trap-and-runtimes.mdreferences/install-windows/02-path-escaping-cli-wsl-diagnostics.mdreferences/packaging-node.mdreferences/packaging-node/01-server-and-package-setup.mdreferences/packaging-node/02-transport-extras-publishing.mdreferences/packaging-python.mdreferences/packaging-python/01-server-code.mdreferences/packaging-python/02-packaging-uvx-and-ops.mdreferences/protocol-spec.mdBuild and ship MCP servers for Claude and Codex. Load references/retrieval-map.md first to find the right leaf doc for any task.
Some "Load" targets below are thin indexes with a same-named sub-directory (config-claude.md, implementation-patterns.md, install-windows.md, packaging-node.md, packaging-python.md, tool-resource-prompt-schemas.md, troubleshooting.md). For these, follow the index's table of contents into references/<topic>/ for full detail — don't stop at the index. See references/retrieval-map.md for specifics.
| Task | Load |
|---|---|
| Understand MCP protocol / primitives | protocol-spec.md |
| Tool / resource / prompt schemas | tool-resource-prompt-schemas.md |
| TypeScript/Node server + npm package | packaging-node.md |
| Python server + pip/uvx package | packaging-python.md |
| Claude Desktop or Claude Code config | config-claude.md |
| Codex CLI config | config-codex.md |
| Windows install / path / registry | install-windows.md |
| macOS install / Gatekeeper / LaunchAgent | install-macos.md |
| Implementation patterns / security | implementation-patterns.md |
| Debug / errors / ENOENT / tool missing | troubleshooting.md |
| Source citations | source-ledger.md |
%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\ not %APPDATA%\Claude\. Edit the correct file.2025-06-18. Server must echo client's version on init.type: "object". Missing required array = all fields optional.env key in config, never hardcode. Never log secrets.import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({ name: "my-server", version: "1.0.0" });
server.tool("my_tool", "What it does", { param: z.string() }, async ({ param }) => ({
content: [{ type: "text", text: `Result: ${param}` }],
}));
const transport = new StdioServerTransport();
await server.connect(transport);
from fastmcp import FastMCP
mcp = FastMCP("my-server")
@mcp.tool()
def my_tool(param: str) -> str:
"""What it does."""
return f"Result: {param}"
if __name__ == "__main__":
mcp.run()
Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json on Win / ~/Library/Application Support/Claude/claude_desktop_config.json on Mac):
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "my-mcp-package"],
"env": { "API_KEY": "sk-..." }
}
}
}
Claude Code CLI:
claude mcp add --transport stdio my-server -- npx -y my-mcp-package
claude mcp add --transport http my-remote -- https://api.example.com/mcp
Codex CLI (~/.codex/config.toml):
[mcp_servers.my-server]
command = "npx"
args = ["-y", "my-mcp-package"]
npm init / uv init).npm i @modelcontextprotocol/sdk / uv add fastmcp).bin entry (TS) or entry point (Python).npx @modelcontextprotocol/inspector npx -y my-package.Claude Code defers MCP tool loading by default (tool search). Server instructions help Claude find your tools:
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "my-mcp-package"],
"serverInstructions": "Use these tools for database operations: querying, schema inspection, and record management."
}
}
}
Truncated at 2KB. Put most important info first. In code: set via SDK's server description field during initialization.
2>/dev/null and check stdout is valid JSON only.env key set for required environment variables?%APPDATA%\Claude\logs\mcp*.log / ~/Library/Logs/Claude/)npx claudepluginhub heretyc/subagent-mcp --plugin subagent-mcpCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.