
Claude Mcp Bridge
Wraps Claude Code CLI as an MCP subprocess so you can call it from Cursor, Windsurf, or any MCP client without shell access. Exposes five tools: query for prompts with file context and session resume, search for web lookups, structured for JSON Schema validated output, ping for health checks, and listSessions for cost tracking. Handles effort levels, budget caps, and returns detailed token metadata on every call. Choose this over calling the CLI directly when you need structured output validation, session management across calls, or you're in an environment that can't spawn shells. Supports both subscription and API key auth, with model fallback on quota exhaustion. Most useful when you want Claude Code's agentic capabilities wrapped in a controlled, cost-aware interface.
- GitHub stars
- 7
- tools
- 5
- transport
- STDIO
- env vars
- 14
- last updated
- Oct 18, 2026
Tools
5 toolsPublic tool metadata for what this MCP can expose to an agent.
queryExecute prompts with file context, session resume, effort control, and budget caps. Supports text and images.
Execute prompts with file context, session resume, effort control, and budget caps. Supports text and images.
No parameter schema in public metadata yet.
searchWeb search via Claude CLI's WebSearch and WebFetch tools. Returns synthesized answers with sources.
Web search via Claude CLI's WebSearch and WebFetch tools. Returns synthesized answers with sources.
No parameter schema in public metadata yet.
structuredJSON Schema validated output via Claude CLI's native --json-schema.
JSON Schema validated output via Claude CLI's native --json-schema.
No parameter schema in public metadata yet.
pingHealth check with CLI version, auth method, capabilities, and model config.
Health check with CLI version, auth method, capabilities, and model config.
No parameter schema in public metadata yet.
listSessionsList active sessions with cumulative cost, turn count, and timestamps.
List active sessions with cumulative cost, turn count, and timestamps.
No parameter schema in public metadata yet.
Sponsors
Configuration
CLAUDE_CLI_PATHdefault: claudePath to the claude CLI binary. Defaults to 'claude' on PATH.
CLAUDE_DEFAULT_MODELShared default model for all tools. Overridden by per-tool CLAUDE_<TOOL>_MODEL vars (QUERY, SEARCH, STRUCTURED).
CLAUDE_QUERY_MODELdefault: sonnetOverride model for the query tool.
CLAUDE_STRUCTURED_MODELdefault: sonnetOverride model for the structured tool.
CLAUDE_SEARCH_MODELdefault: sonnetOverride model for the search tool.
CLAUDE_FALLBACK_MODELdefault: haikuModel to use when the primary model hits a quota error. Set to 'none' to disable fallback.
CLAUDE_MAX_CONCURRENTdefault: 3Maximum concurrent Claude CLI subprocesses (default 3).
CLAUDE_BRIDGE_USE_API_KEYdefault: 0Set to '1' to forward ANTHROPIC_API_KEY to the CLI. Default is subscription-first: the CLI uses existing Max/Pro session and API key is NOT forwarded. Opt in only if you want API billing.
CLAUDE_MAX_BUDGET_USDMaximum USD spend per call (pass-through to --max-budget-usd). Only applies when using API key auth.
CLAUDE_QUERY_TOOLSdefault: Read Glob GrepBuilt-in tools the query subprocess may use. Comma or space separated list, 'default' for the CLI's full built-in set, or empty for no tools. The default withholds Bash, Write and Edit; widening it grants real capability in the caller-supplied working directory.
CLAUDE_STRUCTURED_TOOLSdefault: Read Glob GrepBuilt-in tools the structured subprocess may use. Same format and caveats as CLAUDE_QUERY_TOOLS.
CLAUDE_SEARCH_TOOLSdefault: WebSearch WebFetchBuilt-in tools the search subprocess may use. Same format and caveats as CLAUDE_QUERY_TOOLS.
CLAUDE_QUERY_EFFORTReasoning effort for the query tool (low|medium|high|max).
CLAUDE_SEARCH_EFFORTReasoning effort for the search tool (low|medium|high|max).
Readme
claude-mcp-bridge
MCP server that wraps Claude Code CLI as a subprocess, exposing its capabilities as Model Context Protocol tools.
Details
- Repository
- github.com/hampsterx/claude-mcp-bridge
- Category
- Search & Web Crawling
- Package
claude-mcp-bridge- Transport
- STDIO
- Registry
- MCP registry, active