feat(cli): enhance update sources, normalize repo, upgrade to MCP 2.0, and bump to v0.6.2

This commit is contained in:
gitea committed 2026-09-05 22:32:39 +08:00
1 parent eaa2b9391f
commit 2865728885
16 files changed
+241 -235

No files matched your search

+4 -8
View File
@@ -1,9 +1,5 @@
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
CallToolRequestSchema,
ListToolsRequestSchema,
} from "@modelcontextprotocol/sdk/types.js";
import { Server } from "@modelcontextprotocol/server";
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
import { z } from "zod";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
@@ -192,7 +188,7 @@ export function createServer(options: { mode?: HoseMcpMode; enabled?: boolean }
const fineGrainedTools = [...authTools, ...platformTools, ...billTools];
// 注册工具列表
server.setRequestHandler(ListToolsRequestSchema, async () => {
server.setRequestHandler("tools/list", async () => {
if (!enabled) {
return { tools: [] };
}
@@ -234,7 +230,7 @@ export function createServer(options: { mode?: HoseMcpMode; enabled?: boolean }
});
// 处理工具调用
server.setRequestHandler(CallToolRequestSchema, async (request) => {
server.setRequestHandler("tools/call", async (request: any) => {
if (!enabled) {
return cliResult({
stdout: "",