Camel-case capability IDs and rename the MCP gateway pair
This commit is contained in:
1 parent
7f36cd1d39
commit
4f0d955e06
41 files changed
+466
-466
No files matched your search
+10
-10
@@ -14,8 +14,8 @@ const serverEntryFile = fileURLToPath(import.meta.url);
|
||||
// no packaged bundle anymore, so two levels up is always the app root.
|
||||
const pluginRoot = dirname(dirname(serverEntryFile));
|
||||
|
||||
export const SEAL_CLI_TOOL_NAME = "seal_cli";
|
||||
export const SEAL_CLI_WRITE_TOOL_NAME = "seal_cli_write";
|
||||
export const SEAL_USE_MCP_TOOL_NAME = "seal_use_mcp";
|
||||
export const SEAL_USE_MCP_WRITE_TOOL_NAME = "seal_use_mcp_write";
|
||||
export const SEAL_MCP_ENABLED_ENV = "SEAL_USE_MCP_ENABLED";
|
||||
export const LEGACY_SEAL_MCP_ENABLED_ENV = "SEAL_HOME_MCP_ENABLED";
|
||||
|
||||
@@ -35,7 +35,7 @@ export function createServer(options: { enableCli?: boolean } = {}): McpServer {
|
||||
},
|
||||
{
|
||||
// Declared explicitly so that `tools/list` answers with an empty list (rather than a
|
||||
// method-not-found error) when seal_cli is switched off by configuration.
|
||||
// method-not-found error) when seal_use_mcp is switched off by configuration.
|
||||
capabilities: { tools: {} }
|
||||
}
|
||||
);
|
||||
@@ -48,14 +48,14 @@ export function createServer(options: { enableCli?: boolean } = {}): McpServer {
|
||||
});
|
||||
|
||||
server.registerTool(
|
||||
SEAL_CLI_TOOL_NAME,
|
||||
SEAL_USE_MCP_TOOL_NAME,
|
||||
{
|
||||
title: "Run read-only seal-use CLI command",
|
||||
description:
|
||||
"Run a read-only seal-use CLI command and return its JSON stdout. Only commands that " +
|
||||
"read tenant state without changing it are accepted here; anything that mutates tenant " +
|
||||
"state, publishes configuration, mints credentials, self-updates or starts a server is " +
|
||||
`refused — use ${SEAL_CLI_WRITE_TOOL_NAME} for those after confirming with the user.`,
|
||||
`refused — use ${SEAL_USE_MCP_WRITE_TOOL_NAME} for those after confirming with the user.`,
|
||||
inputSchema,
|
||||
annotations: {
|
||||
readOnlyHint: true,
|
||||
@@ -69,7 +69,7 @@ export function createServer(options: { enableCli?: boolean } = {}): McpServer {
|
||||
);
|
||||
|
||||
server.registerTool(
|
||||
SEAL_CLI_WRITE_TOOL_NAME,
|
||||
SEAL_USE_MCP_WRITE_TOOL_NAME,
|
||||
{
|
||||
title: "Run mutating seal-use CLI command",
|
||||
description:
|
||||
@@ -96,7 +96,7 @@ async function executeCliCommand(
|
||||
command: string | undefined,
|
||||
options: { requireReadOnly: boolean }
|
||||
): Promise<CallToolResult> {
|
||||
const toolName = options.requireReadOnly ? SEAL_CLI_TOOL_NAME : SEAL_CLI_WRITE_TOOL_NAME;
|
||||
const toolName = options.requireReadOnly ? SEAL_USE_MCP_TOOL_NAME : SEAL_USE_MCP_WRITE_TOOL_NAME;
|
||||
if (!command?.trim()) {
|
||||
return cliResult({
|
||||
stdout: "",
|
||||
@@ -128,8 +128,8 @@ async function executeCliCommand(
|
||||
return cliResult({
|
||||
stdout: "",
|
||||
stderr:
|
||||
`${SEAL_CLI_TOOL_NAME} only runs read-only commands, and "${cliArgs.join(" ")}" is not one of ` +
|
||||
`them. Confirm the command with the user, then call ${SEAL_CLI_WRITE_TOOL_NAME}.`,
|
||||
`${SEAL_USE_MCP_TOOL_NAME} only runs read-only commands, and "${cliArgs.join(" ")}" is not one of ` +
|
||||
`them. Confirm the command with the user, then call ${SEAL_USE_MCP_WRITE_TOOL_NAME}.`,
|
||||
isError: true,
|
||||
exitCode: 2
|
||||
});
|
||||
@@ -161,7 +161,7 @@ export function startServer(): StdioServerHandle {
|
||||
console.error(
|
||||
enableCli
|
||||
? "seal-use MCP server running on stdio"
|
||||
: "seal-use MCP server connected with seal_cli disabled by configuration"
|
||||
: "seal-use MCP server connected with seal_use_mcp disabled by configuration"
|
||||
);
|
||||
return handle;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user