MCP examples

Local Node server

{
  "mcp": {
    "docs": {
      "type": "stdio",
      "command": "node",
      "args": ["./tools/docs-mcp-server.js"],
      "enabledTools": ["search_docs"],
      "timeoutMs": 5000,
    },
  },
}

The model-facing tool name is mcp_docs_search_docs.

Match an MCP tool in a hook

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "mcp_docs_search_docs",
        "command": ".topchester/hooks/check-mcp-tool.sh",
      },
    ],
  },
}

Use hook matchers when MCP tools need extra project policy.