Merge pull request #198 from yunyingk/codex/seal-use-tool-names
Shorten the MCP gateway tool names to seal_use and seal_use_write
This commit is contained in:
4 files changed
+14
-14
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
## Project Structure & Module Organization
|
||||
|
||||
This is a Bun + TypeScript toolkit for the `seal-use` CLI and a local stdio MCP server (`seal-use mcp`). Entry points are `src/cli.ts`, `src/server.ts`, and `src/probe.ts`. Shared config, auth, token, and HTTP code is under `src/core/`. Seal-specific API and logic is under `src/domains/seal/`; the capability registry under `src/domains/seal/capabilities/` holds the shared handlers dispatched by the CLI (`runCapability`) and allow-listed by the MCP gateways. Capability IDs are camelCase internal registry identifiers (for example `sealApprovalContextGet`) — the MCP surface only ever exposes the `seal_use_mcp` / `seal_use_mcp_write` gateway pair, never these names (see README "One registry, two doors").
|
||||
This is a Bun + TypeScript toolkit for the `seal-use` CLI and a local stdio MCP server (`seal-use mcp`). Entry points are `src/cli.ts`, `src/server.ts`, and `src/probe.ts`. Shared config, auth, token, and HTTP code is under `src/core/`. Seal-specific API and logic is under `src/domains/seal/`; the capability registry under `src/domains/seal/capabilities/` holds the shared handlers dispatched by the CLI (`runCapability`) and allow-listed by the MCP gateways. Capability IDs are camelCase internal registry identifiers (for example `sealApprovalContextGet`) — the MCP surface only ever exposes the `seal_use` / `seal_use_write` gateway pair, never these names (see README "One registry, two doors").
|
||||
|
||||
The repository doubles as a ZCode plugin: `.zcode-plugin/plugin.json` declares a skills-only plugin manifest and the agent skill lives under `skills/seal-use/`. The plugin ships no MCP surface; the local MCP runs from the CLI (`seal-use mcp`, or the `mcp-config` snippet for Cursor/Claude Desktop). The in-repo `.agents/skills/seal-use` symlink has been dropped; workspace and Codex skill loading use the global `~/.agents/skills/seal-use` copy installed by `seal-use skill install`.
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ The canonical plugin skill lives at `skills/seal-use`. There is no in-repo `.age
|
||||
|
||||
The repository is also a ZCode plugin. Install `seal-use` from the `yingqing-plugins` marketplace in **Settings → Plugin Management**, or add this repository as a local plugin directory while developing. The plugin ships the `skills/seal-use` skill; it has no MCP surface. For MCP locally, paste the snippet from `seal-use mcp-config` into your host — it starts `seal-use mcp` with `SEAL_USE_MCP_ENABLED=true`, which the server needs before it exposes any tool.
|
||||
|
||||
The plugin exposes no MCP tools. The `seal_use_mcp` / `seal_use_mcp_write` tools exist only on the local MCP server started by `seal-use mcp` (or by whatever host consumes the `mcp-config` snippet), where they accept the same command syntax as the global CLI.
|
||||
The plugin exposes no MCP tools. The `seal_use` / `seal_use_write` tools exist only on the local MCP server started by `seal-use mcp` (or by whatever host consumes the `mcp-config` snippet), where they accept the same command syntax as the global CLI.
|
||||
|
||||
For a standalone compiled CLI, build and run the binary from a checkout:
|
||||
|
||||
@@ -224,14 +224,14 @@ All approval/logic lives once in the capability registry under `src/domains/seal
|
||||
| Surface | Entry | Naming |
|
||||
| --- | --- | --- |
|
||||
| CLI (primary) | `seal-use <area> <verb>` via `runCapability` | Kebab verbs: `seal-use context`, `seal-use rules get` |
|
||||
| Local MCP server | `seal_use_mcp` / `seal_use_mcp_write` gateways that execute a CLI command string | Gateway names only — the registry IDs are the allow-list, never advertised as tools |
|
||||
| Local MCP server | `seal_use` / `seal_use_write` gateways that execute a CLI command string | Gateway names only — the registry IDs are the allow-list, never advertised as tools |
|
||||
|
||||
Internally, capability IDs are camelCase (for example `sealApprovalContextGet`): they are dispatch IDs inside the codebase and they are **not** MCP tool names — no MCP client will ever see them in `tools/list`. If you are reading code and an internal capability ID looks like it should be an MCP tool, that instinct is the trap this note exists to prevent; check `src/server.ts` for the actual (two-gateway) MCP surface.
|
||||
|
||||
The MCP server exposes two tools — and only when `SEAL_USE_MCP_ENABLED=true`, which is what the `seal-use mcp-config` snippet carries; without that flag `tools/list` answers with an empty list:
|
||||
|
||||
- `seal_use_mcp` runs read-only commands and refuses anything that mutates tenant state, self-updates, or starts a server.
|
||||
- `seal_use_mcp_write` runs the same dispatcher with mutating commands available; confirm the exact command with the user before calling it.
|
||||
- `seal_use` runs read-only commands and refuses anything that mutates tenant state, self-updates, or starts a server.
|
||||
- `seal_use_write` runs the same dispatcher with mutating commands available; confirm the exact command with the user before calling it.
|
||||
|
||||
Both take the command as a string:
|
||||
|
||||
@@ -245,7 +245,7 @@ Both run the same CLI dispatcher as the global binary, so `config` and `update`
|
||||
|
||||
## CLI-First Architecture
|
||||
|
||||
All Agent and automation capabilities are accessed through standard `seal-use <command>` CLI invocations (or through the `seal_use_mcp` / `seal_use_mcp_write` MCP tools passing the command string). Internal domain services output pure, parseable JSON on `stdout`, with human diagnostics and suggestions routed to `stderr`.
|
||||
All Agent and automation capabilities are accessed through standard `seal-use <command>` CLI invocations (or through the `seal_use` / `seal_use_write` MCP tools passing the command string). Internal domain services output pure, parseable JSON on `stdout`, with human diagnostics and suggestions routed to `stderr`.
|
||||
|
||||
Key CLI command groups:
|
||||
- **`seal-use corps ...`**: enterprise tenant management, onboarding, switching, and assistance link intake.
|
||||
@@ -287,7 +287,7 @@ When `_langfuseTraceId` exists, downstream tools should fetch the trace directly
|
||||
- Prefer Bun-native commands in this repository: `bun run check`, `bun test`, and `seal-use ...`. `npm run check` may work, but Bun is the project runtime and lockfile owner.
|
||||
- Keep CLI entry points thin. Shared behavior belongs in `src/core` and `src/domains`; `src/cli.ts` should only handle command parsing, process lifecycle, and JSON output.
|
||||
- Do not print diagnostic text to stdout from the MCP server. MCP uses stdout as the protocol stream; use stderr for server diagnostics.
|
||||
- Keep the MCP exported surface to the `seal_use_mcp` (read-only) and `seal_use_mcp_write` (mutating) pair; command knowledge belongs in this skill and its focused references.
|
||||
- Keep the MCP exported surface to the `seal_use` (read-only) and `seal_use_write` (mutating) pair; command knowledge belongs in this skill and its focused references.
|
||||
- Prefer CLI or script processing for large tool responses. For daily approval questions, call `seal-use approval-runs summary --corp <corpId> ...` instead of reading long `approval-runs search` output manually.
|
||||
- Keep broad search tools compact by default. Add explicit opt-in flags such as `includeBridge` for verbose fields that are useful only in deeper debugging.
|
||||
- When Seal API timestamp filters are uncertain, filter again in tool code by `createdAt` and explicit timezone before presenting date-based answers.
|
||||
|
||||
@@ -31,15 +31,15 @@ export type SealCapability = (typeof sealCapabilities)[number];
|
||||
* Registry naming boundary: these entries are INTERNAL domain capability handlers, NOT MCP tools.
|
||||
* The camelCase `sealXxx` strings are identifiers for internal dispatch (`runCapability`) and for
|
||||
* the MCP gateway allow-lists below — the MCP server itself only ever exposes the
|
||||
* `seal_use_mcp` / `seal_use_mcp_write` gateway pair and never these names. CLI verbs such as
|
||||
* `seal_use` / `seal_use_write` gateway pair and never these names. CLI verbs such as
|
||||
* `seal-use context` are the only human-facing names (see README "One registry, two doors").
|
||||
*
|
||||
* MCP read/write classification for the capability registry.
|
||||
*
|
||||
* The two sets are exhaustive by construction: `capabilities.test.ts` asserts they partition `sealCapabilities`
|
||||
* exactly, so a newly added capability fails the suite until it is classified here. The read-only MCP tool
|
||||
* (`seal_use_mcp`) may only invoke names in {@link SEAL_READ_ONLY_CAPABILITIES}; everything else is reachable
|
||||
* solely through `seal_use_mcp_write`.
|
||||
* (`seal_use`) may only invoke names in {@link SEAL_READ_ONLY_CAPABILITIES}; everything else is reachable
|
||||
* solely through `seal_use_write`.
|
||||
*
|
||||
* Read-only means it reads tenant state, or writes only a local file. Anything that creates, updates,
|
||||
* deletes, publishes, pushes, replays, uploads, activates or mints a credential counts as mutating —
|
||||
|
||||
+4
-4
@@ -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_USE_MCP_TOOL_NAME = "seal_use_mcp";
|
||||
export const SEAL_USE_MCP_WRITE_TOOL_NAME = "seal_use_mcp_write";
|
||||
export const SEAL_USE_MCP_TOOL_NAME = "seal_use";
|
||||
export const SEAL_USE_MCP_WRITE_TOOL_NAME = "seal_use_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_use_mcp is switched off by configuration.
|
||||
// method-not-found error) when seal_use is switched off by configuration.
|
||||
capabilities: { tools: {} }
|
||||
}
|
||||
);
|
||||
@@ -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_use_mcp disabled by configuration"
|
||||
: "seal-use MCP server connected with seal_use disabled by configuration"
|
||||
);
|
||||
return handle;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user