claude-code
Claude Code as one-shot MCP server to have an agent in your agent.
claude mcp add --transport stdio steipete-claude-code-mcp npx -y @steipete/claude-code-mcp@latest \ --env CLAUDE_CLI_NAME="Override the Claude CLI binary name or provide an absolute path (default: claude)" \ --env MCP_CLAUDE_DEBUG="Enable verbose debug logging (true/false)"
How to use
This MCP server exposes a single tool named claude_code that lets an LLM drive Claude Code in one-shot mode with permissions bypass enabled. The server runs Claude Code via the CLI with the --dangerously-skip-permissions flag, allowing prompts to execute without interactive permission prompts. Tools provided through Claude Code include file editing, code generation, refactoring, and filesystem operations, all performed by Claude Code rather than the host model. You can queue multiple Claude Code actions in a single session to optimize context usage and reduce prompt size for subsequent steps. To use it, configure your MCP client (e.g., Cursor or Windsurf) to point at the claude_code tool and send requests with a prompt and optional tool selections to enable specific Claude capabilities.
How to install
Prerequisites:
- Node.js v20 or later
- npm (comes with Node.js)
- Claude CLI installed locally and accepted permissions (see Important First-Time Setup below)
Step 1: Install the MCP server via npx
# This installs and runs the latest claude-code-mcp server via npx
npx -y @steipete/claude-code-mcp@latest
Step 2: Ensure Claude CLI is installed and permissions accepted
npm install -g @anthropic-ai/claude-code
claude --dangerously-skip-permissions
Follow the prompts to login and accept terms. This must be done once for the CLI to be usable by the MCP server.
Step 3: Run the MCP server (alternative if you want to customize command/args)
{
"claude-code-mcp": {
"command": "npx",
"args": ["-y", "@steipete/claude-code-mcp@latest"]
}
}
Step 4: Configure your MCP client configuration file (e.g., mcp.json or mcp_config.json) to point to the claude_code tool provided by this server. See the client documentation for the exact field names.
Additional notes
Environment variables:
- CLAUDE_CLI_NAME: Override the Claude CLI binary name or provide an absolute path. If set to a simple name, the server will search your system PATH for the binary before falling back to the default claude command.
- MCP_CLAUDE_DEBUG: Enable verbose logging for debugging the Claude Code integration. Common issues:
- Permissions prompts failing on first run: ensure you have run claude --dangerously-skip-permissions manually and completed the prompts.
- If the CLAUDE_CLI_NAME points to a non-existent binary, the MCP server will fail to start the Claude Code tool; ensure the path or name is correct.
- If using different environments (macOS, Windows, Linux), ensure the Claude CLI binary is in PATH or correctly referenced by CLAUDE_CLI_NAME. Tip: For cost efficiency, leverage Claude Code’s directed tool usage (tools option) to enable only the necessary capabilities per task. You can also queue multiple operations to minimize re-invocation overhead.
Related MCP Servers
better-chatbot
Just a Better Chatbot. Powered by Agent & MCP & Workflows.
building-an-agentic-system
An in-depth book and reference on building agentic systems like Claude Code
mcp-screenshot-website-fast
Quickly screenshots webpages and converts to an LLM friendly size
mcp-arr
MCP server for *arr media management suite
rtfmbro
rtfmbro provides always-up-to-date, version-specific package documentation as context for coding agents. An alternative to context7
dockashell
DockaShell is an MCP server that gives AI agents isolated Docker containers to work in. MCP tools for shell access, file operations, and full audit trail.