JSPM

external-mcp-service

1.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q29767F
  • License MIT

示例第三方MCP服务,提供图像生成、翻译、数据分析和股票金融工具

Package Exports

  • external-mcp-service
  • external-mcp-service/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (external-mcp-service) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

external-mcp-service

这是一个基于stdio的MCP(Message Computation Provider)示例服务,可以与支持MCP协议的客户端集成。

安装方式

通过npm全局安装

# 全局安装
npm install -g external-mcp-service

# 然后可以直接运行
external-mcp

通过npx临时运行

npx external-mcp-service

本地测试安装

如果你想在发布前测试,可以使用:

# 打包
npm pack

# 全局安装本地包
npm install -g external-mcp-service-1.0.0.tgz

# 或者在MCP客户端中使用
# 命令: npx <本地路径>/external-mcp-service-1.0.0.tgz

在MCP客户端中使用

在MCP客户端的"添加MCP"界面中:

名称: 外部MCP工具
类型: stdio
命令: npx external-mcp-service

支持的工具

该MCP服务提供以下工具:

  1. 图像生成工具 (image-gen) - 生成各种描述性图像
  2. 翻译工具 (translation) - 将文本在多种语言之间翻译
  3. 数据分析工具 (analysis) - 分析数据并生成统计报告

本地开发与测试

克隆项目后:

# 安装依赖
npm install

# 启动MCP服务
npm start

工具参数说明

图像生成工具 (image-gen)

{
  "prompt": "一只可爱的猫",
  "count": 2
}

翻译工具 (translation)

{
  "text": "你好",
  "sourceLanguage": "zh",
  "targetLanguage": "en"
}

数据分析工具 (analysis)

{
  "data": [1, 2, 3, 4, 5, "文本"],
  "type": "general"
}

MCP协议说明

该服务实现了基本的MCP协议,通过stdin/stdout进行通信:

  1. 服务启动时发送初始化响应,包含可用工具列表
  2. 接收JSON格式的工具调用请求
  3. 返回JSON格式的调用结果

所有请求和响应都是单行JSON对象。

发布到npm

如果您想将修改后的版本发布到npm:

# 更新版本号
npm version patch  # 或 minor 或 major

# 登录npm
npm login

# 发布
npm publish

许可证

MIT