Claude MCP Bridge logo

Claude MCP Bridge

by hampsterx

Wraps Claude Code CLI in MCP tools for coding tasks, web research, structured JSON, sessions, and cost-controlled execution.

Install Claude MCP Bridge

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "hampsterx-claude-mcp-bridge": {
      "command": "npx",
      "args": [
        "-y",
        "claude-mcp-bridge"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 5 tools correctly (1mo ago).

Overview

The hampsterx/claude-mcp-bridge MCP server exposes Claude Code CLI through MCP tools for prompts, web search, schema-validated JSON, session management, and health checks. It runs Claude Code as a subprocess, supports subscription authentication by default, and can optionally forward an Anthropic API key. Use it when an MCP client lacks shell access or when you need session resume, structured output, tool sandboxing, or cost metadata. Set the working directory and file context to give coding tasks access to the relevant project material.

Use cases

  • Analyze and refactor files in a target repository
  • Extract structured entities from text or files
  • Research documentation and API references with cited sources
  • Resume multi-turn coding conversations
  • Limit per-call model spending

Key features

  • Claude Code CLI exposed through MCP
  • Schema-validated JSON output
  • Session resume and session metadata
  • Web search with source URLs
  • Per-call budgets and cost metadata
  • Configurable tool sandboxing

Tools5

What Claude MCP Bridge lets your agent do. Expand a tool for its parameters.

Verified live~1.5k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 3d ago

Recent health check succeeded.

18/18 checks healthy over the last 78d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 9d ago via OSV.dev · claude-mcp-bridge (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars7Stargazers on the source repository.
npm downloads784Package downloads in the last 30 days.
Last commit10d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed5Callable tools this server registers over MCP.
Directory activity8 viewsConfig copies, upvotes, and views on AllMCPs.

How Claude MCP Bridge works

What the hampsterx/claude-mcp-bridge MCP server does

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.

How it works

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.

Setup and configuration

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.

Tools and capabilities

  • 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.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Claude MCP Bridge

Run `npx -y claude-mcp-bridge`. Claude Code CLI must also be installed and available on PATH.

Its configuration examples specifically show other MCP clients.

Subscription authentication is the default and uses `claude login`. API-key authentication requires `ANTHROPIC_API_KEY` together with `CLAUDE_BRIDGE_USE_API_KEY=1`.

Yes. Pass a session ID returned by an earlier response to `query` or `structured`; `listSessions` can show tracked session metadata.

Use the `maxBudgetUsd` parameter for a call or configure `CLAUDE_MAX_BUDGET_USD` as a global per-call cap.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewClaude MCP Bridge AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/hampsterx-claude-mcp-bridge?style=directory)](https://allmcps.com/mcp/hampsterx-claude-mcp-bridge)
HTML Embed
<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>