-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
27 lines (23 loc) · 944 Bytes
/
index.ts
File metadata and controls
27 lines (23 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { SERVER_NAME, SERVER_VERSION } from "./src/types/index.js";
import { registerPublicTools } from "./src/tools/publicTools.js";
import { registerAuthStatsTools } from "./src/tools/auth/auth_statsTools.js";
import { registerAuthMsgTools } from "./src/tools/auth/auth_msgTools.js";
/**
* 神岛MCP服务器
* 提供用户资料、地图数据、统计等API访问能力
*/
const server = new McpServer({
name: SERVER_NAME,
version: SERVER_VERSION,
});
// 注册公开API工具(不需要认证)
registerPublicTools(server);
// 注册需要认证的API工具-统计
registerAuthStatsTools(server);
// 注册需要认证的API工具-消息
registerAuthMsgTools(server);
// 连接并启动服务器
const transport = new StdioServerTransport();
await server.connect(transport);