thebacons/mcp-server-claude-llm
If you are the rightful owner of mcp-server-claude-llm and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This document provides a comprehensive guide to setting up and using an MCP server for accessing Claude LLM models via the Gemini CLI.
claude_sonnet
Model for explaining and creative tasks
claude_opus
Model for detailed analysis and complex tasks
MCP Server for Claude LLM
A Model Context Protocol (MCP) server that provides access to Claude 3.5 Sonnet and Claude 3 Opus models through Gemini CLI.
Features
- š¤ Access to Claude 3.5 Sonnet - Latest and most capable model
- š§ Access to Claude 3 Opus - Powerful model for complex tasks
- š§ Full Gemini CLI integration
- š¦ Easy setup with npm
- š Secure API key handling via environment variables
- ā” CommonJS compatible for wide Node.js support
Prerequisites
- Node.js 18+
- Gemini CLI installed (
npm install -g @google/gemini-cli
) - Anthropic API key from console.anthropic.com
Installation
# Clone the repository
git clone https://github.com/yourusername/mcp-server-claude-llm
cd mcp-server-claude-llm
# Install dependencies
npm install
# Create .env file
echo "ANTHROPIC_API_KEY=your-api-key-here" > .env
Configuration
1. Set up your API key
Create a .env
file in the project root:
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
2. Configure Gemini CLI
Add to your Gemini CLI settings (~/.gemini/settings.json
on macOS/Linux or C:\Users\YOUR_USERNAME\.gemini\settings.json
on Windows):
{
"mcpServers": {
"claude": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-claude-llm/server.js"],
"cwd": "/absolute/path/to/mcp-server-claude-llm",
"timeout": 30000,
"trust": false
}
}
}
Windows example:
{
"mcpServers": {
"claude": {
"command": "node",
"args": ["C:\\path\\to\\mcp-server-claude-llm\\server.js"],
"cwd": "C:\\path\\to\\mcp-server-claude-llm",
"timeout": 30000,
"trust": false
}
}
}
3. Restart Gemini CLI
# Close any running Gemini instances
# Then start fresh
gemini
Usage
Once configured, you can use Claude models directly in Gemini CLI:
Basic Usage
Use claude_sonnet to explain quantum computing in simple terms
Use claude_opus to write a detailed analysis of climate change
Example Commands
# Code assistance
Use claude_sonnet to review this code and suggest improvements
# Creative writing
Use claude_opus to write a short story about AI and humanity
# Technical documentation
Use claude_sonnet to create API documentation for this project
# Data analysis
Use claude_opus to analyze this data and provide insights
Verification
To verify your setup is working:
-
In Gemini CLI, type:
/mcp
You should see:
š¢ claude - Ready (2 tools) - claude_sonnet - claude_opus
-
Test a simple query:
Use claude_sonnet to say hello
Troubleshooting
Server shows as disconnected
- Ensure the paths in
settings.json
are absolute paths - Check that
.env
file exists and contains valid API key - Try running
node server.js
directly to see any errors
Authentication errors
- Verify your API key is valid at console.anthropic.com
- Ensure no extra spaces or quotes in
.env
file - Check API key starts with
sk-ant-api03-
CommonJS errors
- This server uses dynamic imports for ESM compatibility
- Requires Node.js 18 or higher
- If issues persist, check
node --version
Development
Running Tests
# Test environment setup
node test-env.js
# Test API connection
node test-api.js
# Run server directly
node server.js
Project Structure
mcp-server-claude-llm/
āāā server.js # Main MCP server implementation
āāā test-env.js # Environment testing utility
āāā test-api.js # API connection tester
āāā package.json # Dependencies and scripts
āāā .env # API key configuration (not in git)
āāā .gitignore # Git ignore rules
āāā LICENSE # MIT License
āāā README.md # This file
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. Some ideas for improvements:
- Add support for Claude 3 Haiku model
- Implement streaming responses
- Add configuration for model parameters (temperature, max_tokens)
- Token usage tracking and reporting
- Conversation history management
- Rate limiting for API calls
License
MIT License - see file for details
Acknowledgments
- Built for use with Gemini CLI
- Uses Anthropic's Claude API
- Implements Model Context Protocol (MCP)
Author
Created with ā¤ļø for the MCP and Gemini CLI community
Note: This is an unofficial integration. Not affiliated with Anthropic or Google.