Skip to content

fix(mcp): correct tool annotations, unbreak writes, add console tools - #17

Merged
chalabi2 merged 1 commit into
mainfrom
chalabi/mcp-spec-console
Jul 29, 2026
Merged

chalabi2 merged 1 commit into
mainfrom
chalabi/mcp-spec-console

Conversation

@chalabi2

Copy link
Copy Markdown
Contributor

Three things were wrong with the MCP server, none visible from the outside.

1. Every tool was advertised as destructive

Annotations were never set anywhere in internal/mcp, so the MCP spec defaults applied — destructiveHint=true, readOnlyHint=false. All 19 tools were read-only queries:

marked readOnlyHint=true:    0 / 19
marked destructiveHint=true: 19 / 19

Clients decide what to auto-approve from those hints, so a balance check looked exactly as dangerous as closing a deployment — and there was no signal left to distinguish the two. The policy now lives at registration (addQueryTool vs addWriteTool), so a tool can't drift from the set it was registered into.

2. --enable-writes could not start at all

failed to create MCP server: failed to create chain client: invalid sign mode "". expected direct|direct-aux|amino-json|eip-191

The command installs no tx flags, so SignModeStr was never set and the write client failed to build. The write half of the server had never run. Now defaults to what the flag would have supplied.

3. The Console rail had no tools

A managed (console-api) context reaches deployments, wallet, providers and pricing through the Console API rather than a chain node — so an assistant working against one had nothing to call. Adds 8 read tools and 2 write tools, registered only when a key resolves.

Verification

  • Unit tests pin the annotation policy, including that read and write sets must differ
  • e2e drives the real stdio server with JSON-RPC and asserts over tools/list — confirmed it fails without the sign-mode fix (invalid sign mode "")
  • Against the live Console API: 27 tools register (8 console), and console_wallet_balance / console_list_deployments return real data through tools/call

Three things were wrong with the MCP server, none of them visible from
the outside.

Annotations were never set, so the MCP spec defaults applied: every tool
advertised destructiveHint=true and readOnlyHint=false. All 19 were
read-only queries. Clients decide what to auto-approve from those hints,
so a balance check looked exactly as dangerous as closing a deployment,
and there was no signal left to distinguish the two. The policy now lives
at registration -- addQueryTool vs addWriteTool -- so a tool cannot drift
from the set it was registered into.

--enable-writes could not start at all. The command installs no tx flags,
so the sign mode was never set and building the write client failed with
'invalid sign mode ""'. The write half of the server had therefore never
run. Default it to the value the flag would have supplied.

The Console rail had no tools. A managed context reaches deployments,
wallet, providers and pricing through the Console API rather than a chain
node, so an assistant working against one had nothing to call. Adds eight
read tools and two write tools, registered only when a key resolves --
otherwise every call would fail on auth.

Verified against the live Console API: the tools register, and
console_wallet_balance and console_list_deployments return real data
through tools/call.

Signed-off-by: Joseph Chalabi <chalabi.joseph@gmail.com>
@chalabi2
chalabi2 force-pushed the chalabi/mcp-spec-console branch from 637cac5 to a37b36c Compare July 29, 2026 16:49
@chalabi2
chalabi2 merged commit 431e66c into main Jul 29, 2026
@chalabi2
chalabi2 deleted the chalabi/mcp-spec-console branch July 29, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants