Claude MCP Server
A Model Context Protocol (MCP) server that provides a bridge to Anthropic's Claude CLI. It allows MCP-compliant clients like Claude Desktop or Gemini to start new chat sessions or continue existing ones.
README
Claude MCP Server
A Model Context Protocol (MCP) server that provides a bridge to Anthropic's Claude CLI. This allows MCP-compliant clients (like Claude Desktop or Gemini) to interact with the Claude CLI to start new chat sessions or continue existing ones.
Features
- Start New Sessions: Initiate a new conversation with a specific Claude model.
- Continue Sessions: Reply to existing sessions using their Session ID.
- Session Management: Automatically continues the latest session if no Session ID is provided.
- Model Selection: Supports specifying different Claude models (e.g.,
sonnet,opus,haiku). - System Prompt: Native support for custom system prompts.
- Working Directory: Specify custom working directory for CLI execution.
Prerequisites
- Node.js 18+
- Claude CLI installed and authenticated
# Install Claude CLI
npm install -g @anthropic-ai/claude-code
# Authenticate
claude setup-token
Installation
Global Installation
npm install -g @2lab.ai/claude-mcp-server
Run directly with npx
npx @2lab.ai/claude-mcp-server
Usage
Running the server
After global installation:
claude-mcp-server
Or with npx:
npx @2lab.ai/claude-mcp-server
Testing with MCP Inspector
You can test and debug the server using the MCP Inspector:
npx @modelcontextprotocol/inspector npx @2lab.ai/claude-mcp-server
Or if globally installed:
npx @modelcontextprotocol/inspector claude-mcp-server
Claude Desktop Configuration
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"claude-cli": {
"command": "npx",
"args": ["-y", "@2lab.ai/claude-mcp-server"]
}
}
}
Or if globally installed:
{
"mcpServers": {
"claude-cli": {
"command": "claude-mcp-server"
}
}
}
Claude Code Configuration
Add to your Claude Code settings:
{
"mcpServers": {
"claude-cli": {
"command": "npx",
"args": ["-y", "@2lab.ai/claude-mcp-server"]
}
}
}
Available Tools
chat
Start a new Claude session with a prompt.
Parameters:
prompt(required): The prompt to start the session withmodel(optional): The model to use (e.g., 'sonnet', 'opus', 'haiku')systemPrompt(optional): System prompt to set the assistant's behaviorcwd(optional): Working directory for the claude CLI execution
Returns: Response text and new Session ID in _meta.sessionId
chat-reply
Continue an existing Claude session.
Parameters:
prompt(required): The prompt to continue the conversationsessionId(optional): The session ID to continue. If not provided, continues the most recent sessionmodel(optional): The model to use for this turnsystemPrompt(optional): Additional system prompt to append for this turncwd(optional): Working directory for the claude CLI execution
Returns: Response text and Session ID in _meta.sessionId
Development
# Clone the repository
git clone https://github.com/2lab-ai/claude-mcp-server.git
cd claude-mcp-server
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Run locally
npm start
# Test with MCP Inspector
npm run inspect
CI/CD
This project uses GitHub Actions to automatically publish to npm when changes are pushed to the main branch.
To enable automatic publishing:
- Generate an npm access token from npmjs.com
- Add the token as a secret named
NPM_TOKENin your GitHub repository settings - Bump the version in
package.jsonbefore pushing to trigger a publish
License
ISC
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.