* mcp: free memory and disk in the status line
* mcp: free memory and disk in the end line of answers
* mcp: ❗️ after a low part of the end line, RAM below 5%
82 KiB
SimpleX MCP server: reference
README explains how to install and use the plugin.
@simplex-chat/mcp is a local server that gives an AI agent its own presence on the SimpleX network. The agent connects to people, bots, groups, channels and directories, as itself or incognito, sends messages and files, and receives all the responses, with the files people send it. Bots tell it which commands they understand, so every bot on the network becomes a service the agent can use. You supervise the agent from its control chat in SimpleX: it asks there before it connects, sends, downloads a file or leaves, and you approve or reject from your phone with one tap, or approve all its messages to a chat you trust, or all files from it. Six tools cover it: connect, send, receive, download, list, leave. Setup is one command to start the agent, a scan to join its control chat, and one command to add it to Claude Code.
The package is also a Claude Code plugin, which gives each Claude Code session its own SimpleX group. There you prompt the session, approve its actions and tool use, and read its answers, see Claude Code plugin.
What it isn't:
- Not a directory or a search service. The agent reaches chats through links, SimpleX names and the directories it connects to.
- Not a push channel into an agent of
serve. An MCP server can't start a turn of the agent, so news reaches it only as results of calls it makes: waits insidesendandreceive, or polling. The plugin's channel passes your prompts to a running Claude Code session. - Not an always-on service. The agent acts while its session runs; services that must always be up should be bots.
- Not hosted. It runs on your machine, one process per agent.
- Not in v0.3:
- an address for the agent: nobody can contact it first;
- your approval of incoming messages;
- registration in other hosts.
Status: v0.3. TESTING.md describes a local build and test. The design, the tools and the scenarios of serve are in its design record, and the plugin's design is in its plan.
- Requirements
- Quick start
- Owner approval
- Add the agent to Claude Code
- Approval modes
- Expiry
- What the owner sees
- What the agent sees
- Waiting for approval in Claude Code
- Prompt the agent from the app
- Several agents
- Other MCP hosts
- Recovery
- Command reference
- Data folder
- Security
- Claude Code plugin
Requirements
- Node.js 22.
- One of the platforms of the
simplex-chatpackage: Linux x86-64 or arm64, macOS x86-64 or arm64, Windows x86-64. - On Linux x86-64: glibc 2.34 or later, and the system libraries
libcrypto.so.3,libgmp.so.10andlibz.so.1. - The SimpleX Chat app on a phone or computer, for the owner.
- Claude Code; other MCP hosts with Streamable HTTP and custom headers can be configured by hand.
At its first start the server downloads the SimpleX core library, 29 to 50 MB depending on the platform, into ~/.cache/simplex-chat (macOS: ~/Library/Caches/simplex-chat, Windows: %LOCALAPPDATA%\simplex-chat). Unpacked on Linux, it takes about 240 MB.
Quick start
-
Start the agent's server in a terminal and keep it running. NAME, here
my-agent, names the agent's data folder and its entry in Claude Code;--display-nameis the name people see in SimpleX, NAME by default:npx -y @simplex-chat/mcp serve my-agent --display-name "My Agent"The first start prints, after two lines about downloading the SimpleX core library and the Node.js add-on:
SimpleX MCP server 0.3.0, agent "my-agent" Data folder: /home/alice/.simplex-mcp/my-agent Approval mode: requests Agent control chat "My Agent" created. Join the agent control chat in the SimpleX app. The link works once: <QR code> https://smp4.simplex.im/g#... If the QR code does not scan, restart with --qr-code large, or paste the link into the app. Whoever joins by this link becomes an owner of "My Agent" and approves its actions. To approve owners yourself, start with --owners. Listening on http://127.0.0.1:5226/mcp-yanswers npm's prompt to install the package. The server asks no questions: every choice is an option. The QR code of such a link is 37 columns wide and 19 lines high;--qr-code largedraws it twice as wide and twice as high. Ctrl-C stops the server, see Expiry. -
In the SimpleX app, scan the QR code or open the link, and tap Join. The chat "My Agent" appears in the chat list, and the agent writes:
I'm your agent. I ask here before I connect, send, download a file or leave a chat.The terminal prints:Alice joined (member 3) and is now an owner. The link is deleted. Add the agent to Claude Code: npx -y @simplex-chat/mcp register my-agent -
In another terminal, add the agent to Claude Code:
$ npx -y @simplex-chat/mcp register my-agent Added to Claude Code: scope user, server simplex-my-agent. -
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 Code and ask it, for example:
Connect to the SimpleX Directory at https://smp4.simplex.im/a#lXUjJW5vHYQzoLYgmi8GbxkGP41_kjefFvBrdwg-0Ok and search it for trail running shoes.In the chat "My Agent", the agent writes:I want to connect to bot SimpleX Directory, as myself. `Find groups, channels, businesses and bots.` /approve 1 or /reject 1Tap
/approve 1. The agent then asks to send its search, and you approve that too, or tap the card'sallcommand to approve all its messages to the directory. Once the name@directory.simplexis registered, it works as the target too, and the card shows(@directory.simplex).
Without --owners:
- whoever joins by the link becomes an owner of the agent control chat;
- every owner approves actions, including owners added later in the app;
- the link is deleted when the first person joins.
Owner approval
With --owners, only the owners listed in it approve actions. An owner added later in the app approves actions only after the server is restarted with that owner in the list.
-
Start the server with
--ownersand no list:npx -y @simplex-chat/mcp serve my-agent --ownersThe output is the same as in the quick start, with the line
The link adds an observer. Its ID and name are printed when it joins.in place ofWhoever joins by this link .... -
Join the agent control chat in the SimpleX app with the link. The link is deleted. The terminal prints, and the agent posts in the chat:
Alice joined (member 3). Restart the server with --owners 3:AliceUntil the restart, the agent's
connect,send,downloadandleavefail. -
Stop the server with Ctrl-C and start it with the list:
$ npx -y @simplex-chat/mcp serve my-agent --owners 3:Alice Owners: 3:Alice. Add the agent to Claude Code: npx -y @simplex-chat/mcp register my-agent -
To add an owner, add the person to the agent control chat in the app and make them an owner there. The terminal prints, and the agent posts in the chat:
Bob (member 7) is now an owner and can't approve actions yet. Restart the server with --owners 3:Alice,7:BobWhen an owner leaves or is removed, the agent lists the human owners who remain:
Alice (member 3) is no longer an owner. Restart the server with --owners 7:BobWhen none remains:
No owners remain: restart the server with --reset-owners --owners.
In the chat, the --owners ... part of these lines is shown as code, so a member's name in it cannot form a tappable command.
At every start with a list, the server removes the connected members of the agent control chat other than the listed owners.
Add the agent to Claude Code
npx -y @simplex-chat/mcp register my-agent # all Claude Code projects
npx -y @simplex-chat/mcp register my-agent --scope local # the current project only
register NAME reads the agent's port from its data folder, runs claude mcp remove --scope SCOPE simplex-NAME (SCOPE: user, or the --scope value), ignoring a missing entry, and then, for register my-agent:
claude mcp add-json --scope user simplex-my-agent '{"type":"http","url":"http://127.0.0.1:5226/mcp","headersHelper":"cat /home/alice/.simplex-mcp/my-agent/headers.json","timeout":169800000}'
- NAME: 1 to 32 lowercase letters, digits and single hyphens, starting with a letter or digit.
- The entry has no token. At every connection Claude Code runs the
headersHelpercommand and sends the header it prints fromheaders.jsonin the data folder; on Windows the command istype "<folder>\headers.json". With--scope local, Claude Code runs it only in a folder whose trust dialog was accepted. - The agent's tools in Claude Code are
mcp__simplex-my-agent__connectand the rest. timeoutis the expiry plus 24 hours and 10 minutes, in milliseconds: the longest wait for a decision plus the longest wait for responses. After a change of--expireor--port, register the agent again; an agent on another port needs the same--portat every start.- The server must be running when Claude Code starts a session. If a session started before the server, run
/mcp reconnect allin it (Claude Code 2.1.284 or later; earlier, reconnectsimplex-my-agentin/mcp).
Errors:
situation message
never started Agent "my-agent" was never started. Start it with: npx -y @simplex-chat/mcp serve my-agent
claude not on PATH Add this entry under "mcpServers" in ~/.claude.json: {"simplex-my-agent": {...}}
(--scope local: under "projects" > "<project folder>" > "mcpServers")
The token is created at the agent's first start and saved in its data folder; every start writes it to headers.json. serve my-agent --new-token replaces it, and Claude Code sends the new token from its next connection, without a new register.
Approval modes
--approve MODE sets what the owner approves. It is set only by this option.
| Mode | The agent's actions: connect, send, download, leave | Messages to the agent |
|---|---|---|
requests (default) |
Performed after /approve N, or /receive N for a download; a send to a chat approved for all messages at once, with a copy posted in the agent control chat; a download from a chat approved for all files at once, with no post, when the file is on the agent's XFTP servers. |
Passed to the agent. |
host |
Performed at once; a copy is posted in the agent control chat, except for downloads. A download of a file on other servers fails. | Passed to the agent. |
Claude Code's own permission check applies to every tool call too. In mode requests, add the agent's server, for example "mcp__simplex-my-agent", to permissions.allow in ~/.claude/settings.json; otherwise Claude Code prompts for each call, or in auto mode its classifier decides it.
In host mode, approval is left to the MCP host. The server marks connect, send, download and leave with _meta["anthropic/requiresUserInteraction"]: true, so Claude Code shows its permission prompt on every call, in acceptEdits, auto and bypassPermissions modes as well, and allow rules do not skip it. In dontAsk mode and in claude -p runs Claude Code denies these calls.
Expiry
A pending action expires after --expire HOURS, 23 by default and at most: SimpleX allows edits of a message for 24 hours, and the outcome of a pending action is an edit of its card. Cards don't show the time; /pending does. The last line of its card is edited to Expired., and the agent's call returns {"action": N, "status": "expired"}. For the same reason, a connect waits for the other side at most until 23 hours 50 minutes after the action was created.
A result that no call has returned is dropped after the action's expiry time; a repeated call after that creates a new action. At most 20 actions are pending at once; a further connect, send, download or leave fails until the owner decides.
Actions last only while the server runs. When the server stops, the last line of each pending card is edited to Cancelled: the server stopped., and the server waits up to 10 seconds, --stop-wait, for these edits to be sent: it prints Stopping: sending 2 cancelled cards, up to 10 s. Ctrl-C to stop now., and a second Ctrl-C ends the wait. After a restart, /approve of an earlier number replies Action N is not pending., and the agent's repeated call posts a new card. Action numbers continue across restarts.
What the owner sees
All of it is in the agent control chat, posted by the agent's profile. The chat has the agent's display name; to see it under another name in your chat list, set an alias for the chat in the app. Names that are valid display names are shown plain. All other text written by the agent or by peers, other names included, is shown as code, line by line; names and errors take one line. Commands and SimpleX links inside it cannot be tapped: a valid display name cannot contain /, and the app parses each line of a message separately.
My Agent: I want to connect to bot SimpleX Directory (@directory.simplex), as myself.
`Find groups, channels, businesses and bots.`
/approve 1 or /reject 1
My Agent: I want to send a message to business Ridgeline, where I am incognito:
`Is the Talus Trail waterproof?`
/approve #9 4, /approve #9 all or /reject #9 4
My Agent: I want to leave business Ridgeline (#9).
/approve #9 12 or /reject #9 12
My Agent: I want to download a file from Alice in group Builders (#3):
`report.pdf`, 2.4 MB
Servers: `xftp.example.com`, unknown: downloading shows it this computer's IP address.
/receive #3 7, /forward #3 7 or /reject #3 7
The download card of an image or a video shows the sender's preview. Its servers line says Servers: known. when the file is on the agent's XFTP servers; otherwise it names the other servers, which see this computer's IP address during the download, and the card leaves out /receive #3 7 all. The agent waits until the sender finishes the upload before it asks, because the file's servers are known only then. A file without a file description is not downloaded: no card appears, and the agent's call ends with an error. A send with a file names the file's type, full path and size after the text, and shows an image's or video's preview:
My Agent: I want to send a message to group Builders:
`The trail map.`
attaching image `/home/alice/trail.jpg`, 3.1 MB
/approve #3 8, /approve #3 all or /reject #3 8
When the agent asks to send a private key or a file of the server's data folder, the server refuses it and posts Refused to send `/home/alice/.ssh/id_ed25519` to group Builders (#3): private keys and the server's own files are not sent. When the upload of a sent file fails, the agent posts, for example, The file `trail.jpg` was not sent to group Builders (#3): `File server error: Server address is incompatible with network settings.`.; both lines are logged too.
After the decision the card is edited, and its commands removed:
My Agent: I sent a message to business Ridgeline, where I am incognito:
`Is the Talus Trail waterproof?`
Approved by Alice.
Commands:
| Command | Effect |
|---|---|
/approve N, /approve #9 N |
Performs a connect, send or leave action N; the cards of sends and leaves name the chat. |
/reject N, /reject #9 N |
Rejects action N. |
/approve #9 all |
Approves all the agent's messages to chat #9: the pending ones and later ones. |
/revoke #9 |
Ends that approval: each message to #9 needs approval again. |
/receive #3 7 |
The agent receives the file of download 7: the server downloads it, and the agent's call returns its path. |
/receive #3 7 all |
The same, and the agent receives its later downloads from chat #3 of files on its XFTP servers without asking. Other pending downloads of #3 stay pending. |
/receive #3 off |
Ends that: each download from #3 needs approval again. |
/forward #3 7 |
Downloads the file of action 7 and sends it to you in the agent control chat, as a reply to the card when the file's preview and the card fit in one message. The card stays pending, and the agent gets nothing: its messages show the file as offered, without a path. The server keeps the file outside the chat's folder until /receive #3 7, which then uses it. |
/leave #9, /leave @4 |
Makes the agent leave group #9, or delete contact @4, at once, in both approval modes, and rejects the agent's pending actions for that chat. The reply, for example Left business Ridgeline (#9), requested by Alice., is logged too. |
/delete #9 files |
Cancels the running downloads from chat #9, which then fail, also those the core continues after a restart, and deletes the chat's files in the data folder, forwarded ones included, for a current or a left chat: Deleted 3 files from #9, 2.1 MB. or No files from #9. |
/pending |
Lists pending actions. |
/list |
Lists the agent's 100 most recent chats, one line each, and which of them are approved for all messages or all files: , approved for this chat by NAME and , files approved by NAME; a last line counts the older chats. |
After /leave #9, or after the agent's leave of #9 is performed in either mode, when the chat's folder has files, the agent posts Files from business Ridgeline (#9) are kept in `/home/alice/.simplex-mcp/my-agent/files/group-9`: 3 files, 2.1 MB. /delete #9 files. The files forwarded from #9 are deleted when the agent leaves it.
/pending, /list and /leave are in the chat's command menu, and the cards carry the others. Tapping /leave in the menu puts /leave <chat ID> into the entry field: replace <chat ID> with the chat's ID from /list, such as #9, and send it. Each command includes its number, because the app sends a tapped command as a new message, without a quote. Every card form and reply is listed in the design record, section "What the owner sees: the agent control chat".
Approval of all messages to a chat
After /approve #9 all, the agent's messages to #9 are sent at once, and each one is posted in the agent control chat after it is sent:
My Agent: I sent a message to business Ridgeline, where I am incognito:
`Thanks, I'll order.`
Approved for this chat by Alice. /revoke #9
- It covers messages only: connecting and leaving are approved one by one.
- It lasts until
/revoke, until the chat is deleted, or until the approving owner is no longer an approver. It survives restarts: it is kept in the agent's database, as custom data of that chat. - With it, the agent can send anything it can read, without asking, to everyone in that chat.
- It applies in mode
requestsonly: in modehost,listand/listshow no approvals.
Receiving all files from a chat
After /receive #3 7 all, the agent's later downloads from #3 are performed at once, and nothing is posted in the agent control chat.
- It covers files on the agent's XFTP servers. A download of a file on other servers gets a card, as without it.
- Cards already pending in #3, other than card 7, stay pending. A file you rejected, or whose card expired, gets a card again.
- It covers downloads only, and the approval of messages covers no downloads: each is given and ended by its own command.
- It lasts as the approval of messages does, until
/receive #3 off, and is kept next to it in the chat's custom data. /listshows it as, files approved by Alice.
What the agent sees
Six tools:
| Tool | What it does |
|---|---|
connect |
Joins a contact, bot, business, group or channel by a link or a SimpleX name, as the agent's profile or incognito. Returns the chat, its profile, welcome message, the commands a bot advertises, and the messages so far. |
send |
Sends a message, with a file of this computer when asked, and returns every message received in that chat after it, until none arrives for idle seconds (30 by default). A directory bot's search results arrive this way. |
receive |
Returns the chat's unread messages and those that arrive while it waits, waiting for one when asked. |
download |
Downloads the file of a received message to the data folder and returns its full path. |
list |
Lists the agent's chats with unread counts and approved: true for chats approved for all messages, and its actions without a result. |
leave |
Deletes a contact, or leaves a group, business chat or channel, and deletes the chat; the contact or the members are notified. |
A send to a chat that list shows with connected: false is refused before any card. A send is refused with text: too long for its approval card; shorten it. when its card, in its longest outcome form, would exceed 15000 bytes in the SimpleX message, which holds at most 15602; a text of many lines or multi-byte characters reaches it below 12000 characters.
A received message with a file has a file field: its name, size, type (image, video, voice or file) and status. Status offered means download can fetch it; received comes with the path of the file that download downloaded; a file /forward sent to you stays offered; rejected means you rejected its download, or it expired; failed comes with the error, also for a file above the size its sender may send, and for a received file that is not in the chat's folder, for example after /delete #3 files. A downloaded file is named by its file ID and the extension of its name, when the extension has only letters and digits: the name the sender gave stays in the name field. download first waits, up to wait seconds, for the sender to finish the upload; when it has not finished by then, the call returns an error that asks to call again later. A download that runs past its wait after the approval returns status performing, and the same call again picks it up. A download fails when the sender cancels the file, when the message or its chat is deleted, or when no part of the file arrives for 30 minutes; the server then cancels it.
A received reply has reply_to: item, the quoted message's ID when the chat has it; from, its sender; type, its type when it is not a text, such as image; and text, the first line of its text, up to 200 characters, with … when it continues. A quoted image or file without a caption has its file name as text. The agent replies to the quoted message with send and that item as reply_to.
A short voice message can arrive with its file already received. The server moves such a file into the chat's folder under the same naming when it is received in full, and its message shows it as offered; download returns its path there after the approval. A partial file of a download, or of a short voice message that arrives while the server runs, is deleted when its transfer fails or is cancelled.
send with file, an absolute path, sends that file with text as its caption:
.jpg,.jpegand.pngas an image, resized by the SimpleX core to the size the apps send, with a preview the core makes;.gifand.webpas an image, unchanged, with a gray preview;.mp4and.movas a video, unchanged, with the first frame as its preview and its duration whenffmpegandffprobeare installed, otherwise a gray preview;- other files as a file, unchanged;
as: "file"sends an image or video this way too.
An empty file is refused, and so is as without file. A message holds at most 15602 bytes with its text, the file's name and preview, the message reply_to quotes and the mentioned names. The quote is the quoted text when the message is an image or video; otherwise it is the quoted content, an image's preview included. A send over it is refused with text: too long for a message with this image; shorten it., or without a file text: too long for the message with its quote; shorten it. An image's preview takes up to 14000 bytes, so its text has about 1 KB.
The server checks the file by its real path, after symbolic links, and refuses files under ~/.ssh and ~/.gnupg, files named id_*, *.pem, *.key, *.p12 and *.pfx, and the files under its data folder and under ~/.simplex-mcp, except those under files/ of its own data folder; each folder is taken by its real path too. The card shows the real path. A file whose real path, size, inode or change time differs at the send from the request is not sent: the action fails.
Incognito: the core creates a random profile for that one chat, so peers of different chats can't link them. The tools' inputs, results and errors are in the design record, section "What the agent sees: tools", and the call sequences of the scenarios in section "Sequence diagrams".
Waiting for approval in Claude Code
An MCP server cannot start a turn of the agent: what the agent reads from the server are the results of its own tool calls. A call that waits for the owner, or for responses, stays open, and Claude Code turns it into a background task:
- A tool call in the main conversation that runs past two minutes moves to a background task. Claude continues working, and the result arrives as a task notification. When it arrives while the session is idle, Claude responds to it without a prompt (checked with Claude Code 2.1.300).
- To move calls to the background sooner, set
CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS, for example to10000, in theenvblock of~/.claude/settings.json. This applies to every MCP server. - Calls from subagents, and calls in
claude -pruns unlessCLAUDE_AUTO_BACKGROUND_TASKS=1, stay in the foreground: the subagent or the run waits. - A background task ends with the session. The action stays in the server while it runs;
listshows it, and the same call again picks it up.
Prompt the agent from the app
Give Claude Code your SimpleX address:
Connect to me as yourself at <your SimpleX address>, with the message:
"I'm your agent, connected as you asked in Claude Code. I'll act on your prompts here, except security-sensitive ones."
Then take my prompts from that chat and answer there: wait for my messages with receive (wait 3600),
answer each one in that chat, and call receive again after every answer, until I say stop.
Approve the connection in "My Agent", and accept the request in the app if it asks. On the card of the agent's first answer, tap all: its later answers to you need no approval.
Several agents
Each agent is its own process, with its own data folder, port, agent control chat and Claude Code server:
npx -y @simplex-chat/mcp serve my-agent-2 --port 5227
npx -y @simplex-chat/mcp register my-agent-2
Other MCP hosts
Add an entry with the URL http://127.0.0.1:5226/mcp and the header Authorization: Bearer <token>, as in headers.json of the data folder; after --new-token, update the entry. A host that ends a tool call early returns a timeout to the agent; the agent repeats the call with the same arguments, which picks up the same action. Hosts with a fixed tool-call limit, between 60 and 300 seconds in several hosts, need wait below it.
Recovery
| Situation | What to do |
|---|---|
| The server was not running when Claude Code started | Start the server, then run /mcp reconnect all in Claude Code (2.1.284 or later). |
| The server restarted while Claude Code was running | Claude Code reconnects up to five times within about 30 seconds. After that, in an interactive session, run /mcp reconnect all; claude -p runs and Agent SDK sessions keep retrying for about half an hour. Open calls fail, and pending actions are cancelled; the agent's repeated call creates a new request. |
| A second server was started on the same data folder | It exits with Another server uses <folder> (PID N). If no server runs, remove <folder>/lock. |
| Every owner left the agent control chat or was removed | connect, send, download and leave fail. Without --owners, the server logs No owners in the agent control chat. and prints a new link; join with it. With an --owners list, the agent posts and the server logs No owners remain: restart the server with --reset-owners --owners. |
| The agent was removed from the agent control chat, the chat was deleted, or the agent lost its owner role | connect, send, download and leave fail, and the server logs The agent lost its control chat. Restart the server with --reset-owners. |
| The QR code does not scan | Start with --qr-code large, or paste the link into the app. |
| The wrong person joined by the link | Start with --reset-owners. |
| The token leaked | Start with --new-token; Claude Code reads the new token at its next connection. |
--reset-owners deletes the agent control chat for all its members, creates a new one and prints a new link. Member IDs change in the new chat, so --reset-owners takes --owners without a list.
Command reference
npx -y @simplex-chat/mcp --help prints:
Usage:
simplex-mcp serve NAME [options] run agent NAME
simplex-mcp register NAME [options] add agent NAME to Claude Code
simplex-mcp session MCP server of one Claude Code session (run by the plugin)
simplex-mcp service the shared SimpleX service of the plugin (started on demand)
simplex-mcp hook session-start Claude Code SessionStart hook (run by the plugin)
simplex-mcp hook turn Claude Code hooks of prompts, answers, model changes, tool uses and compactions (run by the plugin)
simplex-mcp link show the Main group link, or its owners
simplex-mcp reset-owners replace the Main group and its owners
Claude Code plugin:
/plugin marketplace add https://raw.githubusercontent.com/simplex-chat/simplex-chat/master/.claude-plugin/marketplace.json
/plugin install simplex@simplex-chat
SIMPLEX_MCP_HOME the plugin's data folder (default: ~/.simplex-mcp)
serve options:
--data DIR data folder (default: ~/.simplex-mcp/NAME)
--display-name TEXT the agent's name in SimpleX (default at the first start: NAME)
--approve MODE what the owner approves in the agent control chat:
requests the agent's connections, messages, downloads
and leaving chats (default)
host nothing; the MCP host asks
--owners [ID:NAME,...] only these owners approve; without a list, the link
adds an observer and its ID is printed at the join.
Without --owners, whoever joins becomes an owner and
every owner approves.
--expire HOURS pending actions expire after HOURS, 1 to 23 (default: 23)
--stop-wait SECONDS at stop, wait SECONDS for cancelled cards to be sent,
0 to 60 (default: 10)
--reset-owners replace the owners: a new agent control chat and link
--new-token replace the access token
--port N HTTP port on 127.0.0.1 (default: 5226)
--qr-code SIZE QR code of the link: small (default) or large
register options:
--scope SCOPE user (default) or local
--data DIR data folder (default: ~/.simplex-mcp/NAME)
--reset-owners takes --owners without a list.
Data folder
~/.simplex-mcp/my-agent/
simplex_chat.db SimpleX chat database: the agent's profile and chats
simplex_agent.db SimpleX agent database: connections and keys
token access token, readable only by the user
headers.json the token as the Authorization header for Claude Code, readable only by the user
server.json name, port and expiry of the server, read by register
lock PID of the running server
tmp/ the SimpleX core's work folder for files in transfer
files/group-3/ files downloaded from chat #3, and files received there without a download, each named by its file ID
and the extension of its name, such as 12.pdf; files/contact-4/ for contact @4
files/sent/ resized copies of the images the agent sends, and copies of the files /forward sends you under their names;
each is deleted when its upload completes or fails, and all at start
forwarded/group-3/ files /forward downloaded from chat #3, until /receive moves them into files/group-3/; deleted when the agent
leaves the chat, and by /delete #3 files
The folder is readable only by the user: every start sets its mode to 0700, except on Windows.
The server keeps its action counter in the chat database, as custom data of the agent control chat, the approvals of all messages to a chat and of all files from it as custom data of that chat, and its actions in memory.
The server keeps no log file: it writes its log to the terminal where serve runs, events to stdout and errors to stderr.
One server runs per data folder: a second one exits, because two processes on one database break each other's connections (a SimpleX server delivers a queue's messages only to the last process that subscribed to it).
Security
- In mode
requests, the agent asks in the agent control chat before it connects, sends a message or a file, downloads a file or leaves, and the owner approves or rejects. On a download card,/receivegives the agent the file, and/forwardsends it to the agent control chat, not to the agent. - Messages in your prompt chat can become prompts for your Claude Code session: use a chat where only you write, see Prompt the agent from the app.
- The server listens only on 127.0.0.1. Every request needs the token. Requests from web pages on other hosts, and requests with another
Host, are refused (the SDK's localhost Origin and Host checks). - Any process with the token can act as the agent. The token is stored only in the data folder, in
tokenandheaders.json; Claude Code's config and theclaude mcp add-jsoncommand line contain the command that printsheaders.json, not the token. - Names written by peers are folded to one line, with control and format characters replaced by spaces, in the terminal and in the agent control chat; there, a name that is not a valid display name is shown as code.
- Without
--owners, whoever opens the link first becomes an owner. The link works once. - With
--owners, only the listed owners approve. - After
/approve #N all, the agent sends to that chat without asking, files included;/revoke #Nends it. - The server refuses to send private keys, its own files and the files under
~/.simplex-mcp, where agents keep their data, except the files underfiles/of its own data folder; other files the agent can read are sent after approval. - After
/receive #N 7 all, the agent's later downloads from that chat, of files on its XFTP servers, run without asking;/receive #N offends it. A file on other servers is downloaded only by/receiveor/forwardof the card that names them; any other download of it fails, unless the IP address is protected. - Peers of a chat connected as the agent see its profile; peers of an incognito chat see a random profile made for that chat only.
- The agent has no address, so nobody can contact it first.
- The agent uses private message routing: the SMP server that holds a contact's queue does not see the agent's IP address.
Claude Code plugin
The plugin gives every Claude Code session its own SimpleX group. In that group you send the session prompts, approve its actions and tool use, and read its answers. One service runs all sessions that share a data folder. Peers see one SimpleX profile, Claude. Sessions have the tools of serve (connect, send, receive, download, list and leave), and reply, which sends files to the session's group.
Install
The plugin needs Claude Code 2.1.214 or later and Node.js 22 or later. In Claude Code:
/plugin marketplace add https://raw.githubusercontent.com/simplex-chat/simplex-chat/master/.claude-plugin/marketplace.json
/plugin install simplex@simplex-chat
Prompts from SimpleX and approvals of tool use in the group need the plugin's channel. Start Claude Code with it:
| When | Command |
|---|---|
| Until Anthropic lists the channel | claude --dangerously-load-development-channels plugin:simplex@simplex-chat |
| After the listing | claude --channels plugin:simplex@simplex-chat |
| Team and Enterprise plans | An admin adds simplex@simplex-chat to allowedChannelPlugins. |
The development flag works only in interactive sessions. Without a channel, the plugin still works, but prompts from SimpleX and approvals of tool use in the group don't. Channels need Anthropic authentication through claude.ai or a Console API key.
The plugin adds:
| Part | What it does |
|---|---|
MCP server simplex |
Runs simplex-mcp session for each session. It provides the tools, such as mcp__plugin_simplex_simplex__connect, and the channel. Its tool pre_tool_use answers the PreToolUse hook of every tool, and Claude never needs to call it. |
| SessionStart hook | Checks the Node.js version and starts the service. It opens the session and its group, and shows the Main group link while the Main group has no owner. |
| PreToolUse hook of the plugin's tools | Lets the plugin's tools run without a Claude Code prompt, because you approve them in the SimpleX app. |
| UserPromptSubmit, Stop, PostModelSwitch and PostCompact hooks | Post your terminal prompts, Claude's answers, the usage of each turn and a line for each summary of the session's context in the session's group, keep the model and effort in its description, and post their switches. They run in the background. |
| PreToolUse, PostToolUse and PostToolUseFailure hooks of every tool | Post a line for each step of Claude's work when it starts, and complete it when it ends. They run in the background. |
PreToolUse hook of every tool, of type mcp_tool |
Calls the tool pre_tool_use of the session's MCP server, which allows a tool approved for the rest of the session, see Tool use. It waits up to 5 seconds. |
The server and hooks run node ${CLAUDE_PLUGIN_ROOT}/dist/cli.js. The PreToolUse hook of the plugin's tools runs node ${CLAUDE_PLUGIN_ROOT}/plugin/allow.js instead. The package, a 4 MB download, bundles its dependencies and has no lockfile, so Claude Code installs nothing after unpacking it. Node.js loads the modules from the plugin's folder, so a project's node_modules can't replace them. The first session start downloads the SimpleX core library. Claude Code waits up to 600 seconds for the SessionStart hook.
Shared settings
Settings shared by several machines or containers can load the plugin from a folder, without /plugin commands. This setup was checked with Claude Code 2.1.322.
-
On each machine or container, unpack the package into
plugin/of a folder at the same path, here/opt/simplex-plugins. VERSION is the plugin's version, such as 0.3.0:mkdir -p /opt/simplex-plugins/.claude-plugin /opt/simplex-plugins/plugin npm pack @simplex-chat/mcp@VERSION tar -xzf simplex-chat-mcp-VERSION.tgz -C /opt/simplex-plugins/plugin --strip-components 1The dependencies are bundled, so nothing needs installing.
-
Write
/opt/simplex-plugins/.claude-plugin/marketplace.json:{ "name": "simplex-local", "owner": {"name": "Alice"}, "plugins": [{"name": "simplex", "source": "./plugin"}] } -
Add to the shared settings:
{ "extraKnownMarketplaces": { "simplex-local": {"source": {"source": "directory", "path": "/opt/simplex-plugins"}} }, "enabledPlugins": {"simplex@simplex-local": true} }pathis the folder's absolute path. Claude Code readsextraKnownMarketplacesfrom user settings (~/.claude/settings.json), from a file passed with--settings, and from managed settings. It loads the plugin when it starts. -
Start Claude Code with the channel each time:
claude --dangerously-load-development-channels plugin:simplex@simplex-localSettings can't replace this flag. An organization's managed settings,
channelsEnabledandallowedChannelPlugins, only allow the channels that a session names with--channels.--channels plugin:simplex@simplex-localworks only whensimplex@simplex-localis inallowedChannelPlugins.
Each machine and each container needs its own data folder, on storage that no other one uses. Use ~/.simplex-mcp in its own home folder, or set SIMPLEX_MCP_HOME in its own environment, not in the env of the shared settings. The service matches sessions and checks its lock by process IDs, and process IDs are only meaningful within one machine or container. Each data folder has its own Main group, whose link shows at the first session start there. To tell these groups apart in the app, set SIMPLEX_MCP_MACHINE in the environment of each machine or container: SIMPLEX_MCP_MACHINE=laptop names its Main group Claude Control - laptop.
The Main group
At the first session start, Claude Code shows:
SimpleX MCP: scan this QR code with the SimpleX app and tap Join to supervise your agents in "Claude Control":
<QR code>
https://smp4.simplex.im/g#...
The first start downloads the SimpleX core library and creates the group, so the link can take a minute. If Claude Code ends before then, the service keeps starting, and the next session start shows the link.
Only you see this link: it never enters Claude's context or tool results. Scan the QR code, or paste the link into the SimpleX app, 7.1.0 or later, and tap Join. The group "Claude Control" appears, and Claude writes: I'm Claude. Each Claude Code session has its own group, and you get its invitation here. /sessions lists the sessions; /join N joins the group of session N.
- The first person who joins by the link becomes an owner, and the link is deleted. Until someone joins, the link stays the same across service restarts.
- Everyone in the Main group is trusted with all sessions, whatever their role there. They can join any session's group with
/join N, without approval, as admins. There they can prompt the session and approve its actions. - The group's welcome message says so:
Everyone in this group can join the groups of your Claude Code sessions, prompt Claude and approve what it does. Invite only people you trust with that.When someone joins, Claude postsNAME joined. They can join the group of any Claude Code session here, prompt Claude and approve its actions. - Claude sets the short description and the welcome message when it creates the group. Later it changes only the group's name and commands, so the texts and preferences that owners set stay.
- Owners can add people with a group link of their own or by inviting their contacts.
- Observers can't send messages in the Main group, so they can't use
/join N. - Owners of the Main group are invited to every session's group as owners. They get each invitation in the Main group.
/sessionsreplies with the text of the list of sessions, below./join Nsends you an invitation to the group of session N, as an admin, or as an owner if you own the Main group.- Leaving the Main group, being removed from it, or getting another role there changes nothing in the session groups.
- When no owner remains, the service creates a new link. In a terminal,
npx -y @simplex-chat/mcp@VERSION linkprints it with a QR code. While the group has owners, the command names them instead.
After the first owner joins, Claude posts the list of sessions in the Main group, after its greeting:
🟠 3 · simplex-chat: working
🔵 6 · website: waiting for you, 2 approvals
🔵 7 · docs: waiting for you in Claude Code
🟢 8 · app: idle
⚪ Not running: 5 · bio, 4 · notes, 2 · openclaw, 1 · first
- A session is running while its Claude Code runs, or while cards wait for a decision in its group. Each running session has a line, by number:
🔵 N · NAME: waiting for you, K approvals: K cards wait in the session's group. A tool-use card counts only while Claude Code shows its permission dialog, or while Claude Code's state can't be read.🔵 N · NAME: waiting for you in Claude Code: Claude Code waits for an answer in its own window, such as a dialog.🟠 N · NAME: working: Claude Code works on a turn, or a subagent works for it.🟢 N · NAME: idle: Claude Code waits for the next prompt, also while a background command runs.▶️ N · NAME: running: Claude Code's state can't be read.
- The last line names every other session of the data folder, newest first. Without any session, the list is
No sessions. - The states are Claude Code's own: the plugin reads them from Claude Code's record of its process,
sessions/PID.jsoninCLAUDE_CONFIG_DIRor~/.claude. - The list is one message. When it gets too long, the last line keeps the newest names that fit and ends with the count of the others, such as
190 older sessions. The lines of running sessions are never cut. - Claude edits the list within 2 seconds of a change. An edit alerts nobody. The list moves up as messages, such as invitations to new sessions' groups, are posted after it.
- SimpleX lets Claude edit a message only within 24 hours. When the list is 23 hours old, Claude posts a new list and deletes the old one for everyone.
- When the service stops, Claude edits the list once more, with every session in the last line.
To replace the owners, run npx -y @simplex-chat/mcp@VERSION reset-owners in a terminal. It replaces the Main group at once, without the owners' approval:
- The old Main group is deleted for all its members, and a new one is created. The session groups don't change: members who joined them from the old Main group keep their roles.
- In a terminal, the command prints the new link with a QR code. Run without a terminal, for example by Claude's tools, it shows no link and asks you to run
linkin a terminal.
VERSION is the plugin's version, as in npx -y @simplex-chat/mcp@0.3.0 link. The plugin's messages print these commands with the right version. The same command with a newer version would replace the plugin's service.
Sessions and their groups
-
Each session has a number, starting at 1, which is kept across service restarts. Its group is named
N · NAME. NAME is the session's name fromclaude -n NAMEor/rename, otherwise the project folder's name, otherwiseClaude Code. A new name shows from the next session start. -
The group is created at the session start, and the Main group's owners are invited to it as owners. An owner who joins the Main group later is invited to the groups of the open sessions.
-
The group's members are Claude, the Main group's owners, members who joined with
/join, people whom members added directly, andUser. People added directly get the role that the adding member set.Useris a second profile of the service that posts your terminal prompts. -
Claude's profile has the peer type
agent, so the app shows Claude with the agent placeholder.User's profile has the peer typehuman, which the service sets at each start. In a session group that you joined whileUserhad the peer typeagent, as in 0.3.0, the new peer type reaches your app withUser's next post there, and the app showsupdated profilefromUseronce. -
Rights follow the member's role in the group, however they joined:
Role Rights owner, admin prompts, the group's /commands, approvals of actions and tool usemoderator, member, author prompts; each of their /commands getsOnly admins and owners of this group can send / commands.observer none: the app can't send their messages User's messages are never prompts, commands or approvals. -
When someone joins or their role changes, Claude posts their rights. For an admin the post is
Bob is an admin and can send prompts to Claude and the group's commands, and approve tool use. You can change role to observer to stop it: /'observer #G ID', with the group's and the member's IDs. For a moderator, member or author it isNAME is a ROLE and can send prompts to Claude; the group's commands and approvals need the role admin or owner., followed by the same command. The posts for an owner and for an observer have no command:NAME is an owner and can send prompts to Claude and the group's commands, and approve tool use.andNAME is an observer and can't send messages.Claude posts nothing forUser. -
/observer #G IDmakes that member an observer, and Claude repliesNAME is an observer and can't send messages.Admins and owners can use it on a member whose role isn't above their own. Standing approvals that the observer gave, of all messages to a chat or all files from it, stop counting while they aren't an admin or owner, and count again if they become one. For a member who was invited and hasn't joined yet, Claude repliesNo member ID in this group.That member joins with the role of the invitation, which can be changed after the join. -
The group's description is
The Claude Code session N. Members send it prompts; admins and owners also send the group's commands and approve tool use., set when the group is created. Its short description shows the model and effort, see Model, effort and usage. -
The group is created in the Flat layout, which SimpleX apps from v7.1.0 show. Each member can choose another layout for it in Group info ›
Chat theme›Chat layout, for their own app. The Main group is shown in each member's own layout. -
The group has the commands of the agent control chat of
serve(see What the owner sees), without a session prefix, such as/approve 7,/receive @3 9and/leave #2. It also has/give CHAT N,/observer #G ID, and/approve N alland/revoke TOOLfor tools, see Tool use. -
A chat belongs to the session that connected it, even when the other side accepts after
connectreturned. The tools of other sessions don't show it. Theirconnectto its address returnsThe chat of LINK belongs to another session; an admin or owner of that session's group can give it to this session with /give.For example,/give @3 2in the group of the session that owns chat @3 gives it to session 2. -
/listand/revokealso work in the group of a closed session. A/revokesent while the service is stopped applies when the service starts again. -
claude --resumeandclaude --continuereopen a session with its group and chats./clearkeeps the session's group, because the service links the new session IDs of a Claude Code process to that process's session. A fork made withclaude --resume ID --fork-sessioncontinues in the group of the resumed session. After/resumeof another session inside a running one, prompts and answers go to the running session's group. A laterclaude --resumeof that other session reopens its own group and chats. -
A session closes 10 minutes after its Claude Code session ends, once the expiry times of its actions have passed. The service stops 10 minutes after the last session closes. The next session start or tool call starts it again.
-
A non-interactive run,
claude -por the Agent SDK, gets no session and no group. Its hooks post nothing, and its SimpleX tools returnThis Claude Code run is not interactive, so it has no SimpleX group; the SimpleX tools work in interactive sessions.- The plugin recognizes such a run by
CLAUDE_CODE_ENTRYPOINT. Claude Code sets it tosdk-cliforclaude -pand tosdk-tsorsdk-pyfor the Agent SDK. It also usesCLAUDE_CODE_SESSION_ATTENDED, which Claude Code sets to0for the hooks of a run nobody attends. - A
claude -prun started from a session of the VS Code extension or the desktop app keeps that session's entrypoint, and its MCP server gets that session's attended value. For such a run, the SessionStart hook marks its Claude Code process, and the service refuses that process's session server when it registers within 10 seconds. Its tools then return the same text.
- The plugin recognizes such a run by
Prompts and answers
With the channel, a message from a member of a session's group, other than User, is a prompt to the running session, like one typed in the terminal.
-
A file attached to the message is saved without approval to
_sessions/<session ID>/files/group/in the data folder, and Claude gets its path. When the file fails or doesn't arrive within 10 minutes, Claude repliesThe file of this message was not received: ERROR, and the session gets the text. -
When you reply to a message, Claude gets your text after a line
>with the quoted message: its type when it is not a text (link, image, video, voice, file, report or chat), such as> image: IMG_2041.jpgor> video, and the first line of its text, up to 200 characters, with…when it continues. The quote of Claude's answer leaves out its line with the turn's usage. Claude also gets the quoted message's ID and sender, and takes that line as data, not as your prompt. -
When you react to a message, Claude gets your emoji as a reply to that message: after its quote line, with its ID and sender, as for a reply. Claude gets the eight emoji of the apps: 👍 👎 😀 😂 😢 ❤ 🚀 ✅. To any other reaction, Claude replies
This reaction is not supported.once for each member and message, and the session gets nothing. A video or a voice message without text is quoted with its file name, such as> video: ride.mp4. Claude answers as for any prompt, with the reacted message in place of the prompt. A reaction is never a command or an approval: a 👍 on a card leaves the card pending. Reactions of observers, a removed reaction and reactions in the Main group reach no session. Owners turn reactions off with the group's preference "Message reactions". -
Prompts reach the session in the order they were sent. A later prompt waits for the file of an earlier one.
-
Every message from a member who can send is a prompt, including one that starts with
!. Only one-line messages that start with/are not prompts, see below. Claude Code runs no command from a prompt. Claude gets the text, and runs shell commands only as tool use, such as Bash, under Claude Code's permissions, see Tool use. -
A one-line message that starts with
/is a command of the group, such as/approve 5or/list. From an admin or owner, an unknown command getsUnknown command.From a moderator, member or author, any such message getsOnly admins and owners of this group can send / commands., and it reaches neither the commands nor Claude. -
While the service runs and the session's Claude Code doesn't, Claude replies
Session N is not running.It also replies so when Claude Code ends while a prompt's file arrives. For 30 seconds after the service starts, a prompt waits for its session to attach again, so a prompt sent while the service was stopped still arrives. -
When a prompt that a person typed, or a prompt from the group, starts a turn, Claude posts an empty live message at once: the apps show it under the LIVE header, with typing dots. It replies to the prompt when the prompt came from the group. The turn's first post fills it: the first line of Claude's text, a step, or the answer. If someone deletes the empty message, that post comes as a new message. A prompt that Claude Code adds to the running turn, a
/command and Claude Code's own prompts get no such message. -
Claude's text appears live as Claude writes it, also its remarks between steps, which the terminal shows. Each text of Claude, from its first line, is a live message that grows by whole lines, updated at most every 3 seconds. When Claude ends a text, its live message shows the whole text, and it is completed without an edited mark: with the answer's line at the end of the turn, or without it at Claude's next step or text, or 10 seconds later. A text longer than one message continues in a new live message.
-
Claude's final answer of a turn is its last text. When Claude Code streams no text, as in versions without the MessageDisplay hook, Claude posts the answer at the end of the turn, in the turn's empty live message when no other post filled it. When the turn's prompt came from the group, the answer replies to it, even when the next prompt arrives while Claude answers. Claude Code can add a prompt that arrives during a turn to that turn. Then an answer posted as a new message replies to the last message from the group added to the turn.
-
The last message of a non-blank answer ends with a line in small print with the turn's usage, such as
Done in 2 min 51 s · 16K output tokens · 673K tokens in context, see Model, effort and usage. A refused answer gets the line at the end of the text that names the preference. The line adds no message, so the chat list keeps showing the answer. After a blank answer, the line fills the turn's empty live message, without an alert. A turn that ends without an answer, as after an interruption or an error, gets no line: its live texts are completed as they are, and its empty live message gets⏹️ Stoppedat the end of a later turn, or when the session ends. A text or an empty live message still live 23 hours after it was sent is completed the same way, because SimpleX allows edits of a message for 24 hours. -
Claude's replies to a prompt, its answer included, are posted without the quote when the prompt was deleted or the quote makes the message too large. An answer is also posted without the quote when the quote leaves no room for its first character.
-
While the plugin is enabled, Claude Code shows Claude's text in the terminal by whole lines, after the plugin's MessageDisplay hook passes each batch of lines to the service, about 0.1 s later.
-
Userposts only the prompts a person typed, also one typed while Claude works.Userskips commands such as/compact, empty prompts such as one with images only, and prompts made only of the plugin's<channel source="plugin:simplex:simplex" ...>tags.User's posts are never commands of the group, even a part that starts with/. -
Claude posts one line in small print for each of Claude Code's own prompts, without a quote, so it reads apart from the prompts of people. A
!in it is shown asǃ, because!would end the small print. The line starts with an emoji for the prompt's kind:- a notification of a background task, a subagent, a workflow or a monitor: its summary, such as
✅ Background command "Build" completed (exit code 0), and the first line of its event, when it has one, such as📡 Monitor event: "Builds": serverpg exit 0. The emoji is ✅ for a task that completed, ❌ for one that failed and ⏹️ for one that was stopped or killed. A notification without a status gets 📡 when it has an event, as a monitor event or the end of an artifact watch, and 🔔 otherwise. A notification in plain text, such as3 background agents were stopped by the user: ..., gets 🔔 and its first line; - a message of another Claude session:
✉️ Message from NAME:and its first line; - a message of a teammate in an agent team:
✉️ Message from NAME:and its summary, or its first line without one. A prompt with several teammate messages gets the line of the first one that is not an idle notification, and a prompt of idle notifications only gets no line; - the report of a subagent:
📋 Report from subagent NAME:and its first line; - a scheduled prompt:
⏰ Scheduled prompt:and its first line; - an automatic prompt, such as the one after a usage limit resets:
🔄 Automatic prompt:and its first line; - another kind:
⚙️ Claude Code:and its first line.
A line over 200 characters is cut there and ends with
…. Prompts typed in the terminal and channel prompts get no line. When one of Claude Code's own prompts starts a turn, Claude's answer to it is posted without a quote. - a notification of a background task, a subagent, a workflow or a monitor: its summary, such as
-
When Claude Code summarises the session's conversation, Claude posts one line without a quote, once the summary has replaced the conversation. A summary made by Claude Code at the context limit or in an idle session gets
⚙️ Context summarised automatically: 968K → 35K tokens, and one after/compactor "Summarize from here" gets⚙️ Context summarised on request: 399K → 25K tokens. The numbers are the size of the context before and after the summary. The summary of a subagent's conversation posts nothing. Claude Code writes a summary made during a turn to the transcript with its next request, so the line can follow such a summary by a few seconds. It writes the summary of/compactand of an idle session at once. -
Claude posts one line for each step of its work, a tool use of the main conversation, when the step starts:
- Bash:
💻and the command's description, or its first line without one, such as💻 Run the tests; - Read, Edit and Write:
📖 Read PATH,✏️ Edit PATHand📝 Write PATH, with PATH relative to the session's folder when it is inside it; - Grep and Glob:
🔍 Grep PATTERN in PATHand🔍 Glob PATTERN in PATH, with PATH as for Read, and withoutin PATHwhen the search has no path; - WebFetch and WebSearch:
🌐 Fetch URLand🔎 Search QUERY; - Agent:
🤖 Agent:and the agent's description; - another tool:
🔧 TOOL, and:with the first of its description, query, URL, file path, path, pattern and command that is not blank.
The line is a live message while the step runs. The whole line is in small print. When the step ends, Claude completes it with the step's duration, after ❌ for a failure or ⏹️ for an interruption, such as
!- 💻 Run the tests 2.0 s!. A!in the text of a step is shown asǃ, which looks the same, because!would end the small print. Claude Code reports the end of a command or an agent run in the background when it is started, so its line is completed with(in background), such as!- 💻 Run the tests (in background)!; its completion is posted later as the line of its notification. The completed line has no edited mark. A step refused at approval has no end; its line is completed without an outcome when the turn ends, when a prompt starts the next turn, or when the session ends. A line still live 23 hours after its start is completed without an outcome, because SimpleX allows edits of a message for 24 hours; the step's later end is posted as a new line. The text of a step is cut at 200 characters. Tool uses of subagents and of this plugin get no line. - Bash:
-
Claude marks the turn's empty live message, its texts and answers, the lines of steps, and the lines of Claude Code's own prompts, of summaries of the context and of model and effort switches as silent. The answer's last message, with its line, is important, so a turn alerts once, at its end. When the line completes a live message or the turn's empty live message, the edit marks it important; SimpleX apps alert for such an edit once they support it. A SimpleX app that supports silent messages shows them without an alert; other apps alert for them as for any message.
-
A text too long for one message is posted as several messages, each as long as a message can be, measured as for
send. The first part of an answer carries the quote. A part without a quote holds up to 14,962 Latin, 7,481 Cyrillic or 4,987 CJK characters. A prompt or an answer over 250,000 characters is cut there and ends with…. -
The
replytool sends a file to the group at once, without approval, with its text as the caption, under the file rules ofsend. It returns the file's message asitem. A caption too long for a message with the file's preview is refused withtext: too long for a message with this TYPE; shorten it.
Group preferences
Owners set the group's preferences in the app, and SimpleX enforces them. Claude never overwrites them: it changes only the group's name, short description and commands, starting from the profile in the chat database.
- While "Files and media" is off,
replyreturnsFiles and media are off in the group of this session; its owners can turn them on in the group's preferences.The cards of sends and downloads of images and videos are posted as text, without the preview, and the sends and downloads still work./forwardgetsAction N: Files and media are off in the group of this session; its owners can turn them on in the group's preferences. - When another preference refuses one of Claude's posts, Claude posts a text that names it instead:
- For an answer with a SimpleX link:
Claude's answer was not posted: SimpleX links are off in the group of this session; its owners can turn them on in the group's preferences. - For the line of one of Claude Code's own prompts or of a step:
Claude's note was not posted: ... - For a text of Claude:
Claude's text was not posted: ..., once for the text. Its live message keeps the text posted last. When the text is the answer, the answer is not posted again. - When the refused post would fill the turn's empty live message, the text that names the preference fills it.
- For a terminal prompt:
User's prompt was not posted: SimpleX links are not allowed for User in the group of this session; its owners can allow them in the group's preferences.This also happens while the preference allows SimpleX links only for roles aboveUser's role, which is member unless the owners change it. - For a card that waits for approval, or for
/forwardof a voice message:Action N: .... The action then fails. replyreturns the same text without the prefixClaude's answer was not posted:.
- For an answer with a SimpleX link:
- After an action is decided, the text names the outcome and the card, and the action stays as it was:
- The card of an action performed in mode
hostor under a standing approval is posted after the action. When that post is refused, Claude postsAction N was performed; its card was not posted: ...orAction N failed; its card was not posted: .... - When the edit of a card with its outcome is refused, Claude posts
Action N was performed; its card was not updated: ..., withfailed,was rejected,expiredorendedin place ofwas performed. - A card posted or edited when the service stops gets
Action N: ....
- The card of an action performed in mode
Tool use
With the channel, Claude Code's permission prompts, such as the one before a Bash command, are also posted in the session's group:
Claude: I want to use `Bash`: `List files`
`ls -la`
/approve 5, /approve 5 all or /reject 5
/approve 5 allows the tool use, and /reject 5 denies it. The dialog in the terminal stays open, and the first answer, in the terminal or in the group, applies. A card that is still pending gets Ended. when its turn ends, when a prompt starts the next turn, or when the session ends. A prompt that Claude Code adds to the running turn leaves the card pending. The preview of the tool's input is shortened to fit the card.
/approve 5 all allows the tool use and approves its tool for the rest of the session. Claude replies Approved `Bash` for the rest of this session by Alice. /revoke Bash.
- Later uses of the tool run without a card and without the dialog in the terminal. Each use in the main conversation still has its line in the group.
- Claude Code still asks where its own rules require it: for a matching ask rule, a write to a protected path such as
.git,.claudeor.bashrc, in plan mode, and when the classifier of auto mode asks. Such a use gets a card with the line`Bash` is approved for this session, and Claude Code still asks for this use., and noallcommand. With Claude Code before 2.1.299, an approved tool also runs writes in plan mode. - The approval covers the uses of subagents too. Other pending cards of the tool stay pending.
- It counts while the member who gave it is an admin or owner of the group, and counts again if they become one again.
/listshows it after the chats, as`Bash` approved for this session by Alice./revoke Bashends it withUses of `Bash` need approval again.- It holds for the Claude Code process of the session, also after that process attaches to the service again. It is dropped when another Claude Code process opens the session, when the session closes, and when the service restarts. The service tells processes apart by their ID and their start time, read on Linux and macOS. On other systems, and when the start time can't be read, the approval also ends when the same process opens the session again, as after a failed call. While two Claude Code processes have the session open, only the one that opened it last gets the approvals. It also ends when the session's group is lost: when the group is deleted, or Claude is removed from it or is no longer its owner. The terminal shows nothing at the approval, and Claude Code's
/permissionsdoesn't list it, because the plugin keeps it. /approve N allof another kind of action getsAction N is not a tool use.- While the plugin's MCP server is not connected, as when it is disabled in
/mcp, left out by--strict-mcp-configor failed to start, Claude Code reports the PreToolUse hook errorMCP server 'plugin:simplex:simplex' not connectedat each tool use, and the tool use goes on as without the plugin.
Model, effort and usage
The short description of a session's group shows MODEL · effort LEVEL. The model is updated at the session start when Claude Code passes it, at each model change, and at the end of each turn from the model of the answer in the session's transcript. So the model shows from the first answer, also in a resumed session. An answer's model that is the shown model without [1m] keeps the shown model, because the transcript names the 1M context variant without that suffix. The effort level is updated at each tool step, at the end of each turn, and with the status line. Without the status line, a turn that runs at its own level, as after ultrathink in the prompt, shows that level until a later turn reports another. Once the status line reports in a session, the effort level comes only from the status line, which reports the session's level. Changes made in the terminal, or from the Claude app by Remote Control, show the same way.
When the model switches, Claude posts Model changed to MODEL in small print. When a known effort level changes, Claude posts Effort changed to LEVEL. The first model and the first effort level of a session get no line. Both lines are silent.
The last line of each answer shows the turn's usage, from the session's transcript, and the machine's free memory and disk, in small print:
Done in 2 min 51 s · 16K output tokens · 673K tokens in context · 5 h: 34% · week: 61% · RAM 12 GB free · disk 7.3 GB free
- The time runs from the turn's first entry in the transcript to the answer.
- The output tokens are those of the turn's responses, thinking included, without subagents.
- The tokens in context are the input, cache writes and cache reads of the turn's last response.
5 handweekare the plan's 5-hour and weekly usage, with the status line only. A window whose reset time has passed is left out.- Token counts are shortened as in the line of a summary of the context:
861,1.6K,16K,673K,1.2M. RAMis the memory available to processes on the machine of the SimpleX service, within the limit of its container.diskis the free space of the volume with the plugin's data folder,~/.simplex-mcporSIMPLEX_MCP_HOME. The service reads them when the answer ends, without the status line.- Sizes are in decimal units, rounded down:
850 MB,7.3 GB,12 GB,1.2 TB. A part ends with ❗️ when less than 5% of the memory or less than 5 GB of disk is free, such asdisk 3.4 GB free❗️. - When the transcript has no usage of the turn, as for a turn over 64 MB or a Claude Code version without prompt IDs, the line shows the time from the turn's prompt to its end, such as
Done in 2 min 14 s, or onlyDonewhen the start of the turn is not known.
Status line
Claude Code passes the plan's usage only to the status line command of your settings, and a plugin can't set that command. To add the plan's usage to the last line of each answer, set the plugin's status line command in ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "node \"${SIMPLEX_MCP_HOME:-$HOME/.simplex-mcp}/status-line.js\""
}
}
- The shell expands the command to the plugin's data folder of each machine or container, so one setting serves all of them when they share
~/.claude. - The service writes
status-line.jsthere at each start, pointing to its own version, so the setting stays the same across updates. - Claude Code shows the status line in the terminal, such as
Opus 5.5 · effort xhigh · 67% context · 5 h: 34% · week: 61% · RAM 12 GB free · disk 7.3 GB free: the model, the effort level, the share of the context window in use and the plan's usage, each when Claude Code passes it, and the machine's memory and disk. - The memory and the disk are those of the answer's last line, read by the command on the machine of Claude Code.
- The command also sends the effort level and the plan's usage to the service, so an effort change shows at once. It waits at most 1 second for the service, and starts none.
- The setting replaces a status line command of your own. On Windows, it needs Git Bash as the shell of commands.
- Claude Code runs
status-line.jsof the data folder also when no service could start there, so the data folder,~/.simplex-mcporSIMPLEX_MCP_HOME, must be writable only by you.
Options
Set in /plugin > Installed > simplex > Configure options:
| Option | Default | Values | Effect |
|---|---|---|---|
main_group |
Claude Control |
a valid SimpleX display name | The name of the Main group. With SIMPLEX_MCP_MACHINE set in the environment, - and its value follow, up to 50 characters in all. |
approve |
requests |
requests, host |
The approval mode of the sessions. |
expire_hours |
23 |
1 to 23 | How long an action waits for a decision, see Expiry. |
A changed option applies from the next session start, and so does a changed SIMPLEX_MCP_MACHINE. The service renames the Main group to the new name. An invalid value is shown at the session start, and every tool call of that session returns the same text, for example Plugin option expire_hours: hours from 1 to 23 expected, got 48. Change it in /plugin > Installed > simplex > Configure options. or SIMPLEX_MCP_MACHINE: a valid SimpleX name, such as mylaptop expected, got my.laptop. Change it in the environment of this machine. A value of approve other than requests and host can come only from a hand edit of the settings. It is shown only at the session start, and the session's tools run in mode requests.
In mode host, a session asks in its group to run in that mode: I want to run in mode host: Claude Code asks you before each of my actions, and they are performed without approval here., with /approve N or /reject N. It asks at its start, or when the group gets its first admin or owner other than Claude, by a join or a role change. The session runs in mode host after an admin or owner approves, and keeps the mode across restarts, in the custom data of its group in the chat database. After a rejection, it asks again only after a session start with requests. A change back to requests applies at the next session start without a card, and a pending card then gets Ended.
Plugin data folder
~/.simplex-mcp, or the folder in SIMPLEX_MCP_HOME:
| Path | Content |
|---|---|
service.token |
The access token of the service's socket, readable only by the user. |
service.lock |
The PID of the running service. |
service.sock |
The service's Unix socket. On Windows it is the named pipe \\.\pipe\simplex-mcp-<hash>. For a path over 103 bytes, it is simplex-mcp-<hash>.sock in the system temporary folder. |
service.log |
The service's log, emptied when it is over 10 MB, at a service start and every hour. |
titles.json |
The titles of new sessions whose session server had not registered when the service stopped. The next start reads and removes it. |
status-line.js |
The status line command of the running service's version, written at each service start, see Status line. |
_hub/ |
The databases of the profile Claude: the Main group, the session groups and the chats with peers. |
_user/ |
The databases of the profile User. |
_sessions/<session ID>/ |
session.json with the session's number, name, project folder, group, a rejected mode host, model, effort level and other session IDs. files/ holds the files of its chats and of its group. |
The folders, and the files the service writes, are readable only by the user, except on Windows. One service runs per data folder. These names contain a dot or start with _, which agent names of serve can't, so the folders of agents in ~/.simplex-mcp never collide with them.
Plugin recovery
| Situation | What happens, what to do |
|---|---|
| The session start shows an error | The error follows SimpleX MCP:, with details in service.log. The session starts without the service, and the next tool call tries again. |
| Node.js is older than 22 | The session start shows SimpleX MCP needs Node.js 22 or later; found <version>. |
| Claude Code ends before the session start shows the link | The service runs apart from Claude Code and keeps starting. The next session start shows the link. |
| The service stopped during a call | The call returns The SimpleX service stopped; repeat the call., and the next call starts the service again. The actions of the stopped service are lost, and a repeated call creates a new action. |
| The service stopped between calls, or its start failed | The session starts it again and attaches after 1 second. While that fails, it retries at intervals that double up to 30 seconds. |
| A session starts while the service stops | The new service waits up to 15 seconds for the stopping one to release its lock, and then starts. |
service.lock names a running process that is not the service |
After 15 seconds, the session start shows SimpleX MCP: Another service uses FOLDER (PID N). If no service runs, remove FOLDER/service.lock. |
| A newer plugin version starts | It stops the older service and starts its own. When the two versions can't talk to each other, tool calls return Restart Claude Code to update the SimpleX plugin. |
| Sessions of plugin 0.3.0 run after an upgrade | Their session servers connect to the new service with the old default name, SimpleX MCP, and the service renames the Main group to it. The group keeps the name of the last session that started or connected, and its members see group profile updated at each change. Once those sessions end, the next session start sets Claude Control. |
| A session's group has no admin or owner but Claude | Its actions are refused with The group of this session has no admin or owner to approve actions. Members of the Main group join it by /join N there; without members, run npx -y @simplex-chat/mcp@VERSION link in a terminal. |
| A session's group was deleted, or Claude lost its owner role there | The session's actions fail with The group of this session is lost. Start a new Claude Code session. |
| The Main group was deleted, or Claude lost its owner role there | The service logs The Main group is lost. Run npx -y @simplex-chat/mcp@VERSION reset-owners in a terminal. |
| The wrong person joined by the link | Run npx -y @simplex-chat/mcp@VERSION reset-owners in a terminal. |
| The QR code does not scan | Run npx -y @simplex-chat/mcp@VERSION link in a terminal, or paste the link into the app. |
Plugin security
- The service listens only on its local socket, in a folder only the user can read, and every request needs the token. On Windows the named pipe has no folder permissions, so the token is the only check.
- The service gets only the environment variables it uses: the paths of the home, temporary and cache folders, the locale, the proxy and certificate settings,
NODE_OPTIONS, theSIMPLEX_variables and the plugin options. - Everyone in the Main group is trusted with all sessions. In a session's group, rights follow the member's role, see Sessions and their groups.
- Claude Code runs no command from a message of a session's group, even one that starts with
!. Claude gets the text, and its tool use follows Claude Code's permissions. - Only you get the Main group link. The session start shows it, and
linkprints it in a terminal. - A session runs in mode
hostonly after an admin or owner approves it in the session's group. - A tool approved in the session's group runs without the terminal's dialog, and Claude Code's own rules still apply to it. Only an admin or owner approves it, for the rest of the session.
- Claude's files reach the group only while its preference "Files and media" allows them. Owners set it, and SimpleX enforces it. A post that a preference refuses is replaced by Claude's text that names the preference.
- Any program running as you on this computer can replace the Main group and its owners at once, without their approval, with
reset-ownersor a request to the service. - The plugin refuses to send private keys and the files of its data folder, except the files under
files/of the session's own folder. - Peers of a chat see the profile
Claude, or a random profile in a chat connected incognito. - These protections hold against Claude's tools, but not against a shell running as the same user. Such a shell can read the data folder, with the token and the chat databases, and send requests to the service.