{
  "markdown": "# QuestDB MCP Server\n\nAn MCP server that connects coding agents (Claude Code, Codex, Cursor, OpenCode …) to a\nrunning QuestDB Web Console. The agent gets tools to create notebook\ncells, run queries, and build charts. Every action executes in the\nbrowser against your already-established QuestDB session.\n\n## Setup\n\n### Quick setup (recommended)\n\nThe interactive wizard detects your installed coding agents and\nwrites the bridge into each one's MCP config:\n\n```bash\nnpx @questdb/mcp-server-questdb setup\n```\n\nIt walks you through two steps:\n\n1. **Pick agents**: multi-select from the ones it detects (Claude Code,\n   Codex, Cursor, OpenCode, Gemini CLI).\n2. **Review settings**: optionally override `CONSOLE_ORIGIN` and\n   `MCP_BRIDGE_PORT`; press Enter to keep the defaults.\n\nThe wizard pins each agent's config to the bridge version that ran it. Your\nQuestDB Web Console expects a specific bridge version. If you're on an older\nconsole, run the matching version: `npx @questdb/mcp-server-questdb@<version> setup`. The config it writes will launch that same version. (When unsure, pair first; on a version mismatch the agent is told which version to switch to.)\n\n### Manual setup\n\nOr add it to your MCP client's config by hand (e.g. `~/.claude/.mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"questdb\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@questdb/mcp-server-questdb\"]\n    }\n  }\n}\n```\n\n### Environment variables\n\n| Label             | Value                                | Default Value                                          | Description                                                                              |\n| ----------------- | ------------------------------------ | ------------------------------------------------ | ---------------------------------------------------------------------------------- |\n| `CONSOLE_ORIGIN`  | origin URL                           | `http://127.0.0.1:9000`                          | QuestDB Web Console origin. `127.0.0.1` and `localhost` are interchangeable.       |\n| `MCP_BRIDGE_PORT` | `1`–`65535`                          | auto-allocated                                   | When specified, the bridge uses a fixed port. The port is bound on the first pairing attempt, pairing fails with a `bridge_bind_failed` error if the port is taken. |\n| `LOG_PATH`        | file path                            | `/tmp/questdb-mcp-bridge/<ISO-ts>-<pid>.log`     | Override the log file location.                                                    |\n| `LOG_LEVEL`       | `ERROR` / `WARN` / `INFO` / `DEBUG`  | `INFO`                                           | `DEBUG` adds heartbeats and full tool payloads.                                    |\n\n\n## Commands\n\nYour MCP client runs the bridge for you via the config above, so you\nrarely invoke it by hand. When you do:\n\n| Command                             | Description                              |\n| ----------------------------------- | ---------------------------------------- |\n| `npx @questdb/mcp-server-questdb` (no args) | Start the bridge — same as `start`.      |\n| `npx @questdb/mcp-server-questdb start`     | Start the bridge.                        |\n| `npx @questdb/mcp-server-questdb setup`     | Interactively configure the bridge for your coding agents. |\n| `npx @questdb/mcp-server-questdb --version` | Print the version and exit. Alias: `-v`. |\n| `npx @questdb/mcp-server-questdb --help`    | Print this help and exit. Alias: `-h`.   |\n\nAn unknown command exits non-zero with a short error. Pin a version with\n`npx @questdb/mcp-server-questdb@0.3.0 start`. (Installed on your `PATH`, the\nexecutable is named `mcp-server-questdb`.)\n\n\n## Pairing\n\nBefore any notebook / chart / SQL tool works, your browser has to pair\nwith the bridge. The agent drives the flow.\n\nWhen the agent needs to pair, it calls `get_pairing_credentials` and\nshows you **both**:\n\n- A one-click deep link — open it in the tab showing your Web Console.\n- A WebSocket URL + token — paste into the **MCP pill** at the bottom\n  of the Web Console if the deep link doesn't land in the right tab.\n\nEither path lands you on a consent prompt. Accept it and the agent's\nnext tool call goes through.\n\nEach bridge run generates a fresh port and pairing token, held only in\nmemory. On restart the old credentials stop working — the agent will\nsurface new ones the next time it needs to pair.\n\n\n## Logs\n\nThe bridge writes to stderr and to a log file. Tail the newest:\n\n```bash\ntail -F \"$(ls -t /tmp/questdb-mcp-bridge/*.log | head -1)\"\n```\n\nAt default `INFO`:\n\n```\n2026-05-15T12:29:27.142Z [INFO] tool_call: run_query\n2026-05-15T12:29:27.318Z [INFO] tool_result: run_query ok\n2026-05-15T12:29:28.011Z [ERROR] tool_result: update_cell internal_error timeout after 15000ms\n```\n\nAt `DEBUG` (full payloads as continuation lines):\n\n```\n2026-05-15T12:29:27.142Z [INFO] tool_call: run_query\n2026-05-15T12:29:27.142Z [DEBUG]   args: {\"query\":\"SELECT count() FROM trades\"}\n2026-05-15T12:29:27.318Z [INFO] tool_result: run_query ok\n2026-05-15T12:29:27.318Z [DEBUG]   content: [{\"type\":\"text\",\"text\":\"...\"}]\n```\n\n\n## License\n\nApache-2.0.\n",
  "bytes": 5109,
  "sha": "901d723bf59ed03118947cc660cea506af3109e1a18ae0cd766008e714e535e1",
  "repo_slug": "questdb/mcp-server-questdb",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_questdb_mcp_server_questdb_a620a21e/readme"
}