Skip to main content
Glama
Daily Work MCP Server

Daily Work MCP Server

by hsgui

Daily Work MCP Server

一个用于记录、查询和总结每日工作内容的本地 MCP Server,基于 FastAPI + FastMCP + SQLite 实现。

运行前准备

  1. 安装依赖:

    conda create -n daily-work-mcp python=3.11 -y
    conda activate daily-work-mcp
    pip install -r requirements.txt
  2. 初始化数据库(首次运行必须执行):

    python scripts/init_db.py

Related MCP server: worklog-telegram

启动方式

启动 HTTP API(可选)

uvicorn app.main:app --reload

默认监听 http://127.0.0.1:8000,包含以下 REST 接口:

  • POST /entries:新增工作内容

  • GET /entries:按 daily/weekly 查询

  • GET /entries/search:全文搜索

  • GET /entries/export:导出 JSON 或 CSV

  • GET /entries/summary:最近 N 天标签聚合

  • GET /entries/reminder:检查今日是否已有记录

  • GET /tags / POST /tags:标签管理

启动 MCP Server

python scripts/run_mcp_server.py

默认以 STDIO transport 运行;如果需要通过 HTTP/Streamable HTTP 暴露端口,可改用:

python scripts/run_mcp_server.py --transport streamable-http --host 127.0.0.1 --port 8888

脚本在 HTTP/Streamable 模式下会自动启用 stateless HTTP,即 /mcp 端点无需任何 Session/Cookie 即可访问,方便 IDE 直接连到 http://127.0.0.1:8888/mcp。 手工调试时记得同时声明 Accept: application/json, text/event-stream,例如:

curl -N \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":"1","method":"ping","params":{}}' \
  http://127.0.0.1:8888/mcp

该脚本会调用 app/mcp/server.py 中的 mcp.run() 并注册全部工具:

  • record_work_entry:新增条目

  • list_work_entries:按日/周查询

  • search_work_entries:关键字检索

  • summarize_recent_work:标签汇总

  • check_today_recorded:今日提醒状态

  • list_tags / create_tag:标签列表与新增

MCP 客户端连接该进程后即可直接调用上述工具。

使用示例

  • 新增条目(REST):

    curl -X POST http://127.0.0.1:8000/entries \
         -H "Content-Type: application/json" \
         -d '{"description":"排查登录问题","tags":["infra/login"]}'
  • 查询本周条目(REST):

    curl "http://127.0.0.1:8000/entries?range=weekly"
  • MCP 调用:在支持 MCP 的客户端中,将 scripts/run_mcp_server.py 作为 Server 入口,即可在会话中调用 record_work_entry、list_work_entries 等工具。

更多需求说明见 requirements.md。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables natural language task management including logging, updating, and summarizing productivity activities across multiple categories using a local SQLite database. It allows users to manage workflows and generate time-based summaries through standardized Model Context Protocol tools.
      1
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables local-first logging of daily activities and generation of daily summaries, weekly article ideas, and platform-specific social posts via Claude, storing everything in a single SQLite file.
      1
      MIT