claude-code
MCP Server connects with claude code local command.
claude mcp add --transport stdio kunihiros-claude-code-mcp npx -y @kunihiros/claude-code-mcp \ --env LOG_LEVEL="info" \ --env CLAUDE_BIN="/path/to/your/claude/executable"
How to use
The claude-code-mcp MCP server wraps the Claude Code CLI and exposes a set of tooling actions that you can request via JSON over stdio. It accepts requests to run tools such as explain_code, review_code, fix_code, edit_code, test_code, simulate_command, and your_own_query. Internally it Base64-encodes input to reliably handle newlines and special characters, constructs a command from the requested tool, executes it with Node.js child_process.spawn, and returns the results in JSON. To use it, run the server through npx (or your preferred installation method) and connect a client that sends the appropriate tool name and input payload; the server will respond with the execution output and any results or errors.
How to install
Prerequisites:
- Node.js (>= v18 recommended)
- npm (or yarn)
- Claude Code command installed and authenticated
Installation options:
- Using npx (recommended for quick use)
npx @kunihiros/claude-code-mcp
- Global installation
npm install -g claude-code-mcp
Then, run the server as a command:
claude-code-mcp
- Local installation (development)
git clone https://github.com/KunihiroS/claude-code-mcp.git
cd claude-code-mcp/claude-code-server
npm install
npm run build
You can then run the built script directly:
node build/index.js
Additional notes
Environment variables can be provided via MCP Host settings (recommended for npx), a .env file, or a global ~/.claude-code-mcp.env file. Required CLAUDE_BIN should point to your Claude CLI executable. LOG_LEVEL is optional (defaults to info). The server writes to claude-code-mcp.log with a fallback order if writing to the project root fails. Ensure Claude Code CLI is installed and authenticated on the host where you run the MCP server. If you use the npx method, you may configure env vars in the MCP host configuration payload as shown in the README example.
Related MCP Servers
mcp-arr
MCP server for *arr media management suite
diy-tools
An MCP server that allows users to dynamically add custom tools/functions at runtime
docmole
Dig through any documentation with AI - MCP server for Claude, Cursor, and other AI assistants
create -kit
Scaffold a production-ready Model Context Protocol (MCP) server in seconds.
web-developer
A Model Context Protocol (MCP) server that provides web development tools for AI assistants. Enables browser automation, DOM inspection, network monitoring, and console analysis through Playwright.
RN-upgrade-helper
A Model Context Protocol (MCP) server that automates the React Native Upgrade Helper website to extract upgrade information between React Native versions.