{
  "kind": "mcp-client-config",
  "schema_version": 2,
  "product": "Chartbuddy Hub",
  "docs_is_not_mcp_api": true,
  "docsOnlyBase": "/hub/docs",
  "architecture": "AI client (stdio MCP) → chartbuddy --mcp → Hub loopback HTTP (~/.chartbuddy/mcp-port)",
  "transport": {
    "type": "stdio",
    "framing": ["newline-delimited-jsonrpc", "content-length"],
    "framing_note": "Preferred: one JSON-RPC object per line. Also accepts LSP-style Content-Length framing; responses match the request framing. This host's HTTP is never MCP.",
    "not_http": true
  },
  "command": "/Applications/Chartbuddy.app/Contents/MacOS/chartbuddy",
  "args": ["--mcp"],
  "binary": {
    "macos_release": "/Applications/Chartbuddy.app/Contents/MacOS/chartbuddy",
    "mcp_args": ["--mcp"],
    "status_args": ["--mcp-status"],
    "status_alias": ["--mcp-doctor"]
  },
  "mcp_json": {
    "mcpServers": {
      "chartbuddy": {
        "type": "stdio",
        "command": "/Applications/Chartbuddy.app/Contents/MacOS/chartbuddy",
        "args": ["--mcp"]
      }
    }
  },
  "cursor": {
    "recommended": true
  },
  "recommended_clients": ["cursor", "claude_code", "opencode"],
  "claude_code": {
    "recommended": true,
    "scope": "user",
    "one_liner": "claude mcp add-json chartbuddy '{\"type\":\"stdio\",\"command\":\"/Applications/Chartbuddy.app/Contents/MacOS/chartbuddy\",\"args\":[\"--mcp\"]}' --scope user",
    "note": "User scope is usual — absolute path is machine-specific. Also applies to the Code tab in the Claude desktop app."
  },
  "claude_browser_home": {
    "hub_mcp_available": false,
    "reason": "No remote MCP endpoint; browser and desktop Home tab cannot reach local stdio Hub.",
    "alternatives": {
      "claude_code": "/hub/docs/connect-mcp/claude-code",
      "embed_docs": "https://chartbuddy.io/embed/docs/getting-started/"
    }
  },
  "opencode": {
    "recommended": true,
    "config": "~/.config/opencode/opencode.json",
    "note": "Top-level key is mcp (not mcpServers). type: local; command is one array with binary + --mcp; enabled: true.",
    "mcp": {
      "chartbuddy": {
        "type": "local",
        "command": ["/Applications/Chartbuddy.app/Contents/MacOS/chartbuddy", "--mcp"],
        "enabled": true
      }
    }
  },
  "chatgpt_codex": {
    "note": "Codex CLI and the Codex tab in the ChatGPT desktop app. MCP servers: Settings → Plugins → MCPs.",
    "desktop_tab_approval_blocker": "OpenAI automatic approval reviewer may block Chartbuddy tool calls with a “reasoning summaries” / organization verification error even when MCP is configured correctly. Workarounds: Codex CLI, verify org at https://platform.openai.com/settings/organization/general, or use Cursor / Claude Code / OpenCode."
  },
  "chatgpt_browser": {
    "hub_mcp_available": false,
    "reason": "No remote MCP endpoint; browser and regular desktop chat cannot reach local stdio Hub.",
    "alternatives": {
      "chatgpt_codex": "/hub/docs/connect-mcp/chatgpt-codex",
      "embed_docs": "https://chartbuddy.io/embed/docs/getting-started/"
    }
  },
  "status_cli": "/Applications/Chartbuddy.app/Contents/MacOS/chartbuddy --mcp-status",
  "status_cli_behavior": "Read-only. Never launches Hub. Exit 0 = bridge up; 1 = Hub down. Sandboxed agents may block 127.0.0.1 even when Hub is healthy — loopback approval may be needed if the port file exists but status says unreachable.",
  "hub_launch": {
    "required_for_live_bridge": true,
    "macos": "open -a Chartbuddy",
    "note": "After config is written, Hub must be running (or adapter may auto-launch on first --mcp tool call). Status CLI never launches Hub."
  },
  "sample_tools_call": {
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
      "name": "list_charts",
      "arguments": {}
    }
  },
  "smoke_test_shell": "printf '%s\\n' '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"smoke\",\"version\":\"0\"}}}' '{\"jsonrpc\":\"2.0\",\"method\":\"notifications/initialized\"}' '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\"name\":\"list_charts\",\"arguments\":{}}}' | /Applications/Chartbuddy.app/Contents/MacOS/chartbuddy --mcp",
  "after_configure": [
    "Refresh MCP / restart the client",
    "Claude Code / Codex: a new session is usually needed if native MCP tools (e.g. mcp__chartbuddy__*) are missing",
    "Cursor: mid-chat attach usually works after refresh; a new chat helps if tools are still missing",
    "Some clients require the chartbuddy MCP server enabled per chat",
    "ChatGPT / Codex: Settings → Plugins → MCPs → Add server → STDIO command + --mcp (see human_docs)",
    "Sandboxed agents may need loopback/network approval so chartbuddy --mcp can reach the 127.0.0.1 Hub bridge"
  ],
  "handoff": "Chartbuddy MCP is configured (stdio → chartbuddy --mcp → Hub).\nTransport: newline JSON-RPC or Content-Length framed MCP — not HTTP docs.\nOpen charts: list_charts — Hub chart-* and CE ce:* (surface tauri|ce). get_active_chart prefers a focused CE session when the extension bridge is connected.\ncreate_chart surface=ce opens edit on the active Slides tab (extension + presentation required).\nMissing tools usually mean the chartbuddy MCP server is off for the chat, or a new chat is needed.",
  "warnings": [
    "This host serves documentation and static setup files — it is not an MCP server and has no /hub/openapi.json.",
    "Machine-specific /Applications paths belong in user/global MCP config, not committed project files.",
    "Claude Code / Codex: mid-session attach often fails — a new session is usually needed. Cursor: mid-chat attach usually works after refresh.",
    "In sandboxed agents, loopback checks and Hub HTTP may require approval."
  ],
  "human_docs": "/hub/docs/connect-mcp/",
  "human_docs_by_client": {
    "cursor": "/hub/docs/connect-mcp/cursor",
    "claude_code": "/hub/docs/connect-mcp/claude-code",
    "opencode": "/hub/docs/connect-mcp/opencode",
    "chatgpt_codex": "/hub/docs/connect-mcp/chatgpt-codex",
    "chatgpt": "/hub/docs/connect-mcp/chatgpt",
    "chatgpt_desktop_legacy": "/hub/docs/connect-mcp/chatgpt",
    "claude": "/hub/docs/connect-mcp/claude",
    "claude_desktop_legacy": "/hub/docs/connect-mcp/claude"
  },
  "agent_plaintext": {
    "md": "/hub/mcp-setup.md",
    "json": "/hub/mcp-setup.json",
    "llms_txt": "/hub/llms.txt",
    "also_under_docs_base": [
      "/hub/docs/mcp-setup.md",
      "/hub/docs/mcp-setup.json",
      "/hub/docs/llms.txt"
    ]
  }
}
