Wraps Claude Code CLI in MCP tools for coding tasks, web research, structured JSON, sessions, and cost-controlled execution.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
This server is confirmed live โ we successfully called its tools/list endpoint directly (see the verified badge above). We haven't yet sandbox-tested the stdio install command below specifically, which is a separate, ongoing check.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Claude MCP Bridge.
queryExecute a prompt via Claude Code CLI with optional file context and session resume. Claude is an AI coding agent that can generate, analyze, refactor, and explain code. Capabilities: code generation and refactoring, code analysis and explanation, file understanding (text and images), multi-turn conversations via sessionId. Cost: Default model is Sonnet (~$0.01-0.10/call). Use effort="low" for simple tasks, effort="high" + model="opus" for complex analysis. Set maxBudgetUsd to cap per-call cost (recommended for effort="max" or model="opus"). Tips: - Set workingDirectory to the target repo for project-aware responses. - Break complex tasks into focused prompts rather than one large request. - Resume multi-turn conversations with sessionId from a previous response's metadata. - Include relevant files via the files parameter for targeted context (text files inlined in prompt, images trigger allowed-tools mode). - Use noSessionPersistence=true for stateless one-shot calls.
structuredGenerate JSON conforming to a provided JSON Schema. Uses Claude CLI's native --json-schema flag for validated output (not client-side validation). Use for: data extraction from text/files, classification, entity parsing, or any task needing machine-parseable output. Cost: Similar to query (~$0.01-0.10/call). Schema complexity doesn't significantly affect cost. Tips: - Pass the JSON Schema as a JSON string in the schema parameter. - Schema max size: 20KB. Keep schemas focused for reliable output. - For extraction tasks, include source text via the files parameter or inline in the prompt.
searchWeb search via Claude Code CLI using WebSearch and WebFetch tools. Searches the web and synthesizes a comprehensive answer with source URLs. Use for: current information, documentation lookups, API references, comparing libraries, and research questions. Cost: Typically ~$0.02-0.05/search with Sonnet. Tips: - Ask specific, focused questions for best results. - Results include source URLs for verification. - Use maxResponseLength to control response verbosity. - Increase timeout for complex research queries that may require multiple web fetches.
listSessionsList active Claude CLI sessions tracked by this server. Returns session metadata (IDs, models, timing, turn counts, cumulative cost) for orchestration. Use to check available sessions before resuming with sessionId. No cost (local lookup only).
pingHealth check: verifies Claude CLI is installed and authenticated, reports versions, capabilities, and configuration. No cost (local check only).
The hampsterx/claude-mcp-bridge MCP server makes Claude Code CLI available as MCP tools. It is intended for MCP clients that need Claude Code capabilities without invoking the CLI directly from a shell. The bridge can handle code generation, analysis, refactoring, explanations, file-based tasks, web research, and machine-readable extraction.
The main query tool sends a prompt to Claude Code and can include text or image files, a working directory, model and effort settings, a session ID, and a per-call budget limit. structured produces JSON against a supplied JSON Schema using Claude Code's native schema option. search uses Claude Code's WebSearch and WebFetch tools, returning a synthesized response with source URLs. ping checks local CLI and authentication state, while listSessions reports tracked session metadata.
The bridge starts Claude Code CLI as a subprocess for each operation. Its MCP responses include execution metadata such as duration, model, session ID, total cost, and token counts. Query and structured calls can continue an earlier conversation by passing the returned session ID. Set noSessionPersistence for one-shot query behavior.
Each tool receives an explicit Claude Code tool set. The default query and structured sets are Read, Glob, and Grep; search defaults to WebSearch and WebFetch. This keeps write, edit, and shell capabilities unavailable unless the configuration is widened. A working directory gives Claude Code project context, and the files parameter supplies targeted text or image context. Images supported by the CLI include PNG, JPG, GIF, WEBP, and BMP files up to 5 MB each.
Install the hampsterx/claude-mcp-bridge MCP server with npx -y claude-mcp-bridge. Claude Code CLI must already be installed and available on PATH, and it must be authenticated. The default authentication path uses claude login with a Claude Pro or Max subscription. API-key authentication is also supported by setting ANTHROPIC_API_KEY and CLAUDE_BRIDGE_USE_API_KEY=1.
Model defaults can be set globally or per tool with variables such as CLAUDE_DEFAULT_MODEL, CLAUDE_QUERY_MODEL, CLAUDE_STRUCTURED_MODEL, and CLAUDE_SEARCH_MODEL. Runtime controls include CLAUDE_MAX_CONCURRENT, CLAUDE_CLI_PATH, and CLAUDE_MAX_BUDGET_USD. Tool access is configured through CLAUDE_QUERY_TOOLS, CLAUDE_STRUCTURED_TOOLS, and CLAUDE_SEARCH_TOOLS. The schema passed to structured must be a JSON string no larger than 20 KB.
query: Run prompts with file context, model and effort selection, session resume, working-directory context, and budget caps.structured: Return schema-conforming JSON for extraction, classification, and entity parsing tasks.search: Research current information, documentation, APIs, and library comparisons with source URLs.listSessions: Inspect active sessions, models, turn counts, timestamps, and cumulative costs.ping: Verify CLI installation, authentication, capabilities, versions, and configuration.Sonnet is the default model, with typical stated costs of roughly $0.01โ$0.10 per call for query or structured work and about $0.02โ$0.05 per search. maxBudgetUsd limits individual calls, and a fallback model can be configured for quota exhaustion. The hampsterx/claude-mcp-bridge MCP server is useful when an MCP client cannot use a shell, needs validated JSON, or must preserve conversations across calls.
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/hampsterx-claude-mcp-bridge)<a href="https://allmcps.com/mcp/hampsterx-claude-mcp-bridge"><img src="https://allmcps.com/api/badge/hampsterx-claude-mcp-bridge?style=directory" alt="Claude MCP Bridge on AllMCPs" /></a>