Back to MCP directory
publicPublicdnsLocal runtime

mcp-local-command-server

一个基于TypeScript的MCP服务器,用于执行命令并返回结构化输出,支持与Claude Desktop集成。

article

README

🚀 本地命令服务器 MCP 服务器

这是一个基于 TypeScript 的 MCP 服务器,可执行命令并返回结构化的输出,为命令执行和结果处理提供了便利。

🚀 快速开始

此 MCP 服务器基于 TypeScript 构建,用于执行命令并返回结构化输出。以下是快速开始的步骤。

✨ 主要特性

工具

  • execute_command:执行一个命令并返回结构化输出。
    • 接受一个名为 command 的必需参数。
    • 返回从命令获得的结构化输出。

📦 安装指南

开发

  • 安装依赖:
npm install
  • 构建服务器:
npm run build
  • 带自动重建功能的开发:
npm run watch

与Claude桌面集成

要与 Claude 桌面一起使用,请在配置文件中添加以下内容:

  • 在 MacOS 上:~/Library/Application Support/Claude/claude_desktop_config.json
  • 在 Windows 上:%APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "local-command-server": {
      "command": "/path/to/mcp-local-command-server/build/index.js"
    }
  }
}

调试

由于 MCP 服务器通过标准输入输出进行通信,调试可能会比较困难。我们推荐使用 MCP Inspector,这是一个作为包脚本提供的工具:

npm run inspector

Inspector 将提供一个可以在浏览器中访问的 URL 以获取调试工具。

📄 许可证

本项目采用 MIT 许可证。

👨‍💻 作者

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client