AnyEvent-MCP
view release on metacpan or search on metacpan
To pass arguments directly, use "PREFIX --- PROGRAM ARG... ---":
mcp-multibroker --stdio \
vim --- mcp-vim --name editor --bind :: --- --eager \
code --- mcp-fs --name code '/home/alice/project with spaces' ---
Only the invoking shell processes quoting. The broker passes all
arguments between the delimiters unchanged, including empty arguments
and child options. Use "stdio:COMMAND" for shell syntax or a literal
"---" child argument. An empty command or missing closing delimiter is
an error.
"--eager" belongs immediately after its stdio URL or closing "---". An
eager connection failure is logged; the broker does not continuously
restart the child. Later tool use can try connecting again.
Ask the client's human a question
To let the assistant ask you questions, configure its MCP client to
launch:
mcp-ask-user --stdio
Or add the question server to a multibroker:
mcp-multibroker --stdio \
code 'stdio:mcp-fs --name code /home/alice/src/project' \
questions 'stdio:mcp-ask-user'
The LLM can call "ask-user" ("questions.ask-user" through the
multibroker) with a question, up to three suggested answers and room for
free text. For example, tell it to use that tool if choosing among
several possible tasks needs your input. For several fields or other
value types, "ask-form" ("questions.ask-form" through the multibroker)
accepts "message" and "requestedSchema" directly and returns the
standard elicitation response. Both tools use the same configured
presentation mode. Decline and cancel are distinct results; neither
supplies an answer.
By default the multibroker displays questions locally, using YAD or a
terminal. Add "--ask mcp" before the broker entries to use the client's
native forms, or "--ask auto" to select by advertised capability. This
also works with "mcp-ask-user" started separately: give that server
"--ask mcp" so it delegates presentation to its connecting multibroker.
"anyevent-mcp-form-elicitation" is the standalone form renderer. It
reads standard MCP form parameters as UTF-8 JSON on stdin and writes an
accept/decline/cancel response as JSON on stdout.
"PERL_ANYEVENT_MCP_ELICITATION_HELPER" selects a replacement executable.
See anyevent-mcp-form-elicitation for supported fields and mcp-ask-user
for question arguments and result fields.
MAIL AND HTTP TOOLS
Read and organize mail
Configure an IMAP account interactively before starting its MCP server.
Look up provider setup instructions and candidate login commands:
mcp-imap --name personal providers alice@example.net
Replace the example address. Provider OAuth client registrations may not
be usable by unrelated applications. For ordinary password or
app-password authentication, a manual login looks like:
mcp-imap --name personal login method password \
server imap.example.net user alice@example.net tls connect port 993
The password is requested on the terminal, never as a command argument.
For OAuth2, use a provider-approved registration and the suggested
"login method oauth2" parameters. Authorize the intended mail account in
a browser, then paste the entire final redirect URL in the terminal. An
error page at the unserved loopback redirect is expected. See mcp-imap
for OAuth options, refresh tokens and other restrictions.
After login, configure your MCP client to launch:
mcp-imap --stdio --name personal
Or combine it with other servers:
mcp-multibroker --stdio mail --- mcp-imap --name personal --stdio ---
The prefix "mail" produces tools such as "mail.lsub" and
"mail.messages"; "personal" selects the account and its permission
rules. For example, ask your assistant:
List my subscribed mailboxes, then show five recent messages in INBOX,
with their senders and subjects. Do not change any flags.
"lsub" lists subscriptions; "mailboxes" lists all available folders. The
"mailbox" tool can subscribe and unsubscribe, without changing access
rights or deleting messages.
To search, pass a "filter" to "messages", for example:
{
"mailbox": "INBOX",
"limit": 20,
"filter": {
"since": "1-Nov-2026",
"any": [
{"from": "alice@example.net"},
{"subject": "invoice"}
],
"not": {"deleted": true}
}
}
Filter keys are ANDed; "any" adds OR, "all" groups AND, and "not"
negates a group. Searches scan at most 20000 UID values per call, not
20000 existing messages. Whenever "next_cursor" is present, continue
with it as "cursor" and preserve "filter", even on an empty page. "more"
means continuation is needed; "incomplete" means the scan limit was
reached. For targeted whole-mailbox lookups, use "threads". Use the
returned mailbox, UIDVALIDITY and UID together for later operations.
Read tools never mark messages Seen.
Changing flags, moving messages and expunging require separate
permissions. Marking "\\Deleted" does not remove a message permanently;
expunging does. After an interrupted write, inspect the mailbox before
attempting it again. APPEND stores mail (including drafts) but does not
send it. See "TOOLS" in mcp-imap for complete operations and limits.
Use an HTTP request tool
Launch "mcp-http --stdio" or combine it as "web --- mcp-http --stdio
---". For example, ask your assistant:
Fetch https://example.org/ and show the status and page title.
( run in 1.350 second using v1.01-cache-2.11-cpan-f5f21f1076c )