Claude Code MCP server

Use Claude Code with less capable LLMs.
Back to servers
Provider
Kunihiro Setogawa
Release date
Mar 14, 2025
Language
TypeScript
Package
Stats
493 downloads
13 stars

Claude Code MCP Server is a Node.js-based server that interfaces with the locally installed Claude Code command line tool, allowing you to use Claude's code capabilities through the Model Context Protocol (MCP). It provides tools like code explanation, review, fixing, editing, testing, and custom queries, and can be used from various MCP hosts including Claude Desktop.

Installation

Prerequisites

Installation Methods

Method 1: Using npx (Recommended)

Run the server directly without installation:

npx @kunihiros/claude-code-mcp

Method 2: Global Installation

Install the package globally:

npm install -g claude-code-mcp

Then run it as a command:

claude-code-mcp

Method 3: Local Installation

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

Run the built script:

node build/index.js

Configuration

Environment Variables

You need to configure the environment variables using one of these methods:

  1. MCP Host Settings (Recommended for npx)
  2. Using a .env file in the directory where you run the command
  3. Using a global config file at ~/.claude-code-mcp.env

If using a file, add:

# .env or ~/.claude-code-mcp.env
CLAUDE_BIN=/path/to/your/claude/executable  # REQUIRED
LOG_LEVEL=info                              # Optional

MCP Host Configuration

For npx (Recommended):

Add the following to your MCP Host application settings:

"claude-code-server": {
  "command": "npx",
  "args": [
    "-y",
    "@kunihiros/claude-code-mcp"
  ],
  "env": {
    "CLAUDE_BIN": "/path/to/your/claude/executable",
    "LOG_LEVEL": "info"
  },
  "disabled": false
}

For Global Installation:

"claude-code-server": {
  "command": "claude-code-mcp",
  "disabled": false
}

In this case, you must configure environment variables using a .env file or the global config file.

Available Tools

The server provides these tools:

  • explain_code: Provides detailed explanation of code
  • review_code: Reviews the given code
  • fix_code: Fixes bugs or issues in code
  • edit_code: Edits code based on instructions
  • test_code: Generates tests for code
  • simulate_command: Simulates execution of a command
  • your_own_query: Sends a custom query with context

Notes

  • Log file (claude-code-mcp.log) is created in the project root, user's home directory, or /tmp/
  • No log rotation implemented yet
  • Primarily tested with Claude CLI on Ubuntu/WSL2

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later