* packages: simplex-chat MCP server * update * standing approvals per chat, leave tool, simplify * fixes * add error messages * LICENSE * specification * migration * update simplex-chat, tests, fixes * update simplex-chat libraries * use agent peer type * better server and tool descriptions * short readme * reference * images * update readme * update readme * update * change links to master * fix links to point to master branch --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
9.1 KiB
Testing @simplex-chat/mcp v0.1
Node.js 22. Claude Code runs on the same computer as serve: the server listens on 127.0.0.1 only.
Build
Here
All commands run in /code/simplex-chat-6/packages/simplex-chat-mcp. The dependencies are installed by npm install; simplex-chat comes from npm and downloads libsimplex and its Node.js add-on to ~/.cache/simplex-chat at the first start.
node node_modules/typescript/bin/tsc
node node_modules/jest/bin/jest.js test/unit # about 10 s
SMP_SERVER=/code/steward/node_modules/.cache/smp-server/smp-server-v7.1.0-beta.3 node node_modules/jest/bin/jest.js test/e2e # about 3 minutes; a local smp-server on a free port
node_modules is not writable here, so the end-to-end test takes the smp-server binary from SMP_SERVER instead of downloading it to node_modules/.cache.
On your own machine
- Check out simplex-chat master; the package is
packages/simplex-chat-mcp. - In that folder:
npm install, thennpx tsc.tscleaves the output of deleted sources indist;npm packandnpm publishdeletedistfirst and build it again (scriptprepack). node dist/cli.js serve my-agent --display-name "My Agent". At the first start,simplex-chatdownloads libsimplex and its Node.js add-on, with aDownloading ...line each on stderr.- Tests:
npx jest test/unit;npx jest test/e2edownloads smp-server v7.1.0-beta.3 on Linux, and elsewhere takesSMP_SERVER=/path/to/smp-server.
Until the package is published, the printed hint npx -y @simplex-chat/mcp register my-agent stands for node dist/cli.js register my-agent.
Start, join, register
node dist/cli.js serve my-agent --display-name "My Agent". NAME, heremy-agent, names the data folder and the Claude Code entry;--display-nameis the name people see in SimpleX. It prints the data folder (~/.simplex-mcp/my-agent), creates the agent control chat "My Agent", and prints a QR code and a link that works once. For a short link the QR code has 33 modules and takes 37 columns × 19 lines;--qr-code largeprints it at 74 × 37. Keep it running; Ctrl-C stops it.node dist/cli.js --helplists the options.- In the SimpleX app, scan the QR code, or paste the link into "Connect via link". If the code does not scan, restart with
--qr-code large. The chat "My Agent" appears withI'm your agent. I ask here before I connect or send.The terminal printsAlice joined (member N) and is now an owner. The link is deleted.and the register hint. node dist/cli.js register my-agent. It printsAdded to Claude Code: scope user, server simplex-my-agent.Run it in a terminal with the sameCLAUDE_CONFIG_DIRas the one whereclauderuns:claude mcp add-jsonwrites to the config of its own environment.- Add
"mcp__simplex-my-agent"topermissions.allowin~/.claude/settings.json, so Claude Code does not prompt for each call; approval happens in the SimpleX app. - Start
claude./mcpshowssimplex-my-agentconnected with 5 tools. A session started beforeregisterdoes not load the entry; start a new one.
Try the tools
Prompts for Claude Code, one at a time. A call that waits more than 2 minutes, for example for an approval, moves to a background task, and its result arrives as a notification.
By name, first:
Connect to @directory.simplex as yourself.While the name is not registered: the tool errorName not found: This SimpleX name is not registered. Please check the name., and no card. Once it is registered: the cardI want to connect to bot SimpleX Directory (@directory.simplex), as myself.; after the approval, step 1 below returnsstatus: known, with no card.
The directory by its address (docs/DIRECTORY.md):
Connect to the SimpleX Directory as yourself at https://smp4.simplex.im/a#lXUjJW5vHYQzoLYgmi8GbxkGP41_kjefFvBrdwg-0Ok and tell me which commands it advertises.Card:I want to connect to bot SimpleX Directory, as myself.Tap/approve 1. The card becomesI connected to ...withApproved by Alice.; Claude getsstatus: done, the chat@N,commandsand the welcome message.Search the directory for hiking groups.Card:I want to send a message to bot SimpleX Directory:with the text. Approve it; Claude gets the bot's answers inresponses.Send /help to the directory.A bot command is sent as text.Check for new messages from the directory, waiting up to 60 seconds.receivewithwait.List your chats and pending actions.list.- Reject one card with its
/reject @N A: the call returnsstatus: rejected; the card ends withRejected by Alice./pendinglists the waiting cards.
Approval of all messages to a chat, and leaving:
Search the directory for Monero groups.On the card, tap/approve @N all. The reply isApproved for bot SimpleX Directory (@N) by Alice. /revoke @N, and the search is sent.Send /help to the directory.It is sent without a card; the agent control chat then getsI sent a message to bot SimpleX Directory:,`/help`andApproved for this chat by Alice. /revoke @N.listshowsapproved: truefor the directory.- Tap
/listin the command menu: one line per chat; the directory's line ends with, approved for this chat by Alice. - Tap
/revoke @N:Messages to bot SimpleX Directory (@N) need approval again.The next send gets a card. Leave the directory.Card:I want to delete bot SimpleX Directory (@N).Approve it: the call returnsstatus: done, andlistno longer shows the directory.- Join a group from the search results, then
Leave that group.Card:I want to leave group <name> (#N).Approve it: the members see that the agent left.
A channel:
Search the directory for channels about trail running.Take a channel link from the answers.Connect to <the channel link> as yourself.Card:I want to connect to channel <name>, as myself.Approve it; Claude getstype: channel,role: observerand the recent posts inmessages.Wait up to 10 minutes for a new post in that channel.receivewithwaitreturns the next post.
Incognito, as a second agent, because the first one already knows the directory:
node dist/cli.js serve scout --display-name "Scout" --port 5227; join its control chat "Scout" with the printed link;node dist/cli.js register scout; add"mcp__simplex-scout"topermissions.allow;/mcp reconnect all.Using simplex-scout, connect to the directory incognito: https://smp4.simplex.im/a#lXUjJW5vHYQzoLYgmi8GbxkGP41_kjefFvBrdwg-0OkCard:I want to connect to bot SimpleX Directory, incognito.Approve it; Claude getsknown_as, a random name.Using simplex-scout, list your chats.The directory hasincognito: trueand the sameknown_as. A send card for it sayswhere I am incognito.
Stop and restart:
- Stop the server while a card waits: the card ends with
Cancelled: the server stopped.After a restart,/approveof that number repliesAction N is not pending., and the next card has the next number. - A second
serve my-agenton the same data folder exits withAnother server uses ... (PID N).A port in use exits withPort 5226 is in use. Start with --port N., before any link is printed. - Restart with
--new-token, withoutregister: after the reconnection,listreturns the chats. Checked withclaude -pand an--mcp-configentry withheadersHelper, Claude Code 2.1.302, 2026-10-18.
Claude Code checks
- C2, protocol: passed with Claude Code 2.1.302 in the default runtime, with
MCP_PROTOCOL_NEGOTIATION=legacyand withMCP_SDK_GENERATION=v1. To repeat it, writec2.jsonwith{"mcpServers": {"simplex-my-agent": {"type": "http", "url": "http://127.0.0.1:5226/mcp", "headersHelper": "cat <your home folder>/.simplex-mcp/my-agent/headers.json"}}}, and run it once as is and once with each variable before it:Each run shows the chats, with the preset contact "Ask SimpleX Team".claude -p "Call the list tool and show its result." --strict-mcp-config --mcp-config c2.json --allowedTools mcp__simplex-my-agent - C3, subagent:
Use a subagent to send "trail shoes" to the directory.While the card waits, the subagent's call stays in the foreground, with no background task; it returns after/approve. - C4, reconnect: restart
serve my-agent; in the running session,/mcp reconnect all;listreturns the chats. - C5, register again:
node dist/cli.js register my-agentprintsAdded to Claude Code: scope user, server simplex-my-agent.;claude mcp listshows onesimplex-my-agent. - C6, Esc: ask for a send, and press Esc while its card waits;
List your pending actions.shows the action withopen: false; the same request again attaches to it, and/approvereturns the result to that call. - Host mode: restart with
node dist/cli.js serve my-agent --approve host, then/mcp reconnect all.Send /help to the directory.makes Claude Code prompt, despite the allow rule; so doesleave. After you allow it, the agent control chat getsI sent a message to bot SimpleX Directory:,`/help`andPerformed without approval (mode host).Aconnectto a link not yet joined gets the same prompt and an outcome card; a target already joined returnsstatus: known, with no card.