Skip to content

add a list_wallets MCP tool - #62

Open
G9NCUE wants to merge 1 commit into
tetherto:mainfrom
G9NCUE:feat/mcp-list-wallets
Open

G9NCUE wants to merge 1 commit into
tetherto:mainfrom
G9NCUE:feat/mcp-list-wallets

Conversation

@G9NCUE

@G9NCUE G9NCUE commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a list_wallets MCP tool. An agent can now see which wallets exist, which is the default, which are unlocked and how much session time is left, then ask the user to unlock before starting a task. It takes no parameters and returns the same shape as wdk wallet list --json. It doesn't start the daemon, and it can't unlock a wallet.

The listing logic moves out of the wallet list command into a new src/actions/wallet.js, shared by the CLI and MCP like the other actions. The README's MCP tools table gets a row for the new tool.

Motivation and Context

Today an agent only learns that a wallet is locked when a call fails with WALLET_NOT_UNLOCKED, and it can't tell how long a session has left. Using a wallet doesn't extend its session, so with the default 5 minutes a session can expire between a preview and the confirmed send.

Related Issue

Closes #60

Type of change

  • New feature (non-breaking change which adds functionality)

Testing

  • npm run lint, npm run typecheck and npm test pass, and so does the full npm run test:integration.
  • New tests/unit/actions/wallet.test.js, and tests/integration/mcp.test.js, which calls the tool through a real MCP client and daemon. These are the first integration tests for the MCP server.
  • wdk wallet list is unchanged: table and --json output matched main with no daemon, with unlocked sessions, with an unreachable daemon, and with no wallets.
  • Breaking the code on purpose was caught by these tests in each of six cases: starting the daemon, removing the fallback when the daemon is down, dropping session times, returning the wrong default flag, renaming the tool, and changing the result shape.

Known limitation

A daemon that is running but doesn't reply within 5 seconds reads as "every wallet locked". wallet list already behaved this way, and I kept it so the command's behaviour doesn't change.

An agent can now see which wallets exist, which are unlocked and how much
session time is left, and ask the user to unlock before starting a task.
The listing logic moves into a shared action, so the CLI and MCP return the
same shape and `wdk wallet list` output doesn't change.

This branch has not been deployed

No deployments
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.

MCP: add a read-only tool to list wallets and their lock state

1 participant