diff --git a/packages/accounting_automation/src/mcp.ts b/packages/accounting_automation/src/mcp.ts index 9a212e0..10fcd50 100644 --- a/packages/accounting_automation/src/mcp.ts +++ b/packages/accounting_automation/src/mcp.ts @@ -703,7 +703,10 @@ const rpcError = (id: unknown, code: number, message: string): Json => ({ jsonrp /** Обрабатывает одно JSON-RPC сообщение от аутентифицированного человека; null - уведомление (ответа нет). */ const SUPPORTED_VERSIONS = ["2026-07-28", "2025-11-25", "2025-06-18", "2025-03-26"]; -const SERVER_INFO = { name: "accounting_automation", version: "0.1.0" }; +/** Иконка коннектора (MCP serverInfo.icons): у каждого MCP KH Build свой цвет и знак, чтобы не путать их в списке коннекторов. */ +const MCP_ICON = "data:image/svg+xml," + encodeURIComponent('$'); +const MCP_ICONS = [{ src: MCP_ICON, mimeType: "image/svg+xml", sizes: ["any"] }]; +const SERVER_INFO = { name: "accounting_automation", title: "KH Build: бухгалтерия", version: "0.1.0", icons: MCP_ICONS }; const CAPABILITIES = { tools: { listChanged: true }, resources: {}, prompts: {}, extensions: { "io.modelcontextprotocol/ui": { mimeTypes: [REVIEW_UI_MIME] } } }; /** Подсказки кэширования (2026-07-28) для списков, discover и ресурсов; во всех результатах resultType: "complete". */ diff --git a/packages/khbuild_assistant_prep/src/mcp-agents.ts b/packages/khbuild_assistant_prep/src/mcp-agents.ts index 6e942f1..4f6c63c 100644 --- a/packages/khbuild_assistant_prep/src/mcp-agents.ts +++ b/packages/khbuild_assistant_prep/src/mcp-agents.ts @@ -1,6 +1,10 @@ import { createPublicKey, createVerify, timingSafeEqual, type JsonWebKey } from "node:crypto"; import type { FastifyInstance } from "fastify"; import type { Pool } from "khb_common"; + +/** Иконка коннектора (MCP serverInfo.icons): у каждого MCP KH Build свой цвет и знак, чтобы не путать их в списке коннекторов. */ +const MCP_ICON = "data:image/svg+xml," + encodeURIComponent('AI'); +const MCP_ICONS = [{ src: MCP_ICON, mimeType: "image/svg+xml", sizes: ["any"] }]; import { chunkOf, fullTextStore, type FullTextStore } from "./fulltext.js"; /** @@ -191,7 +195,7 @@ export async function handleMcpRequest(req: RpcReq, tools: McpTool[], serverName return ok({ protocolVersion: typeof req.params?.protocolVersion === "string" ? req.params.protocolVersion : "2025-03-26", capabilities: { tools: {} }, - serverInfo: { name: serverName, version: "1.0.0" }, + serverInfo: { name: serverName, title: "KH Build: агенты (mcp_for_agents)", version: "1.0.0", icons: MCP_ICONS }, instructions: "Чтение данных сервиса агентов без ограничений по размеру: read_full_text (полный текст по ref из пометки ОБРЕЗАНО), read_slack_message, agent_issues.", }); case "ping": diff --git a/packages/todo_service/src/mcp.ts b/packages/todo_service/src/mcp.ts index d7369d1..fc023f5 100644 --- a/packages/todo_service/src/mcp.ts +++ b/packages/todo_service/src/mcp.ts @@ -1,4 +1,8 @@ import { HttpError, type TodoCore } from "./core.js"; + +/** Иконка коннектора (MCP serverInfo.icons): у каждого MCP KH Build свой цвет и знак, чтобы не путать их в списке коннекторов. */ +const MCP_ICON = "data:image/svg+xml," + encodeURIComponent(''); +const MCP_ICONS = [{ src: MCP_ICON, mimeType: "image/svg+xml", sizes: ["any"] }]; import type { Caller } from "./access.js"; /** MCP (Streamable HTTP, без сессий): тонкий адаптер над тем же ядром, что и REST. Реализация JSON-RPC 2.0 вручную. */ @@ -89,7 +93,7 @@ export async function handleMcpMessage(core: TodoCore, caller: Caller, msg: Json switch (method) { case "initialize": { const asked = (msg.params as Json | undefined)?.protocolVersion; - return { jsonrpc: "2.0", id, result: { protocolVersion: typeof asked === "string" ? asked : "2025-03-26", capabilities: { tools: {} }, serverInfo: { name: "khb-todo", version: "0.1.0" } } }; + return { jsonrpc: "2.0", id, result: { protocolVersion: typeof asked === "string" ? asked : "2025-03-26", capabilities: { tools: {} }, serverInfo: { name: "khb-todo", title: "KH Build: задачи (To-do)", version: "0.1.0", icons: MCP_ICONS } } }; } case "ping": return { jsonrpc: "2.0", id, result: {} };