Back to MCP directory
publicPublicdnsLocal runtime

FastMCP Todo

一个基于FastMCP的待办事项服务器,用于Swarmonomicon项目,通过FastMCP接收请求并将任务存储在MongoDB中,供Swarmonomicon的工作器处理。

article

README

🚀 快速 MCP 待办事项服务器

快速 MCP 待办事项服务器是基于 FastMCP 构建的,专为 Swarmonomicon 项目打造。它能够接收待办事项请求,并将其存储在 MongoDB 中,供 Swarmonomicon 待办事项处理程序进行后续处理,极大地提升了待办事项管理的效率。

🚀 快速开始

此服务器是基于 FastMCP 的待办事项管理解决方案,借助 FastMCP 接收请求,并将数据存储于 MongoDB,与 Swarmonomicon 待办事项处理程序无缝协作。

✨ 主要特性

  • 基于 FastMCP 构建服务器,高效接收待办事项请求。
  • 集成 MongoDB,实现待办事项的可靠存储。
  • 与 Swarmonomicon 待办事项处理程序完美兼容。
  • 使用 Python 实现,具有良好的可读性和可维护性。

📦 安装指南

  1. 克隆仓库:

    git clone https://github.com/DanEdens/Omnispindle.git
    cd Omnispindle
    
  2. 安装 uv(如果尚未安装):

    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  3. 创建并激活带有 uv 的虚拟环境:

    uv venv
    source .venv/bin/activate  # 在 Unix/macOS 系统上
    # 或者在 Windows 上
    .venv\Scripts\activate
    
  4. 使用 uv 安装依赖项:

    uv pip install -r requirements.txt
    
  5. 开发环境,安装额外的依赖项:

    uv pip install -r requirements-dev.txt
    
  6. 创建一个 .env 文件并添加配置:

    MONGODB_URI=mongodb://localhost:27017
    MONGODB_DB=swarmonomicon
    MONGODB_COLLECTION=todos
    

💻 使用示例

启动服务器

启动 FastMCP 服务器:

python -m src.Omnispindle

添加待办事项

您可以使用以下几种方式通过 FastMCP 添加待办事项:

基础用法

使用 FastMCP Python 客户端:

from fastmcp import FastMCPClient

client = FastMCPClient()
response = await client.call_tool("add_todo", {
    "description": "示例待办事项",
    "priority": "high",  # 可选,默认为 "medium"
    "target_agent": "user"  # 可选,默认为 "user"
})

高级用法

直接使用 MQTT:

mosquitto_pub -t "mcp/todo/new" -m '{
    "description": "示例待办事项",
    "priority": "high",
    "target_agent": "user"
}'

开发信息

基础用法

运行测试:

pytest tests/

高级用法

运行带有覆盖率的测试:

coverage run -m pytest tests/ && coverage report

指定运行特定测试文件:

pytest tests/test_example.py -v

📚 详细文档

此服务器在 Swarmonomicon 生态系统中扮演重要角色,具体信息请参阅主项目文档:Swarmonomicon

📄 许可证

该项目的许可信息在此处说明,请查阅相关文件以获取详细信息。

🤝 贡献指南

欢迎社区贡献!如需参与,请参考项目的贡献指南,了解如何提交问题、拉取请求和参与开发。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client