返回市场
MCP工具包

MCP工具包

作者:getfounded102 星标更新:2025-07-25

项目介绍

MCP 工具包

Model Context Protocol (MCP) 的综合工具包,具有自动工具发现和多种传输选项。

PyPI 版本 Python 版本 许可证

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


🚀 UsefulAI 开发 | 📖 从 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(如果缺少则帮助安装)
  • ✅ 创建桌面快捷方式
  • ✅ 自动设置一切

📦 其他安装方法

<details> <summary>手动下载</summary>
  1. 下载最新版本:

  2. 解压并运行:

    • Windows: 运行 install.bat
    • Mac/Linux: 运行 ./install.sh
</details> <details> <summary>Git 安装(适用于开发者)</summary>
  1. 克隆仓库

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

    • Windows: 双击 launch.bat
    • Mac/Linux: 运行 ./launch.sh
</details> <details> <summary>仅 Docker 安装</summary>
docker run -it --name mcp-toolkit ghcr.io/getfounded/mcp-tool-kit:latest
</details>

🔧 功能

动态工具注册

工具在运行时自动发现和注册 - 不需要手动配置!

多种传输选项

  • stdio: 用于与 Claude Desktop 集成
  • SSE (服务器发送事件): 用于基于 Web 的访问

超过 120 种可用工具

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

简单配置

通过简单的 config.yaml 文件控制一切:

enabled_tools:
  filesystem: true
  time_tools: true
  brave_search: true
  # ... 更多工具

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
    # ... 其他密钥
    

💾 存储设置

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

  • Windows: C:\Users\{用户名}\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/     # 文档文件
├── downloads/     # 下载文件
└── workspace/     # 临时工作文件

所有通过文件系统工具的操作都将限制在这个目录内以确保安全。

🔌 连接到 Claude Desktop

  1. 使用启动器以 stdio 模式启动服务器
  2. 在 Claude Desktop 配置中添加:
    {
      "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 "我的自定义工具"
        
    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"处理:{param}"

查看 开发者文档 获取详细指南。

📚 文档

完整的文档可以在 https://docs.mcp-tool-kit.com 找到。

要在本地运行文档:

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

🐳 Docker 命令

使用启动器(推荐)

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

手动命令

# 启动服务器
docker-compose up -d

# 查看日志
docker-compose logs -f

# 停止服务器
docker-compose down

# 修改后重建
docker-compose build --no-cache

🤝 贡献

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

📄 许可证

此项目采用 MIT 许可证 - 详情见 LICENSE 文件。

🆘 支持