hampsterx avatar

Claude Mcp Bridge

hampsterx/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 tools

Public 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: claude

Path to the claude CLI binary. Defaults to 'claude' on PATH.

CLAUDE_DEFAULT_MODEL

Shared default model for all tools. Overridden by per-tool CLAUDE_<TOOL>_MODEL vars (QUERY, SEARCH, STRUCTURED).

CLAUDE_QUERY_MODELdefault: sonnet

Override model for the query tool.

CLAUDE_STRUCTURED_MODELdefault: sonnet

Override model for the structured tool.

CLAUDE_SEARCH_MODELdefault: sonnet

Override model for the search tool.

CLAUDE_FALLBACK_MODELdefault: haiku

Model to use when the primary model hits a quota error. Set to 'none' to disable fallback.

CLAUDE_MAX_CONCURRENTdefault: 3

Maximum concurrent Claude CLI subprocesses (default 3).

CLAUDE_BRIDGE_USE_API_KEYdefault: 0

Set 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_USD

Maximum USD spend per call (pass-through to --max-budget-usd). Only applies when using API key auth.

CLAUDE_QUERY_TOOLSdefault: Read Glob Grep

Built-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 Grep

Built-in tools the structured subprocess may use. Same format and caveats as CLAUDE_QUERY_TOOLS.

CLAUDE_SEARCH_TOOLSdefault: WebSearch WebFetch

Built-in tools the search subprocess may use. Same format and caveats as CLAUDE_QUERY_TOOLS.

CLAUDE_QUERY_EFFORT

Reasoning effort for the query tool (low|medium|high|max).

CLAUDE_SEARCH_EFFORT

Reasoning effort for the search tool (low|medium|high|max).

Readme

claude-mcp-bridge

npm version npm downloads CI License: MIT Node.js TypeScript MCP Available on CodeGuilds

MCP server that wraps Claude Code CLI as a subprocess, exposing its capabilities as Model Context Protocol tools.


View the full README on GitHub

Details

Repository
github.com/hampsterx/claude-mcp-bridge
Category
Search & Web Crawling
Package
claude-mcp-bridge
Transport
STDIO
Registry
MCP registry, active

More from hampsterx

Related Search & Web Crawling MCP servers

View all
1darrenjrobinson avatarEntra Newsdarrenjrobinson/entranewsmcpserverSearch the Entra.news newsletter archive — a weekly digest of Microsoft Entra news7stars
2jasondostal avatarCairnjasondostal/cairn-mcpPersistent memory for AI agents and humans. Store, search, and discover patterns.7stars
3louis49 avatarMelchizedeklouis49/melchizedekPersistent memory for Claude Code — offline, single-file, hybrid search.7stars
4sweir1 avatarObsidian Brainsweir1/obsidian-brainObsidian MCP server: semantic search, knowledge graph, and vault editing. No plugin required.7stars
5xplo8e avatarHackTricks MCP Serverxplo8e/hacktricks-mcp-serverSearch and query HackTricks pentesting documentation with quick lookup and section extraction7stars
6aadilr avatarChangeThisFileaadilr/changethisfile-mcp1,000+ conversion routes plus translate, extract tables, compress. 25 free/month, then a free key.6stars