Camel-case capability IDs and rename the MCP gateway pair

This commit is contained in:
gitea committed 2026-09-30 16:17:33 +08:00
1 parent 7f36cd1d39
commit 4f0d955e06
41 files changed
+466 -466

No files matched your search

+8 -8
View File
@@ -3,8 +3,8 @@ import { Client, InMemoryTransport } from "@modelcontextprotocol/client";
import {
createServer,
resolveMcpEnabled,
SEAL_CLI_TOOL_NAME,
SEAL_CLI_WRITE_TOOL_NAME,
SEAL_USE_MCP_TOOL_NAME,
SEAL_USE_MCP_WRITE_TOOL_NAME,
SEAL_MCP_ENABLED_ENV,
tokenizeCommand
} from "./server.js";
@@ -52,7 +52,7 @@ describe("seal-use MCP server", () => {
]);
const listed = await client.listTools();
expect(listed.tools.map((tool) => tool.name)).toEqual([SEAL_CLI_TOOL_NAME, SEAL_CLI_WRITE_TOOL_NAME]);
expect(listed.tools.map((tool) => tool.name)).toEqual([SEAL_USE_MCP_TOOL_NAME, SEAL_USE_MCP_WRITE_TOOL_NAME]);
expect(listed.tools[0]?.inputSchema).toMatchObject({
type: "object",
required: ["command"],
@@ -74,7 +74,7 @@ describe("seal-use MCP server", () => {
});
const result = await client.callTool({
name: SEAL_CLI_TOOL_NAME,
name: SEAL_USE_MCP_TOOL_NAME,
arguments: { command: "seal-use version" }
});
const content = result.content as Array<{ type: "text"; text: string }>;
@@ -86,7 +86,7 @@ describe("seal-use MCP server", () => {
}
const invalid = await client.callTool({
name: SEAL_CLI_TOOL_NAME,
name: SEAL_USE_MCP_TOOL_NAME,
arguments: { command: "not-a-command" }
});
expect(invalid.isError).toBe(true);
@@ -94,7 +94,7 @@ describe("seal-use MCP server", () => {
const errorText = invalidContent[0];
expect(errorText?.type).toBe("text");
if (errorText?.type === "text") {
expect(errorText.text).toContain(SEAL_CLI_WRITE_TOOL_NAME);
expect(errorText.text).toContain(SEAL_USE_MCP_WRITE_TOOL_NAME);
}
} finally {
await Promise.allSettled([client.close(), server.close()]);
@@ -107,7 +107,7 @@ describe("seal-use MCP server", () => {
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
const callRead = async (command: string) => {
const result = await client.callTool({ name: SEAL_CLI_TOOL_NAME, arguments: { command } });
const result = await client.callTool({ name: SEAL_USE_MCP_TOOL_NAME, arguments: { command } });
const content = result.content as Array<{ type: "text"; text: string }>;
return { isError: result.isError, text: content[0]?.text ?? "" };
};
@@ -167,7 +167,7 @@ describe("seal-use MCP server", () => {
]);
const result = await client.callTool({
name: SEAL_CLI_WRITE_TOOL_NAME,
name: SEAL_USE_MCP_WRITE_TOOL_NAME,
arguments: { command: "seal-use corps mark missing-corp --env production --confirm" }
});
const content = result.content as Array<{ type: "text"; text: string }>;