The Claude Code MCP server enables AI-powered software engineering tasks through a standardized Model Context Protocol interface, providing various tools for code analysis, file operations, and system interactions including:
Execute shell commands with security restrictions using the
bash
toolRead and edit files using
readFile
andeditFile
toolsList and search files with
listFiles
,searchGlob
, andgrep
toolsAnalyze and review code using the
codeReview
toolThink through complex problems using the
think
toolAccess file contents, directory listings, and system environment information as resources
Utilize predefined prompts for tasks like CLI interaction, code review, PR review, and codebase initialization
Provides capabilities for code review and project exploration, which likely involves Git integration
Server can be run using Node.js and provides environment information including Node.js version
Provides environment information including npm version
Implements tools for executing shell commands with security restrictions
Implementation uses TypeScript with full type safety
Uses Zod schemas for MCP tool argument validation
Claude Code MCP
Claude Code MCP is an implementation of Claude Code as a Model Context Protocol (MCP) server. This project allows you to use Claude Code's powerful software engineering capabilities through the standardized MCP interface.
⚠️ DISCLAIMER ⚠️
Claude Code MCP is a auto-generated project by DevinAI, who was prompted to analyse the Claude Code codebase, and generate an MCP server.
This is a proof of concept that I don't advise anyone to use.
What is Claude Code?
Claude Code is Anthropic's CLI tool for software engineering tasks, powered by Claude. It provides a set of tools and capabilities that help developers with:
Code generation and editing
Code review and analysis
Debugging and troubleshooting
File system operations
Shell command execution
Project exploration and understanding
The original implementation is available as a JavaScript module that defines prompts and tools for interacting with Claude's API.
What is MCP?
The Model Context Protocol (MCP) is a standardized interface for AI models that enables consistent interaction patterns across different models and providers. MCP defines:
Tools: Functions that models can call to perform actions
Resources: External data that models can access
Prompts: Predefined conversation templates
By implementing Claude Code as an MCP server, we make its capabilities available to any MCP-compatible client, allowing for greater interoperability and flexibility.
Features
Full implementation of Claude Code functionality as an MCP server
Provides tools for file operations, shell commands, and code analysis
Exposes resources for accessing file system and environment information
Includes prompts for general CLI interaction and code review
Compatible with any MCP client
TypeScript implementation with full type safety
Installation
Usage
Running as a standalone server
Using with MCP clients
Claude Code MCP can be used with any MCP client. Here's an example of how to connect to it using the MCP TypeScript SDK:
Available Tools
Claude Code MCP provides the following tools:
bash: Execute shell commands with security restrictions and timeout options
readFile: Read files from the filesystem with options for line offsets and limits
listFiles: List files and directories with detailed metadata
searchGlob: Search for files matching a glob pattern
grep: Search for text in files with regex pattern support
think: A no-op tool for thinking through complex problems
codeReview: Analyze and review code for bugs, security issues, and best practices
editFile: Create or edit files with specified content
Tool Details
bash
The bash tool includes security restrictions that prevent execution of potentially dangerous commands like curl
, wget
, and others.
readFile
searchGlob
grep
Available Resources
file: Access file contents (
file://{path}
)Provides direct access to file contents with proper error handling
Returns the full text content of the specified file
directory: List directory contents (
dir://{path}
)Returns a JSON array of file information objects
Each object includes name, path, isDirectory, size, and modified date
environment: Get system environment information (
env://info
)Returns information about the system environment
Includes Node.js version, npm version, OS info, and environment variables
Available Prompts
generalCLI: General CLI prompt for Claude Code
Provides a comprehensive system prompt for Claude to act as a CLI tool
Includes guidelines for tone, style, proactiveness, and following conventions
Automatically includes environment details
codeReview: Prompt for reviewing code
Specialized prompt for code review tasks
Analyzes code for bugs, security vulnerabilities, performance issues, and best practices
prReview: Prompt for reviewing pull requests
Specialized prompt for PR review tasks
Analyzes PR changes and provides comprehensive feedback
initCodebase: Initialize a new CLAUDE.md file with codebase documentation
Creates documentation for build/lint/test commands and code style guidelines
Useful for setting up a new project with Claude Code
Development
Architecture
Claude Code MCP is built with a modular architecture:
The implementation follows these key principles:
Modularity: Each component (tools, prompts, resources) is implemented in a separate module
Type Safety: Full TypeScript type definitions for all components
Error Handling: Comprehensive error handling for all operations
Security: Security restrictions for potentially dangerous operations
Implementation Details
MCP Server Setup
The main server is set up in claude-code-server.ts
:
Tool Implementation
Tools are implemented using the MCP SDK's tool registration method:
Resource Implementation
Resources are implemented using the MCP SDK's resource registration method:
License
MIT
Acknowledgements
Claude Code by Anthropic
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Disclaimer
This project is not officially affiliated with Anthropic. Claude Code is a product of Anthropic, and this project is an independent implementation of Claude Code as an MCP server.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that allows integration with Claude Desktop by creating and managing custom tools that can be executed through the MCP framework.Last updated -40
- AsecurityAlicenseAqualityAn AI-powered Model Context Protocol server for Claude Code that provides code intelligence tools including codebase analysis, task management, component generation, and deployment configuration.Last updated -2313GPL 3.0
- -securityAlicense-qualityWraps Claude Code as a server using the Model Context Protocol (MCP), allowing teams to interact with Claude Code through a Slack bot interface.Last updated -5MIT License
- AsecurityFlicenseAqualityA customizable Model Context Protocol server built with mcp-framework that enables Claude to access external tools and capabilities through a standardized interface.Last updated -40