Claude Code
About
claude-code-mcp is an MCP server that calls the locally installed Claude Code CLI and provides tools for code explanation, review, fixing, editing, testing, command simulation, and custom queries. It communicates via stdio and uses Base64 encoding to handle special characters in…
Details
- Author
- kunihiros
- Repository
- KunihiroS/claude-code-mcp
- GitHub stars
- 12
- Downloads
- 666
- License
- MIT License
- Categories
- AI, Developer Tools, Search, Infrastructure, Project Management
Jump to
- Provides seven tools: explain_code, review_code, fix_code, edit_code, test_code, simulate_command, and your_own_query
- Base64 encodes natural language input for stable processing
- Communicates via stdio using JSON‑formatted requests and responses
- Configurable log level (debug, info, warn, error)
- Supports running from MCP hosts like Claude Desktop (unconfirmed)
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Claude CodeCommand (node, npx, python, etc.)npxArguments-
Argument 1
-y -
Argument 2
@kunihiros/claude-code-mcp
Environment-
LOG_LEVEL
info -
CLAUDE_BIN
/path/to/your/claude/executable
Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
-
Argument 1
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Environment Variables:
Regardless of the installation method, you need to configure the environment variables. Create one of the following files:
1. Using MCP Host Settings (Recommended for npx): Configure environment variables directly within your MCP Host's settings (see "MCP Host Configuration" below). This is the easiest way when using npx.
2. Using a .env file: Create a .env file in the directory where you run the npx @kunihiros/claude-code-mcp command.
3. Using a global config file: Create a .claude-code-mcp.env file in your home directory (~/.claude-code-mcp.env).
If using a file (.env or ~/.claude-code-mcp.env), add the following content, adjusting the CLAUDE_BIN path:
There are several ways to use claude-code-mcp:
1. Using npx (Recommended for quick use)
You can run the server directly without installation using npx:
bashnpx @kunihiros/claude-code-mcp
2. Global Installation
Install the package globally:
bashnpm install -g claude-code-mcp
Then, you can run it as a command:
bashclaude-code-mcp
3. Local Installation (For development)
Clone the repository and install dependencies:
bashgit 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:
bashnode build/index.js
``
This server uses the following environment variables (set via MCP Host
env settings, .env, or ~/.claude-code-mcp.env):
-
CLAUDE_BIN: Specifies the path to the Claude CLI executable. (Required)
Example: /home/linuxbrew/.linuxbrew/bin/claude or C:\Users\YourUser\AppData\Local\bin\claude.exe
- LOG_LEVEL: Specifies the log level. (Optional, defaults to info). Possible values: debug, info, warn, error`.explain_code
Provides a detailed explanation of the given code.
review_code
Reviews the given code.
fix_code
Fixes bugs or issues in the given code.
edit_code
Edits the given code based on instructions.
test_code
Generates tests for the given code.
simulate_command
Simulates the execution of a given command.
your_own_query
Sends a custom query with context.
The claude-code-mcp server provides the following tools:
- explain_code: Provides a detailed explanation of the given code.
- review_code: Reviews the given code.
- fix_code: Fixes bugs or issues in the given code.
- edit_code: Edits the given code based on instructions.
- test_code: Generates tests for the given code.
- simulate_command: Simulates the execution of a given command.
- your_own_query: Sends a custom query with context.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"claude code": {
"env": {
"LOG_LEVEL": "info",
"CLAUDE_BIN": "/path/to/your/claude/executable"
},
"args": [
"-y",
"@kunihiros/claude-code-mcp"
],
"command": "npx"
}
}
}
Linux
{
"env": {
"LOG_LEVEL": "info",
"CLAUDE_BIN": "/path/to/your/claude/executable"
},
"args": [
"-y",
"@kunihiros/claude-code-mcp"
],
"command": "npx"
}
Macos
{
"env": {
"LOG_LEVEL": "info",
"CLAUDE_BIN": "/path/to/your/claude/executable"
},
"args": [
"-y",
"@kunihiros/claude-code-mcp"
],
"command": "npx"
}
Windows
{
"env": {
"LOG_LEVEL": "info",
"CLAUDE_BIN": "/path/to/your/claude/executable"
},
"args": [
"/c",
"npx",
"-y",
"@kunihiros/claude-code-mcp"
],
"command": "cmd"
}
claude-code-mcp Project
[0.1.9] - 2026-03-06
Security Update
- Add pnpm overrides to pin transitive dependencies to patched versions. -hono ^4.12.4 (fixes serveStatic path traversal, SSE CRLF injection, Cookie attribute injection, basicAuth/bearerAuth timing)
- @hono/node-server >=1.19.10 (fixes authorization bypass via encoded slashes)
- ajv >=8.18.0 (fixes ReDoS with $data option)
- qs >=6.14.2 (fixes DoS via arrayLimit bypass)
[0.1.8] - 2026-02-05
Security Update
- Update @modelcontextprotocol/sdk version. - Add zod dependency to satisfy peer dependency requirements. - Bump TypeScript version for compatibility with updated dependencies.Overview
The claude-code-mcp project is an MCP server for Claude Code.
It calls the locally installed Claude Code command and provides the following tools: explain_code, review_code, fix_code, edit_code, test_code, simulate_command, and your_own_query. The server is implemented using Node.js and the MCP SDK, receiving JSON format requests from clients via stdio. Internally, it adopts Base64 encoding to smoothly process special characters (newlines, quotation marks, etc.) in natural language text, resulting in improved stability and flexibility. Its main roles are receiving requests, encoding input, generating and executing commands, and returning execution results in JSON format.
This project has been confirmed to work in Claude Code CLI environments (Ubuntu/WSL2, etc.).
<a href="https://glama.ai/mcp/servers/@KunihiroS/claude-code-mcp">
</a>
💡
MCP Host with less capable LLM, can tame and make use of Claude power💪!
With claude-code-mcp, you can also call Claude Code from Claude Desktop!! 😇😜😎 (unconfirmed)
Functions
The main roles of the server are:
- Request Reception: Receive JSON format tool requests from clients (e.g. code, context, focus_areas, etc.).
- Input Processing: Internally Base64 encode the received natural language text.
- Tool Selection and Command Generation: Based on the tool name in the request, assemble a command string for the query using a fixed template or free format (your_own_query).
- Command Execution: Use Node.js's child_process.spawn to execute the assembled command and get the result from standard output.
- Result Return: Return the execution result to the client in JSON format.
Getting Started
Prerequisites
- Node.js (>= v18 recommended, tested with v22.14.0)
- npm (or yarn)
- Claude Code command installed and auth completed.
https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview
Installation & Usage
There are several ways to use claude-code-mcp:
1. Using npx (Recommended for quick use)
You can run the server directly without installation using npx:
npx @kunihiros/claude-code-mcp
2. Global Installation
Install the package globally:
npm install -g claude-code-mcp
Then, you can run it as a command:
claude-code-mcp
3. Local Installation (For development)
Clone the repository and install dependencies:
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
Configuration
Environment Variables:
Regardless of the installation method, you need to configure the environment variables. Create one of the following files:
1. Using MCP Host Settings (Recommended for npx): Configure environment variables directly within your MCP Host's settings (see "MCP Host Configuration" below). This is the easiest way when using npx.
2. Using a .env file: Create a .env file in the directory where you run the npx @kunihiros/claude-code-mcp command.
3. Using a global config file: Create a .claude-code-mcp.env file in your home directory (~/.claude-code-mcp.env).
If using a file (.env or ~/.claude-code-mcp.env), add the following content, adjusting the CLAUDE_BIN path:
```dotenv
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




