Token导航 LogoToken导航TokenDH.com
DAZ Command MCP Server logo
运维云端stdio官方级别未说明来源级核验

DAZ Command MCP Server

MCP Server

一个基于会话的命令执行服务器,提供智能LLM支持的摘要生成和文件操作功能。

工具数

16

提示词数

0

GitHub Stars

4

资源数

0
会话管理命令执行PythonClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

darrenoakey

提供方

darrenoakey

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

DAZ命令MCP服务器

DAZ Command MCP Logo

*一种模型上下文协议(MCP)服务器,提供基于会话的命令执行和基于LLM的智能摘要。*

______________________________________________________________________

🚀 特性

  • 🔧 会话管理:创建、打开和管理隔离的命令执行会话
  • ⚡ 命令执行:运行带有超时控制和工作目录管理的shell命令
  • 📁 文件操作:具有全面错误处理功能的读写文本文件
  • 🤖 LLM总结:使用结构化LLM响应自动跟踪会话进度
  • 📋 事件日志记录:完成会议期间所有业务的审计跟踪
  • 🔒 线程安全:具有适当同步的稳健并发操作

📦 安装

先决条件

  • Python 3.8+
  • fastmcp 图书馆
  • dazllm LLM集成库

快速设置

  1. 克隆此存储库:
git clone https://github.com/yourusername/daz-command-mcp.git
cd daz-command-mcp
  1. 安装依赖项:
pip install -r requirements.txt
  1. 配置LLM模型 在脚本中(默认值: lm-studio:openai/gpt-oss-20b)

🎯 用法

启动服务器

python main.py

可用工具

会话管理

  • daz_sessions_list() -列出所有会话并确定活动会话
  • daz_session_create(name, description) -创建并激活新会话
  • daz_session_open(session_id) -打开并激活现有会话
  • daz_session_current() -获取当前活动会话的详细信息
  • daz_session_close() -关闭当前会话
  • daz_session_rename(old_name, new_name) -重命名现有会话
  • daz_session_delete(session_name) -通过移动到deleted_sessions删除会话

命令和文件操作

所有命令和文件操作都需要活动会话和上下文参数:

  • daz_command_cd(directory, current_task, summary_of_what_we_just_did, summary_of_what_we_about_to_do) -更改工作目录
  • daz_command_read(file_path, current_task, summary_of_what_we_just_did, summary_of_what_we_about_to_do) -读取文本文件
  • daz_command_write(file_path, content, current_task, summary_of_what_we_just_did, summary_of_what_we_about_to_do) -编写文本文件
  • daz_command_run(command, current_task, summary_of_what_we_just_did, summary_of_what_we_about_to_do, timeout=60) -执行shell命令

学习与指导

  • daz_add_learnings(learning_info) -为会议添加重要发现和背景
  • daz_instructions_read() -阅读当前会话说明
  • daz_instructions_add(instruction) -向会话添加新指令
  • daz_instructions_replace(instructions) -用新列表替换所有说明
  • daz_record_user_request(user_request) -在多步骤任务开始时记录用户请求

工作流示例

# Create a new session
daz_session_create("Setup Project", "Setting up a new Python project with dependencies")

# Navigate to project directory  
daz_command_cd("/path/to/project", 
               "Setting up Python project",
               "Created new session for project setup", 
               "Navigate to project root directory")

# Run commands
daz_command_run("pip install -r requirements.txt",
                "Setting up Python project", 
                "Navigated to project directory",
                "Install project dependencies")

# Read configuration
daz_command_read("config.json",
                 "Setting up Python project",
                 "Installed dependencies successfully", 
                 "Review current configuration settings")

# Write new file
daz_command_write("setup.py", "...",
                  "Setting up Python project",
                  "Reviewed configuration file",
                  "Create package setup file")

🏗️ 建筑

会话存储

会话以JSON文件的形式存储在 sessions/ 目录具有以下结构:

{
  "id": "unique-session-id",
  "name": "Session Name", 
  "description": "Detailed description",
  "created_at": 1692123456.789,
  "updated_at": 1692123456.789,
  "summary": "LLM-generated summary",
  "progress": "Current progress status",
  "current_directory": "/current/working/dir",
  "events_count": 42
}

事件日志记录

每个操作都记录在 event_log.jsonl:

{
  "timestamp": 1692123456.789,
  "type": "run|read|write|cd|user_request|learning",
  "current_task": "The task being worked on",
  "summary_of_what_we_just_did": "What was just completed",
  "summary_of_what_we_about_to_do": "What's planned next",
  "inputs": {...},
  "outputs": {...}, 
  "duration": 0.123
}

LLM集成

服务器使用异步LLM处理来维护会话摘要:

  • 🔄 后台处理:摘要在单独的线程中运行
  • 🛡️ 容错:LLM故障不会影响MCP操作
  • 📋 结构化输出:使用Pydantic模型进行可靠的解析
  • ⚙️ 可配置模型:易于在不同LLM提供商之间切换

⚙️ 配置

LLM模型

编辑 LLM_MODEL_NAME 恒常 src/models.py:

LLM_MODEL_NAME = "your-model-name"

会话目录

会话存储在 ./sessions/ 默认情况下。这可以通过更改 SESSIONS_DIR 恒常 src/models.py.

🛠️ 错误处理

  • 🔄 故障弱化:即使LLM摘要失败,操作也会继续
  • 📝 综合录井:所有错误都记录到stderr
  • ✅ 输入验证:强大的参数检查和净化
  • 🔒 文件安全:原子文件操作可防止损坏

🔗 整合

此MCP服务器与Claude Desktop和其他MCP兼容客户端集成。将其添加到MCP配置中:

{
  "mcpServers": {
    "daz-command": {
      "command": "python",
      "args": ["/path/to/main.py"]
    }
  }
}

📁 项目结构

daz-command-mcp/
├── README.md              # This file
├── main.py                # Entry point
├── requirements.txt       # Dependencies
├── images/                # Documentation images
├── sessions/              # Session storage (auto-created)
└── src/                   # Source code
    ├── __init__.py
    ├── command_executor.py    # Command execution logic
    ├── history_manager.py     # Session history management
    ├── mcp_tools.py          # MCP tool definitions
    ├── models.py             # Data models and constants
    ├── session_manager.py    # Session lifecycle management
    ├── summary_generator.py  # LLM summary generation
    ├── summary_worker.py     # Background summarization worker
    ├── utils.py              # Utility functions
    └── tests/                # Unit tests
        ├── test_add_learnings.py
        ├── test_initialization_fix.py
        ├── test_llm_system_integration.py
        ├── test_new_parameter_system.py
        └── test_summary_generation.py

🧪 测试

运行综合测试套件:

# Run all tests
python -m pytest src/tests/

# Run specific test
python -m pytest src/tests/test_summary_generation.py -v

# Run with coverage
python -m pytest src/tests/ --cov=src

🤝 贡献

  1. 分叉存储库
  2. 创建要素分支(git checkout -b feature/amazing-feature)
  3. 进行更改
  4. 如果适用,添加测试
  5. 提交您的更改(git commit -m 'Add amazing feature')
  6. 推到分支(git push origin feature/amazing-feature)
  7. 提交拉取请求

📜 许可证

\[在此处添加您的许可证\]

📦 依赖项

  • fastmcp:MCP服务器框架
  • 达兹勒姆:LLM集成库

💬 支持

有关问题和疑问,请在GitHub上打开问题或联系\[您的联系信息\]。

______________________________________________________________________

*内置于❤️ 模型上下文协议生态系统*

许可证

该项目已获得许可 CC BY NC 4.0 -可自由使用和修改,但未经许可不得用于商业用途。

目录标签

目录标签

会话管理命令执行PythonClaude本地部署LLM摘要文件操作事件日志

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

部署方式(deploymentType,部署类型)

local-only

工具数量(toolCount,工具数)

16

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosessionlocal-only

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP