The Claude Code MCP Server is a specialized tool that allows running Claude Code in one-shot mode with automatically bypassed permissions. It provides a streamlined interface for Claude AI models to directly execute code editing tasks, file operations, and other system commands without permission interruptions.
The simplest way to install and use the server is via npx
:
{
"claude-code-mcp": {
"command": "npx",
"args": [
"-y",
"@steipete/claude-code-mcp@latest"
]
}
}
If you need to use a custom Claude CLI binary, specify it with an environment variable:
{
"claude-code-mcp": {
"command": "npx",
"args": [
"-y",
"@steipete/claude-code-mcp@latest"
],
"env": {
"CLAUDE_CLI_NAME": "claude-custom"
}
}
}
Before using the MCP server, you must run the Claude CLI manually once with the skip permissions flag:
npm install -g @anthropic-ai/claude-code
claude --dangerously-skip-permissions
Follow the prompts to accept the terms. This is a one-time requirement that enables the MCP server to use the flag non-interactively afterward.
Note: macOS might request folder permissions the first time the tool runs. The first run may fail, but subsequent runs should work correctly.
CLAUDE_CLI_NAME
: Override the Claude CLI binary name or provide an absolute path (default: claude
)MCP_CLAUDE_DEBUG
: Enable debug logging (set to true
for verbose output)Cursor uses mcp.json
:
~/.cursor/mcp.json
%APPDATA%\\Cursor\\mcp.json
~/.config/cursor/mcp.json
Windsurf uses mcp_config.json
:
~/.codeium/windsurf/mcp_config.json
%APPDATA%\\Codeium\\windsurf\\mcp_config.json
~/.config/.codeium/windsurf/mcp_config.json
The MCP server provides one main tool:
Executes prompts directly using the Claude Code CLI with permissions bypassed.
Arguments:
prompt
(string, required): The prompt to send to Claude Codeoptions
(object, optional):
tools
(array of strings, optional): Specific Claude tools to enableExample MCP Request:
{
"toolName": "claude_code:claude_code",
"arguments": {
"prompt": "Refactor the function foo in main.py to be async."
}
}
"Generate a Python script to parse CSV data and output JSON."
"Analyze my_script.py for potential bugs and suggest improvements."
"Your work folder is /Users/username/my_project
Create a new file named 'config.yml' in the 'app/settings' directory with the following content:
port: 8080
database: main_db"
"Your work folder is /Users/username/my_project
1. Stage the file 'src/main.java'.
2. Commit the changes with the message 'feat: Implement user authentication'.
3. Push the commit to the 'develop' branch on origin."
"Your work folder is /Users/username/my_project/frontend
Run the command 'npm run build'."
"Your work folder is /Users/username/my_project
Follow these steps:
1. Update the version in package.json to 2.5.0.
2. Add a new section to CHANGELOG.md for version 2.5.0 with the heading '### Added' and list 'New feature X'.
3. Stage package.json and CHANGELOG.md.
4. Commit with message 'release: version 2.5.0'.
5. Push the commit.
6. Create and push a git tag v2.5.0."
IMPORTANT: Always include the current working directory context in your prompts for file system or git operations (e.g., "Your work folder is /path/to/project").
npx
claude/doctor
MCP_CLAUDE_DEBUG
is true
, try setting it to false
for normal operationTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "claude-code-mcp" '{"command":"npx","args":["-y","@steipete/claude-code-mcp@latest"]}'
See the official Claude Code MCP documentation for more details.
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.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"claude-code-mcp": {
"command": "npx",
"args": [
"-y",
"@steipete/claude-code-mcp@latest"
]
}
}
}
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.
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"claude-code-mcp": {
"command": "npx",
"args": [
"-y",
"@steipete/claude-code-mcp@latest"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect