Information
AiDD MCP 服务器
这是一个MCP服务器,为AI驱动的开发工作流程提供了一整套工具。功能包括文件系统操作、使用tree-sitter对多种编程语言进行代码分析、Git操作、代码执行以及系统信息检索。旨在增强AI在软件开发任务中的辅助能力。
安装
通过 Smithery 安装
要通过 Smithery 自动安装适用于 Claude 桌面版的 AiDD:
npx -y @smithery/cli install mcp-server-aidd --client claude
手动安装
# Using mcp-get
npx @michaellatman/mcp-get@latest install mcp-server-aidd
# Using pip
pip install mcp-server-aidd
# Using uv
uvx mcp-server-aidd
Claude 桌面设置
将以下内容添加到您的 claude_desktop_config.json 文件中:
\{
"mcpServers": \{
"aidd-ai-software-development-utilities": \{
"command": "uvx",
"args": ["mcp-server-aidd"]
\}
\}
\}
SkyDeck AI 辅助应用程序
如果您正在使用 SkyDeck AI 辅助应用程序,您可以搜索 "AiDD" 并安装 mcp-server-aidd。
主要功能
文件系统操作(读取、写入、编辑、移动、删除)
目录管理和遍历
使用 tree-sitter 对多语言代码进行分析
具有安全措施的多语言代码执行
Git 操作(状态、差异、提交、分支管理)
可配置工作区边界的安控控制
截图和屏幕上下文工具
图像处理工具
可用工具
基本文件操作
工具参数返回read_filepath: 字符串文件内容read_multiple_filespaths: 字符串数组多个文件的内容及其头部信息write_filepath: 字符串, content: 字符串成功确认move_filesource: 字符串, destination: 字符串成功确认delete_filepath: 字符串成功确认get_file_infopath: 字符串文件元数据(大小、时间戳、权限)
常用示例:
# Read file
aidd-cli --tool read_file --args '\{"path": "src/main.py"\}'
# Write file
aidd-cli --tool write_file --args '\{"path": "output.txt", "content": "Hello World"\}'
# Get file info
aidd-cli --tool get_file_info --args '\{"path": "src/main.py"\}'
复杂文件操作
edit_file
支持预览的基于模式的文件编辑:
\{
"path": "src/main.py",
"edits": [
\{
"oldText": "def old_function():",
"newText": "def new_function():"
\}
],
"dryRun": false,
"options": \{
"preserveIndentation": true,
"normalizeWhitespace": true,
"partialMatch": true
\}
\}
返回:变更差异或在干运行模式下的预览。
目录操作
工具参数返回值get_allowed_directory无当前允许的目录路径update_allowed_directorydirectory: 字符串 (绝对路径)成功确认list_directorypath: 字符串目录内容列表create_directorypath: 字符串成功确认search_filespattern: 字符串, path?: 字符串, include_hidden?: 布尔值匹配文件列表
directory_tree
生成完整的目录结构:
\{
"path": "src",
"include_hidden": false
\}
返回:目录内容的 JSON 树结构。
常用示例:
# List directory
aidd-cli --tool list_directory --args '\{"path": "."\}'
# Search for Python files
aidd-cli --tool search_files --args '\{"pattern": ".py", "path": "src"\}'
Git 操作
工具参数返回值git_initpath: 字符串, initial_branch?: 字符串仓库初始化状态git_statusrepo_path: 字符串工作目录状态git_addrepo_path: 字符串, files: 字符串数组暂存确认git_resetrepo_path: 字符串取消暂存确认git_checkoutrepo_path: 字符串, branch_name: 字符串分支切换确认
复杂的 Git 操作
git_commit
\{
"repo_path": ".",
"message": "feat: add new feature"
\}
返回:提交哈希和确认信息。
git_diff
\{
"repo_path": ".",
"target": "main"
\}
返回:详细的差异输出。
git_log
\{
"repo_path": ".",
"max_count": 10
\}
返回:包含哈希、作者、日期和消息的提交条目数组。
常用示例:
# Check status
aidd-cli --tool git_status --args '\{"repo_path": "."\}'
# Create and switch to new branch
aidd-cli --tool git_create_branch --args '\{"repo_path": ".", "branch_name": "feature/new-branch"\}'
代码分析
tree_sitter_map
分析源代码结构:
\{
"path": "src"
\}
返回:
类及其方法
函数及参数
模块结构
代码组织统计
继承关系
支持的语言:
Python (.py)
JavaScript (.js, .jsx, .mjs, .cjs)
TypeScript (.ts, .tsx)
Java (.java)
C++ (.cpp, .hpp, .cc)
Ruby (.rb, .rake)
Go (.go)
Rust (.rs)
PHP (.php)
C# (.cs)
Kotlin (.kt, .kts)
系统信息
工具参数返回值get_system_info无全面的系统详细信息
返回:
\{
"working_directory": "/path/to/project",
"system": \{
"os", "os_version", "architecture", "python_version"
\},
"wifi_network": "MyWiFi",
"cpu": \{
"physical_cores", "logical_cores", "total_cpu_usage"
\},
"memory": \{ "total", "available", "used_percentage" \},
"disk": \{ "total", "free", "used_percentage" \},
"mac_details": \{ // Only present on macOS
"model": "Mac mini",
"chip": "Apple M2",
"serial_number": "XXX"
\}
\}
以清晰可读的格式提供关键系统信息。
# Get system information
aidd-cli --tool get_system_info
屏幕上下文和图像工具
get_active_apps
返回用户系统中当前活动的应用程序列表。
\{
"with_details": true
\}
参数:
参数类型是否必需描述with_detailsboolean否是否包含每个应用程序的附加详细信息(默认:false)
返回值:
\{
"success": true,
"platform": "macos",
"app_count": 12,
"apps": [
\{
"name": "Firefox",
"has_windows": true,
"window_count": 3,
"visible_windows": [
\{ "name": "GitHub - Mozilla Firefox", "width": 1200, "height": 800 \}
]
\},
\{
"name": "VSCode",
"has_windows": true
\}
]
\}
此工具提供了关于用户系统中当前运行的应用程序的重要上下文,有助于提供更相关的帮助。
get_available_windows
返回用户屏幕上当前显示的所有可用窗口的详细信息。
\{\}
返回值:
\{
"success": true,
"platform": "macos",
"count": 8,
"windows": [
\{
"id": 42,
"title": "Document.txt - Notepad",
"app": "Notepad",
"visible": true
\},
\{
"title": "Terminal",
"app": "Terminal",
"visible": true,
"active": true
\}
]
\}
此工具帮助理解用户屏幕上显示的内容,并可用于情境感知的帮助。
capture_screenshot
捕获用户屏幕或特定窗口的截图。
\{
"output_path": "screenshots/capture.png",
"capture_mode": \{
"type": "named_window",
"window_name": "Visual Studio Code"
\}
\}
参数:
参数类型是否必需描述output_pathstring否截图应保存的路径(默认:生成的路径)capture_modeobject否指定要捕获的内容capture_mode.typestring否截图类型:'full', 'active_window', 或 'named_window'(默认:'full')capture_mode.window_namestring否要捕获的窗口名称(当类型为 'named_window' 时需要)
返回值:
\{
"success": true,
"path": "/path/to/screenshots/capture.png"
\}
此工具用于可视化、调试或情境感知的帮助时捕捉屏幕截图。
read_image_file
从文件系统读取图像文件并将其内容作为 base64 编码的字符串返回。
\{
"path": "images/logo.png"
\}
参数:
参数类型是否必需描述pathstring是要读取的图像文件的路径max_sizeinteger否文件最大大小(以字节为单位,默认:100MB)
返回值:
可以显示或处理的 Base64 编码的图像数据。
此工具支持常见的图像格式如 PNG、JPEG、GIF 和 WebP,并自动调整图像大小以优化查看效果。
代码执行
execute_code
在各种编程语言中执行代码,同时采取安全措施和限制。
\{
"language": "python",
"code": "print('Hello, World!')",
"timeout": 5
\}
支持的语言:
Python (python3)
JavaScript (Node.js)
Ruby
PHP
Go
Rust
参数:
参数类型是否必需描述languagestring是使用的编程语言codestring是要执行的代码timeoutinteger否最大执行时间(默认:5秒)
示例用法:
# Python example
aidd-cli --tool execute_code --args '\{
"language": "python",
"code": "print(sum(range(10)))"
\}'
# JavaScript example
aidd-cli --tool execute_code --args '\{
"language": "javascript",
"code": "console.log(Array.from(\{length: 5\}, (_, i) => i*2))"
\}'
# Ruby example
aidd-cli --tool execute_code --args '\{
"language": "ruby",
"code": "puts (1..5).reduce(:+)"
\}'
# Go example
aidd-cli --tool execute_code --args '\{
"language": "go",
"code": "fmt.Println(\"Hello, Go!\")"
\}'
要求:
必须安装相应的语言运行时
命令必须在系统 PATH 中可用
创建临时文件所需的适当权限
⚠️ 安全警告:
此工具会在您的系统上执行任意代码。请始终:
确保您了解所执行代码的内容以及可能带来的风险。
在执行前彻底审查代码
了解代码的目的和预期结果
永不执行不可信的代码
注意潜在的系统影响
监控执行输出
execute_shell_script
以安全措施和限制执行 shell 脚本(bash/sh)。
\{
"script": "echo \"Current directory:\" && pwd",
"timeout": 300
\}
参数:
参数类型是否必需描述scriptstring是要执行的 Shell 脚本timeoutinteger否最大执行时间(默认:300秒,最大:600秒)
使用示例:
# List directory contents with details
aidd-cli --tool execute_shell_script --args '\{
"script": "ls -la"
\}'
# Find all Python files recursively
aidd-cli --tool execute_shell_script --args '\{
"script": "find . -name \"*.py\" -type f"
\}'
# Complex script with multiple commands
aidd-cli --tool execute_shell_script --args '\{
"script": "echo \"System Info:\" && uname -a && echo \"\nDisk Usage:\" && df -h"
\}'
特性:
使用 /bin/sh 以实现跨系统的最大兼容性
在允许的目录内执行
分别输出 stdout 和 stderr
正确处理错误及控制超时
⚠️ 安全警告:
此工具会在您的系统上执行任意的 shell 命令。请始终:
在执行前彻底审查脚本
了解脚本的目的和预期结果
永不执行不可信的脚本
注意潜在的系统影响
监控执行输出
配置
配置文件: ~/.aidd/config.json
\{
"allowed_directory": "/path/to/workspace"
\}
CLI 使用
基本命令结构:
aidd-cli --tool --args ''
# List available tools
aidd-cli --list-tools
# Enable debug output
aidd-cli --debug --tool --args ''
调试
使用 MCP Inspector 进行调试:
npx @modelcontextprotocol/inspector run
安全性
操作限制在配置的允许目录内
防止路径遍历
保持文件权限
安全操作处理
即将推出的功能
GitHub 工具:
PR 描述生成器
代码审查
Actions 管理器
Pivotal Tracker 工具:
故事生成器
故事管理器
开发状态
当前处于积极开发中。功能和 API 可能会发生变化。
许可证
Apache License 2.0 - 查看 LICENSE