Back to MCP directory
publicPublicdnsLocal runtime

kentaro_mcp-local-command-server

一个基于TypeScript的MCP服务器,用于执行命令并返回结构化输出。

article

README

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

这是一个基于 TypeScript 的 MCP 服务器,可执行命令并返回结构化的输出,为命令执行和结果处理提供了高效且规范的解决方案。

🚀 快速开始

本 MCP 服务器能帮助你执行命令并获得结构化输出。下面为你介绍开发和安装的相关步骤。

✨ 主要特性

工具

  • execute_command:执行命令并返回结构化输出。
    • 需传入一个必填参数 command
    • 最终返回命令的结构化输出。

📦 安装指南

开发环境安装

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

在 Claude Desktop 上安装

要在 Claude Desktop 上使用本服务器,需添加服务器配置:

  • 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 服务器通过 stdio 进行通信,调试可能存在一定难度。我们推荐使用 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