Back to MCP directory
publicPublicdnsLocal runtime

onx-mcp-server

一个实现Model Context Protocol (MCP)的服务,用于连接AI助手与Onspring平台数据,提供数据查询和操作功能。

article

README

🚀 Onspring MCP 服务器

Onspring MCP 服务器是一个与 Onspring API 集成的 模型上下文协议 (MCP) 服务器实现。它就像一座桥梁,让 AI 助手能够访问和操作存储在 Onspring 实例中的数据,极大地拓展了数据的使用场景。

🚀 快速开始

Onspring MCP 服务器充当 AI 助手与 Onspring 实例之间的桥梁,借助 Model Context Protocol 提供丰富功能,涵盖获取应用程序及其字段列表、检索记录、运行查询、访问报告数据以及获取附件文件等。

✨ 主要特性

  • 获取应用程序及其字段的列表
  • 从应用程序中检索记录
  • 对应用程序运行查询
  • 访问报告数据
  • 从附件字段中检索文件

📦 安装指南

先决条件

  • Node.js
  • 带有 API 访问权限的 Onspring 实例
  • 具备适当权限的 Onspring API 密钥

安装步骤

  1. 全局安装包:
npm install -g onx-mcp-server

或直接使用 npx:

npx onx-mcp-server

从源代码构建

如果需要从源代码构建:

# 克隆仓库
git clone https://github.com/your-username/onx-mcp-server.git
cd onx-mcp-server

# 安装依赖项
npm install

# 构建项目
npm run build

# 启动服务器
npm start

💻 使用示例

要使用该服务器,您需要在选择的 MCP 客户端中进行配置。每个 MCP 客户端应提供有关设置 MCP 服务器的说明。同时,请确保所需的环境变量已正确设置。更多详细信息请参见 配置 部分。

📚 详细文档

配置

服务器要求以下环境变量已设置: | 变量名称 | 描述 | 默认值 | | ----------------- | -------------------------- | ------------------------- | | ONSPRING_API_KEY | 您的 Onspring API 密钥 | (必填) | | ONSPRING_BASE_URL | Onspring API 的基础 URL | https://api.onspring.com |

连接至 Claude Desktop

Claude Desktop 是一个流行的 MCP 客户端。要将 Onspring MCP 服务器连接到 Claude Desktop,请按照以下步骤操作:

  1. 找到 claude_desktop_config.json 文件。有关如何找到此文件的更多信息,请参考 针对 Claude Desktop 用户 的文档。
  2. 使用文本编辑器打开 claude_desktop_config.json 文件,并添加以下内容:
{
  "servers": [
    {
      "url": "http://localhost:3001"
    }
  ]
}

🔧 技术细节

设置开发环境

# 安装依赖项
npm install

# 在开发模式下运行(监视更改)
npm run dev

测试

项目使用 Vitest 进行测试:

# 运行测试
npm test

# 带有覆盖率的测试
npm run test:coverage

# 带 UI 的测试
npm run test:ui

检查服务器

您可以使用 MCP 监视器来测试服务器:

npm run inspect

📄 许可证

该项目根据 MIT License 发布 - 详情请参见 LICENSE.md 文件。

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