使用说明
MCP工具
A. 模型上下文协议(MCP) 服务器,为本地开发提供有用的开发工具。
MCP DevTools是用 官方MCP Go SDK 并通过标准化的接口公开一组工具,允许AI助手和其他MCP客户端与您的本地开发环境进行交互。
特性
此MCP服务器提供以下工具:
🎨 颜色实用程序
color_convert-在各种格式之间转换CSS颜色值- 输入: CSS颜色值(例如。,
#ff5733,rgb(255, 87, 51),hsl(9, 100%, 60%),或命名颜色,如red) - 输出: 十六进制、RGB、HSL、HSV、CMYK、LAB、XYZ、线性RGB表示
- 附加: 亮度值和亮/暗分类
- 输入: CSS颜色值(例如。,
🌐 网络型公用事业
get_ip_address-获取当前计算机的IP地址- 退货: 所有活动网络接口IP地址
- 标识: 主IP地址(第一个非环回IPv4)
🕐 时间实用程序
get_current_time-获取当前服务器时间- 退货: RFC1123格式的当前时间
📁 文件系统实用程序
list_old_downloads-在下载文件夹中查找旧文件- 退货: 下载目录中过去3个月内未被修改的文件列表
- 包括: 文件名、上次修改时间和大小
💻 系统工具
list_installed_apps-列出已安装的应用程序- 平台: 目前仅支持macOS
- 退货: 已安装的应用程序列表
/Applications目录
🌍 浏览器实用程序
open_in_browser-在默认浏览器中打开URL- 输入: 要打开的URL
- 平台: Windows、macOS、Linux
- 行动: 在系统的默认web浏览器中打开指定的URL
安装
选项1:外壳脚本(Mac/Linux)
curl -fsSL https://github.com/release-lab/install/raw/v1/install.sh | bash -s -- -r=axetroy/mcp-server-devtools -e=mcp-server-devtools
选项2:PowerShell(Windows)
$r="axetroy/mcp-server-devtools";$e="mcp-server-devtools";iwr https://github.com/release-lab/install/raw/v1/install.ps1 -useb | iex
选项3:下载二进制文件
从下载预构建的可执行文件 GitHub发布页面 并将其添加到您的 $PATH.
选项4:从源代码构建
需要 走 1.21或更高版本:
go install github.com/axetroy/mcp-server-devtools/cmd/mcp-server-devtools@latest
配置
要将此服务器与MCP客户端一起使用,请将其添加到客户端的配置文件中。
克劳德桌面
添加到您的Claude Desktop配置文件中:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
窗户: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"devtools": {
"command": "mcp-server-devtools"
}
}
}
其他MCP客户端
对于其他MCP客户端,将其配置为运行:
mcp-server-devtools
服务器按照模型上下文协议规范通过stdin/stdout进行通信。
用法
配置后,您的MCP客户端可以使用可用的工具。服务器将:
- MCP客户端初始化时启动
- 等待stdin上的工具调用请求
- 执行请求的工具
- 通过stdout返回结果
工具调用示例
Color Conversion
请求:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "color_convert",
"arguments": {
"color": "#ff5733"
}
}
}
答复:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hex": "#ff5733",
"rgb": "rgb(255, 87, 51)",
"hsl": "hsl(9.0, 100.0%, 60.0%)",
"hsv": "hsv(9.0, 80.0%, 100.0%)",
"cmyk": "cmyk(0.0%, 65.9%, 80.0%, 0.0%)",
"lab": "lab(61.57, 56.45, 51.48)",
"xyz": "xyz(0.469, 0.305, 0.074)",
"linear_rgb": "linear-rgb(1.000, 0.106, 0.030)",
"luminance": 0.428,
"is_light": false,
"is_dark": true,
"original": "#ff5733"
}
}
Get IP Address
请求:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "get_ip_address",
"arguments": {}
}
}
答复:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"addresses": ["192.168.1.100", "fe80::1"],
"primary": "192.168.1.100"
}
}
发展
构建
make build
测试
make test
格式码
make format
使用MCP客户端进行本地开发
对于使用MCP客户端进行本地开发和测试,您可以将其配置为从源代码运行服务器:
{
"mcpServers": {
"devtools": {
"command": "go",
"args": ["run", "cmd/mcp-server-devtools/main.go"],
"cwd": "/path/to/mcp-server-devtools"
}
}
}
许可证
这 MIT许可证
