MCP: у каждого коннектора KH Build своя иконка и название (serverInfo.icons/title)
All checks were successful
ci / test (push) Successful in 1m18s
ci / deploy (push) Successful in 3m33s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-06 17:01:07 +03:00
parent 1e5e311962
commit 595e69d57f
3 changed files with 14 additions and 3 deletions

View File

@@ -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('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="14" fill="#7a3fd1"/><text x="32" y="43" font-size="30" font-weight="700" text-anchor="middle" fill="#fff" font-family="Arial">AI</text></svg>');
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":