claude-mcp

vulkanfry/claude-mcp

3.2

If you are the rightful owner of claude-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Claude MCP Server integrates Claude CLI with MCP-compatible applications, enabling seamless interaction with various Claude models.

Tools
5
Resources
0
Prompts
0

Claude MCP Server

MCP (Model Context Protocol) server for integrating Claude CLI with Cursor and other MCP-compatible applications. Enables calling different Claude models (Sonnet, Opus, Haiku) through convenient tools.

Features

  • 🎯 Multiple Models: Support for Sonnet, Opus, and Haiku
  • 🔄 Model Comparison: Get responses from multiple models simultaneously
  • 📊 JSON Responses: Structured responses with metadata
  • 🎭 System Prompts: Specialize model behavior with custom system prompts
  • 📦 Batch Processing: Process multiple prompts sequentially
  • 💬 Conversation Continuity: Continue previous conversations with context
  • 🛡️ Fallback Support: Automatic fallback to backup models
  • Quick Integration: Simple setup in Cursor
  • 🔧 11 Powerful Tools: Comprehensive set of tools for various use cases

Requirements

  • Node.js 18+
  • Installed Claude CLI (claude command in PATH)
  • Cursor or another MCP-compatible application

Installation

  1. Clone the repository or create a folder:
mkdir claude-mcp
cd claude-mcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

The project will be built in the dist/ folder.

Setup in Cursor

macOS

  1. Open the MCP configuration file:

    ~/.cursor/mcp.json
    

    Or through Finder: Cmd+Shift+G~/.cursor/mcp.json

  2. Add the server configuration:

{
  "mcpServers": {
    "claude": {
      "command": "node",
      "args": ["/Users/your_username/mcp/claude/dist/index.js"]
    }
  }
}

Important: Replace /Users/your_username/mcp/claude with the full path to your project folder.

Windows

  1. Open the configuration file:

    %APPDATA%\Cursor\mcp.json
    
  2. Add the configuration:

{
  "mcpServers": {
    "claude": {
      "command": "node",
      "args": ["C:\\path\\to\\project\\claude-mcp\\dist\\index.js"]
    }
  }
}

Linux

  1. Open the file:

    ~/.config/cursor/mcp.json
    
  2. Add the configuration:

{
  "mcpServers": {
    "claude": {
      "command": "node",
      "args": ["/home/your_username/mcp/claude/dist/index.js"]
    }
  }
}

Alternative Option (for TypeScript Development)

If you want to use the source TypeScript without building:

{
  "mcpServers": {
    "claude": {
      "command": "npx",
      "args": ["tsx", "/full/path/to/claude/src/index.ts"]
    }
  }
}

After Setup

  1. Restart Cursor completely (close and reopen)
  2. Tools will be automatically available

Available Tools

1. claude_call - Universal Claude Call

Basic tool with model selection capability.

Parameters:

  • prompt (string, required) - Prompt to send
  • model (string, optional) - Model: "sonnet", "opus", "haiku" or full model name

Example:

claude_call({
  prompt: "Explain what TypeScript is",
  model: "sonnet",
});

2. claude_sonnet - Claude Sonnet

Quick access to Sonnet model.

Parameters:

  • prompt (string) - Prompt

3. claude_opus - Claude Opus

Quick access to Opus model (most powerful).

Parameters:

  • prompt (string) - Prompt

4. claude_haiku - Claude Haiku

Quick access to Haiku model (fastest).

Parameters:

  • prompt (string) - Prompt

5. claude_json - JSON Format Response

Returns structured JSON with metadata (execution time, tokens, cost, etc.).

Parameters:

  • prompt (string) - Prompt
  • model (string, optional) - Model

Example Response:

{
  "result": {
    "type": "result",
    "result": "Response text",
    "duration_ms": 3509,
    "usage": {
      "input_tokens": 2,
      "output_tokens": 57
    },
    "total_cost_usd": 0.07092975
  },
  "success": true
}

6. claude_with_system_prompt - With System Prompt

Allows setting a system prompt to specialize model behavior.

Parameters:

  • prompt (string) - User prompt
  • systemPrompt (string) - System prompt (model role)
  • model (string, optional) - Model

Example:

claude_with_system_prompt({
  prompt: "How can I improve this code?",
  systemPrompt:
    "You are a TypeScript and clean code expert. Answer briefly and to the point.",
  model: "sonnet",
});

7. claude_compare_models - Compare Models

Simultaneously gets responses from multiple models for comparison.

Parameters:

  • prompt (string) - Prompt
  • models (array) - Array of models: ["sonnet", "opus", "haiku"]

Example:

claude_compare_models({
  prompt: "What is async/await?",
  models: ["sonnet", "haiku"],
});

Response:

{
  "results": {
    "sonnet": {
      "result": "Sonnet response...",
      "success": true
    },
    "haiku": {
      "result": "Haiku response...",
      "success": true
    }
  },
  "success": true
}

8. claude_batch - Batch Processing

Processes multiple prompts sequentially and returns all responses.

Parameters:

  • prompts (array) - Array of prompts to process
  • model (string, optional) - Model to use for all prompts

Example:

claude_batch({
  prompts: ["What is TypeScript?", "What is React?", "What is Node.js?"],
  model: "sonnet",
});

Response:

{
  "results": [
    {
      "prompt": "What is TypeScript?",
      "result": "TypeScript is...",
      "success": true
    },
    {
      "prompt": "What is React?",
      "result": "React is...",
      "success": true
    }
  ],
  "success": true
}

9. claude_continue - Continue Conversation

Continues the most recent Claude conversation with a new message.

Parameters:

  • prompt (string) - New message to continue the conversation
  • model (string, optional) - Model

Example:

claude_continue({
  prompt: "Tell me more about that",
  model: "sonnet",
});

Note: This tool uses --continue flag and maintains context from the previous conversation.

10. claude_with_fallback - With Fallback Model

Calls Claude with a fallback model that activates when the primary model is overloaded.

Parameters:

  • prompt (string) - Prompt to send
  • model (string) - Primary model
  • fallbackModel (string) - Fallback model to use if primary is overloaded

Example:

claude_with_fallback({
  prompt: "Explain async/await",
  model: "sonnet",
  fallbackModel: "haiku",
});

11. claude_append_system_prompt - Append System Prompt

Calls Claude and appends additional context to the default system prompt (doesn't replace, adds to it).

Parameters:

  • prompt (string) - User prompt
  • appendSystemPrompt (string) - Additional context to append to system prompt
  • model (string, optional) - Model

Example:

claude_append_system_prompt({
  prompt: "Explain async/await",
  appendSystemPrompt: "Answer in one sentence",
  model: "haiku",
});

Note: Unlike claude_with_system_prompt, this appends to the default system prompt rather than replacing it.

Usage Examples

Comparing Different Model Responses

Use claude_compare_models when you need different perspectives:

claude_compare_models({
  prompt: "What are the advantages of TypeScript?",
  models: ["sonnet", "opus", "haiku"]
})

Specialized Responses

Use claude_with_system_prompt for role-based scenarios:

claude_with_system_prompt({
  prompt: "Review this code for errors",
  systemPrompt: "You are an experienced code reviewer. Find bugs and provide constructive criticism.",
  model: "sonnet"
})

Structured Data

Use claude_json to get metadata:

claude_json({
  prompt: "What is React?",
  model: "sonnet"
})

Useful for:

  • Analyzing execution time
  • Tracking request costs
  • Token usage statistics

Batch Processing

Use claude_batch to process multiple prompts at once:

claude_batch({
  prompts: [
    "What is TypeScript?",
    "What are its advantages?",
    "How to get started?"
  ],
  model: "sonnet"
})

Continuing Conversations

Use claude_continue to maintain context across multiple messages:

// First message
claude_call({
  prompt: "My name is John",
  model: "sonnet"
})

// Continue the conversation
claude_continue({
  prompt: "What's my name?",
  model: "sonnet"
})

Reliable Requests

Use claude_with_fallback for critical requests that need guaranteed completion:

claude_with_fallback({
  prompt: "Important analysis task",
  model: "sonnet",
  fallbackModel: "haiku"
})

Adding Context

Use claude_append_system_prompt to add context without replacing defaults:

claude_append_system_prompt({
  prompt: "Review this code",
  appendSystemPrompt: "Focus on security issues",
  model: "sonnet"
})

Development

Running in Development Mode

npm run dev

Building

npm run build

Project Structure

claude-mcp/
├── src/
│   └── index.ts      # Main server code
├── dist/             # Compiled code
├── package.json
├── tsconfig.json
└── README.md

Troubleshooting

Server Not Starting

  1. Check that the path to dist/index.js is correct
  2. Make sure you ran npm run build
  3. Verify Node.js is installed: node --version

Tools Not Appearing in Cursor

  1. Completely restart Cursor (not just reload)
  2. Check Cursor logs for errors
  3. Ensure the configuration in mcp.json is valid (check JSON syntax)

Error "command not found: claude"

Make sure Claude CLI is installed and available in PATH:

claude --version

If the command is not found, install Claude CLI according to the official documentation.

TypeScript Build Errors

# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install
npm run build

License

MIT

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

Author

Created for integrating Claude CLI with the MCP ecosystem.