工具
工具可供法学硕士 (LLM) 申请。Claude Sonnet 3.5 智能地使用了run_command
。此外,初步测试显示,Groq Desktop 在 MCP和llama4
模型上取得了良好的效果。
目前,只需一个命令即可统治它们!
run_command
- 运行命令,例如hostname
或ls -al
或echo "hello world"
等- 以文本形式返回
STDOUT
和STDERR
- 可选的
stdin
参数意味着你的 LLM 可以- 将
stdin
中的代码传递给fish
、bash
、zsh
、python
等命令 - 使用
cat >> foo/bar.txt
从stdin
中的文本创建文件
- 将
- 以文本形式返回
警告:请谨慎操作此服务器!在 Claude 桌面应用中,请使用
Approve Once
(而不是Allow for This Chat
),以便您可以审核每个命令;如果您不信任该命令,请使用Deny
。权限由运行服务器的用户决定。请勿使用sudo
运行。
视频演示
提示
提示是供用户包含在聊天历史记录中,即通过Zed
的斜线命令(在其 AI 聊天面板中)
run_command
- 使用命令输出生成提示消息
发展
安装依赖项:
构建服务器:
对于使用自动重建的开发:
安装
要与 Claude Desktop 一起使用,请添加服务器配置:
在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
Groq Desktop(测试版,macOS)使用~/Library/Application Support/groq-desktop-app/settings.json
使用已发布的 npm 包
使用此工作流程将mcp-server-commands发布到 npm
使用本地构建(repo checkout)
确保运行npm run build
日志记录
Claude 桌面应用程序将日志写入~/Library/Logs/Claude/mcp-server-mcp-server-commands.log
默认情况下,仅记录重要消息(例如错误)。如果您想查看更多消息,请在配置服务器时将--verbose
添加到args
中。
顺便说一下,日志会写入STDERR
,因为 Claude Desktop 会将日志路由到日志文件。未来,我希望格式良好的日志消息能够通过STDIO
传输写入 MCP 客户端(注意:不是 Claude Desktop 应用)。
调试
由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:
检查器将提供一个 URL 来访问浏览器中的调试工具。
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
用于运行命令的 MCP 服务器。
Related MCP Servers
- -securityFlicense-qualityAn MCP server that allows AI assistants like Claude to execute terminal commands on the user's computer and return the output, functioning like a terminal through AI.Last updated -7Python
- -securityFlicense-qualityAn MCP server that allows AI models to execute system commands on local machines or remote hosts via SSH, supporting persistent sessions and environment variables.Last updated -101TypeScript
MCP-YNU FastMCP Serverofficial
-securityAlicense-qualityA dynamic MCP server implementation that automatically loads tools, resources, and prompts from their respective directories, allowing for easy extension and configuration.Last updated -PythonMIT License- PythonMIT License