Mcp 克劳德代码
概覽
什麼是 MCP Claude Code?
MCP Claude Code 是一個創新的實現,旨在利用 Claude 的能力,這是一個強大的 AI 模型。這個庫作為開發者和愛好者探索、貢獻和增強 Claude 功能的平台,通過協作編碼的努力。該項目的目標是提供一個穩健的框架,將 Claude 的能力整合到各種應用中,使得用戶更容易在他們的項目中利用 AI。
MCP Claude Code 的特點
- AI 整合:無縫整合 Claude 的 AI 能力到應用中,實現自然語言處理和數據分析等高級功能。
- 開源:該項目公開可用,鼓勵來自全球的開發者進行合作和貢獻。
- 用戶友好的文檔:提供全面的指南和文檔,幫助用戶有效理解和利用功能。
- 社區支持:一個充滿活力的開發者和用戶社區,分享見解、排除問題並促進項目的增長。
- 定期更新:該庫積極維護,定期更新以增強性能並引入新功能。
如何開始使用 MCP Claude Code
-
克隆庫:首先使用以下命令將庫克隆到本地機器:
git clone https://github.com/SDGLBL/mcp-claude-code.git -
安裝依賴:導航到項目目錄並安裝必要的依賴。這通常可以使用以下命令完成:
npm install -
探索文檔:熟悉提供的文檔,以了解如何實現和利用 MCP Claude Code 的功能。
-
貢獻:如果你有改進或新功能的想法,隨時可以分叉庫,進行更改並提交拉取請求。
-
參與社區:加入討論,提出問題,並在社區論壇或 GitHub 問題中與其他用戶分享你的經驗。
常見問題解答
問:MCP Claude Code 使用了哪些編程語言?
答:該項目主要使用 JavaScript 和 Node.js,但也歡迎其他語言的貢獻。
問:MCP Claude Code 有許可證嗎?
答:是的,該項目根據 MIT 許可證進行許可,允許免費使用、修改和分發。
問:我該如何報告問題或錯誤?
答:你可以通過導航到庫的「問題」部分,提交一個新問題,並詳細說明問題來報告問題。
問:我可以為該項目做貢獻嗎?
答:當然可以!鼓勵貢獻。你可以分叉庫,進行更改,並提交拉取請求以供審查。
問:我可以在哪裡找到有關 Claude 的更多信息?
答:有關 Claude 及其能力的詳細信息,請參閱官方文檔或項目的維基部分。
詳細
MCP Claude Code
An implementation of Claude Code capabilities using the Model Context Protocol (MCP).
Overview
This project provides an MCP server that implements Claude Code-like functionality, allowing Claude to directly execute instructions for modifying and improving project files. By leveraging the Model Context Protocol, this implementation enables seamless integration with various MCP clients including Claude Desktop.

Features
- Code Understanding: Analyze and understand codebases through file access and pattern searching
- Code Modification: Make targeted edits to files with proper permission handling
- Enhanced Command Execution: Run commands and scripts in various languages with improved error handling and shell support
- File Operations: Manage files with proper security controls through shell commands
- Code Discovery: Find relevant files and code patterns across your project with high-performance searching
- Agent Delegation: Delegate complex tasks to specialized sub-agents that can work concurrently
- Multiple LLM Provider Support: Configure any LiteLLM-compatible model for agent operations
- Jupyter Notebook Support: Read and edit Jupyter notebooks with full cell and output handling
Tools Implemented
| Tool | Description |
| -- | |
| read | Read file contents with line numbers, offset, and limit capabilities |
| write | Create or overwrite files |
| edit | Make line-based edits to text files |
| multi_edit | Make multiple precise text replacements in a single file operation with atomic transactions |
| directory_tree | Get a recursive tree view of directories |
| grep | Fast pattern search in files with ripgrep integration for best performance (docs) |
| content_replace | Replace patterns in file contents |
| grep_ast | Search code with AST context showing matches within functions, classes, and other structures |
| run_command | Execute shell commands (also used for directory creation, file moving, and directory listing) |
| notebook_read | Extract and read source code from all cells in a Jupyter notebook with outputs |
| notebook_edit | Edit, insert, or delete cells in a Jupyter notebook |
| think | Structured space for complex reasoning and analysis without making changes |
| dispatch_agent | Launch one or more agents that can perform tasks using read-only tools concurrently |
| batch | Execute multiple tool invocations in parallel or serially in a single request |
| todo_write | Create and manage a structured task list |
| todo_read | Read a structured task list |
Getting Started
For detailed installation and configuration instructions, please refer to INSTALL.md.
For detailed tutorial of 0.3 version, please refer to TUTORIAL.md
Security
This implementation follows best practices for securing access to your filesystem:
- Permission prompts for file modifications and command execution
- Restricted access to specified directories only
- Input validation and sanitization
- Proper error handling and reporting
Development
To contribute to this project:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
伺服器配置
{
"mcpServers": {
"mcp-claude-code": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--sdglbl--mcp-claude-code--mcp-claude-code",
"claudecode"
],
"env": {
"USEFUL_PROMPTS": "useful-prompts"
}
}
}
}