MCP工具包

一个全面的模型上下文协议(MCP)工具包,具有自动工具发现和多种传输选项。

  • by getfounded
  • Python
  • 本地部署
  • 108 星标
  • 更新于
在 GitHub 查看 getfounded/mcp-tool-kit

使用说明

MCP工具包

模型上下文协议(MCP)的综合工具包,具有自动工具发现和多种传输选项。

📚 官方文件 | 🌐 网站 | 💬 社区


🚀 建造于 有用AI | 📖 从GitHub到商业成功

🚀 快速安装-无需Git!

选择您的平台并运行一个命令:

🖥️ Windows(PowerShell)

irm https://raw.githubusercontent.com/getfounded/mcp-tool-kit/main/install.ps1 | iex

🍎 macOS(终端)

bash <(curl -s https://raw.githubusercontent.com/getfounded/mcp-tool-kit/main/install.sh)

🐧 Linux(终端)

bash <(wget -qO- https://raw.githubusercontent.com/getfounded/mcp-tool-kit/main/install.sh)

就是这样! 安装程序将:

  • ✅ 下载MCP工具包(无需Git!)
  • ✅ 检查Docker(如果缺少,帮助安装)
  • ✅ 创建桌面快捷方式
  • ✅ 自动设置所有内容

📦 替代安装方法

Manual Download
  1. 下载最新版本:

  2. 提取并运行:

    • 视窗:运行 install.bat
    • Mac/Linux:运行 ./install.sh
Git Installation (for developers)
  1. 克隆存储库

    git clone https://github.com/getfounded/mcp-tool-kit.git
    cd mcp-tool-kit
    
  2. 运行启动器

    • 视窗:双击 launch.bat
    • Mac/Linux:运行 ./launch.sh
Docker-Only Installation
docker run -it --name mcp-toolkit ghcr.io/getfounded/mcp-tool-kit:latest

🔧 特性

动态工具注册

工具会在运行时自动发现和注册,无需手动配置!

多种运输方式

  • 标准:用于Claude Desktop集成
  • SSE(服务器发送事件):用于基于网络的访问

120+可用工具

  • 📁 文件系统:读取、写入和管理文件
  • 🕐 时间工具:时区转换和时间操作
  • 🌐 网页搜索:Brave Search集成
  • 🤖 浏览器自动化:基于剧作家的浏览器控件
  • 📊 数据分析:雅虎财经、FRED、世界银行数据
  • 📄 文档工具:PDF、Excel、PowerPoint操作
  • 🎯 还有更多!

易于配置

通过一个简单的 config.yaml 文件:

enabled_tools:
  filesystem: true
  time_tools: true
  brave_search: true
  # ... more tools

tool_config:
  filesystem:
    allowed_directories: ["~/Documents", "~/Downloads"]
  brave_search:
    max_results: 10

📋 环境设置

  1. 复制 .env.template 向 .env
  2. 添加API密钥:
    BRAVE_SEARCH_API_KEY=your_key_here
    NEWS_API_KEY=your_key_here
    FRED_API_KEY=your_key_here
    # ... other keys
    

💾 存储设置

MCP工具包使用专用存储目录进行文件操作:

  • 视窗: C:\Users\{Username}\mcp-tool-kit-storage
  • Mac/Linux: ~/mcp-tool-kit-storage

自动设置

存储目录是在您第一次运行Docker容器时自动创建的。您还可以手动设置它:

Windows(PowerShell):

.\scripts\setup-storage.ps1

Mac/Linux:

./scripts/setup-storage.sh

存储结构

mcp-tool-kit-storage/
├── documents/     # For document files
├── downloads/     # For downloaded files
└── workspace/     # For temporary work files

为了安全起见,通过文件系统工具进行的所有文件操作都将限于此目录。

🔌 连接到克劳德桌面

  1. 使用启动器以stdio模式启动服务器
  2. 添加到Claude桌面配置:
    {
      "mcpServers": {
        "mcp-tool-kit": {
          "command": "docker",
          "args": ["exec", "-i", "mcp-server", "python", "mcp_server_v2.py"]
        }
      }
    }
    

🌐 使用SSE模式

  1. 使用启动器以SSE模式启动服务器
  2. 访问服务器 http://localhost:8080
  3. 使用SSE端点:
    • /sse -服务器发送的事件流
    • /messages -向服务器发送消息

🛠️ 创建自定义工具

工具现在使用标准化的基类系统:

from app.tools.base_tool import BaseTool

class MyCustomTool(BaseTool):
    def get_name(self) -> str:
        return "My Custom Tool"
        
    def get_tools(self) -> Dict[str, Callable]:
        return {
            "my_function": self.my_function
        }
        
    async def my_function(self, param: str, ctx: Context = None) -> str:
        return f"Processed: {param}"

请参阅 开发者文档 获取详细指南。

📚 文档

完整文档可在 https://docs.mcp-tool-kit.com.

要在本地运行文档,请执行以下操作:

  1. cd docs
  2. npm install
  3. npm start

🐳 Docker命令

使用启动器(推荐)

启动器脚本自动处理所有Docker操作。

手动命令

# Start server
docker-compose up -d

# View logs
docker-compose logs -f

# Stop server
docker-compose down

# Rebuild after changes
docker-compose build --no-cache

🤝 贡献

  1. 分叉存储库
  2. 创建功能分支
  3. 将您的工具添加到 app/tools/
  4. 提交拉取请求

📄 许可证

此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。

🆘 支持