mcp server supos
An MCP protocol server that provides access to supOS open APIs, allowing MCP-compatible clients to query topic tree structures and details.
An MCP protocol server that provides access to supOS open APIs, allowing MCP-compatible clients to query topic tree structures and details.
本MCP服务器是基于 Model Context Protocol (MCP) 协议提供的 typescript-sdk
进行开发,可以让任何支持MCP协议的客户端使用它。
它提供了一系列supOS的open-api,例如:查询topic树结构,topic详情等。
get-model-topic-tree
key
(string): Fuzzy search keyword for child nodesshowRec
(boolean): Number of records to displaytype
(string): Search type: 1--Text search, 2--Tag search返回: topic 树结构菜单数据
get-model-topic-detail
topic
(string): The topic path corresponding to the modelget-topic-realtime-data
topic
(string): The topic path corresponding to the modelget-all-topic-realtime-data
接下来跟随文档一起使用吧
目前支持MCP协议的客户端已有很多,比如桌面端应用 Claude for Desktop
,或者IDE的一些插件等(VSCode
的 Cline
插件),想了解已支持的客户端可访问 Model Context Protocol Client。
这里以 Claude for Desktop
为例。
- 下载 Claude for Desktop。
- 为 Claude for Desktop
配置所需的MCP 服务器。
Claude for Desktop
配置:~/Library/Application Support/Claude/claude_desktop_config.json
。File -> Setting -> Developer
点击 Edit Config
找到该配置文件位置:
claude_desktop_config.json
中,并重启应用:{
"mcpServers": {
"supos": {
"command": "npx",
"args": [
"-y",
"mcp-server-supos"
],
"env": {
"SUPOS_API_KEY": "<API_KEY>",
"SUPOS_API_URL": "<API_URL>",
"SUPOS_MQTT_URL": "<MQTT_URL>"
}
}
}
}
- - 其中 API_URL
是可访问的supOS社区版地址。API_KEY
可通过登录社区版后,进入 DataModeling -> 查看某个具体的topic详情 -> Data Operation -> Fetch
,找到对应的ApiKey复制即可,MQTT_URL
可通过访问 UNS -> MqttBroker -> Listeners
查看可订阅的地址。
注意:以上配置MCP服务器是借助 npx
拉取 mcp-server-supos
npm包并在本地运行的方式给客户端提供服务。但 npx
在 Windows
系统下读取环境变量 env
配置时可能会出错,因此可以采用下面方式解决:
以下两种方式选择一种即可:
本地安装 mcp-server-supos
,并通过node运行
Install
npm install mcp-server-supos -g
找到安装的包路径,例如: "C://Users//<USER_NAME>//AppData//Roaming//npm//node_modules//mcp-server-supos//dist//index.js"
修改 claude_desktop_config.json
的配置,并重启应用
{
"mcpServers": {
"supos": {
"command": "node",
"args": [
"C://Users//<USER_NAME>//AppData//Roaming//npm//node_modules//mcp-server-supos//dist//index.js"
],
"env": {
"SUPOS_API_KEY": "<API_KEY>",
"SUPOS_API_URL": "<API_URL>",
"SUPOS_MQTT_URL": "<MQTT_URL>"
}
}
}
}
下载本仓库源码本地编译执行
复制仓库:
git clone https://github.com/FREEZONEX/mcp-server-supos.git
npm ci
npm run build
claude_desktop_config.json
的配置,并重启应用
{
"mcpServers": {
"supos": {
"command": "node",
"args": [
"<本地项目地址>//dist//index.js"
],
"env": {
"SUPOS_API_KEY": "<API_KEY>",
"SUPOS_API_URL": "<API_URL>",
"SUPOS_MQTT_URL": "<MQTT_URL>"
}
}
}
}
以上就是使用该服务的全部教程,配置成功后可在以下面板中看到对应的服务和工具等:
supOS社区版 已集成 CopilotKit
作者开源的 open-mcp-client,并内置了 mcp-server-supos
服务,且支持ts版本的 agent
,源码可访问 supOS-CE-McpClient。
[
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"key": {
"description": "Fuzzy search keyword for child nodes",
"type": "string"
},
"showRec": {
"description": "Is show recommend topic",
"type": "boolean"
},
"type": {
"description": "Search type: 1--Text search, 2--Tag search",
"type": "string"
}
},
"type": "object"
},
"name": "get-model-topic-tree"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"topic": {
"type": "string"
}
},
"required": [
"topic"
],
"type": "object"
},
"name": "get-model-topic-detail"
}
]