ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MCP/lib/AnyEvent/MCP/Intro.pod
Revision: 1.23
Committed: Thu Oct 22 09:33:07 2026 UTC (12 days ago) by root
Branch: MAIN
CVS Tags: rel-0_62, rel-0_65
Changes since 1.22: +7 -2 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 =head1 NAME
2    
3 root 1.5 AnyEvent::MCP::Intro - using MCP servers, clients and permissions
4 root 1.1
5     =head1 DESCRIPTION
6    
7 root 1.5 You can use the servers in this distribution without writing any Perl.
8     This walkthrough starts with one filesystem server, connects it to an MCP
9     client, and makes a useful request. Once that works, it explains persistent
10     configuration, permissions and combining several servers.
11 root 1.1
12 root 1.5 If you want to write a small server yourself, continue with
13     L<AnyEvent::MCP::Server::Simple/TUTORIAL>. Applications needing their own
14     connection management or dispatch can use the modules described in
15     L<AnyEvent::MCP/MODULES>.
16 root 1.1
17 root 1.5 The examples use C</home/alice/src/project> as an existing project directory.
18     Replace it with your own absolute path. Commands shown here are commands
19     for you to run; requests addressed to the LLM are shown separately.
20    
21     =head1 INSTALLATION
22    
23     Install the Perl distribution and the external programs used by the
24     servers. Installing one does not install the other.
25    
26     For mcp-fs, install Linux bubblewrap and the filesystem utilities. On
27     Debian or Ubuntu, for example:
28    
29     sudo apt install bubblewrap findutils grep patch sed perl yad
30    
31     C<yad> is optional: it supplies graphical permission dialogs.
32     Without a usable YAD dialog, the helper tries C</dev/tty>; if neither is
33     available, it denies the request. Bubblewrap's executable is C<bwrap>.
34     The machine must allow the unprivileged user namespaces it needs.
35    
36     mcp-fs detects its utilities at startup and omits tools whose utilities
37     are unavailable or unsuitable. It requires bubblewrap by default.
38     See L<mcp-fs/TRUSTED CONFIGURATION> for explicit utility paths and
39     L<mcp-fs/LIMITATIONS> for the sandbox's limits.
40    
41     If you have an unpacked distribution or source checkout, run these commands
42     in its top-level directory:
43    
44     perl Makefile.PL
45     make
46     make test
47     make install
48    
49     C<perl Makefile.PL> reports missing Perl dependencies. Install those with
50     your usual package manager or CPAN client before continuing. For example,
51     the main non-core dependencies can be installed with:
52    
53 root 1.19 cpan AnyEvent AnyEvent::HTTP AnyEvent::WebSocket::Server \
54     AnyEvent::WebSocket::Message common::sense JSON::XS
55 root 1.5
56     Use the same Perl installation for dependency installation, building and
57     running the servers. A module installed for the system Perl might not be
58     available to a Perl installed under C</opt>. C<make install> needs write
59     access to the selected Perl's installation directories; use an appropriate
60     local Perl installation or run that final step with the required privileges.
61    
62 root 1.15 Installation puts C<mcp-fs>, C<mcp-multibroker>, C<mcp-vim>, C<mcp-webbrowser>,
63 root 1.5 C<mcp-ask-user>, C<anyevent-mcp> and C<anyevent-mcp-askpermission> in the
64     selected executable directory. Make that directory available in the
65     environment of your MCP client, or configure absolute executable paths.
66     A desktop application need not have the same C<PATH> as your shell.
67    
68     To try an uninstalled source tree after installing its dependencies, you
69     can run a program with the source library path:
70    
71     perl -Ilib bin/mcp-fs --stdio --name code /home/alice/src/project
72    
73     Do this from the distribution directory. When configuring a client to
74     start such a command, account for the client's working directory or use
75     absolute paths to Perl, C<lib> and the script. An installed executable
76     avoids that extra setup.
77    
78 root 1.19 =head1 PICK A SERVER
79 root 1.15
80 root 1.19 For a local MCP client, configure it to launch the server that provides
81     the tools you want:
82 root 1.15
83 root 1.19 mcp-fs --stdio /home/alice/src/project
84     mcp-vim --stdio
85 root 1.15 mcp-webbrowser --stdio
86 root 1.19 mcp-ask-user --stdio
87    
88     C<--stdio> means the MCP client launches the process. Do not start a
89     separate copy in a terminal. For HTTP clients, use a running server and
90     its C<--print-url> instead, as explained below.
91    
92     C<mcp-fs> reads, searches and changes files and runs commands in a sandbox.
93     The first walkthrough below uses this server.
94    
95     C<mcp-vim> reads and edits live Vim buffers. Install the companion Vim plugin
96     and connect the editor to its listener; see L</Add a live Vim editor> and
97     L<mcp-vim/VIM PLUGIN INSTALLATION>.
98 root 1.15
99 root 1.19 C<mcp-webbrowser> works with explicitly approved browser tabs. Install
100     its companion userscript and connect each tab you want to expose; see
101     L</CONNECTED BROWSER PAGES>.
102 root 1.16
103 root 1.19 C<mcp-ask-user> lets the assistant ask you questions through a local
104     YAD or terminal dialog, or through the client's native form UI; see
105     L</Ask the client's human a question>.
106 root 1.15
107 root 1.20 To offer several servers over one MCP connection, use C<mcp-multibroker>.
108     It combines these servers with each other or with third-party MCP servers,
109     whether started locally over stdio or reached over HTTP. Their tools
110     appear under separate name prefixes; see L</COMBINING SERVERS> and
111     L<mcp-multibroker> for the full command syntax.
112 root 1.15
113 root 1.5 =head1 YOUR FIRST FILESYSTEM SERVER
114    
115     Start with one project and one connection. You do not need a multibroker,
116     a hand-written configuration file or saved permission rules yet.
117    
118     =head2 Choose stdio or HTTP
119    
120     Use B<stdio> when your MCP client runs on the same machine and can launch
121     a server process. Configure the client to start the following command:
122    
123     mcp-fs --stdio --name code /home/alice/src/project
124    
125     The client starts this process and uses its stdin/stdout for MCP.
126     You do not start a second copy in a terminal, and there is no listener
127     URL or HTTP token to configure. Diagnostics go to stderr.
128    
129     Clients that take a command and an argument array need these values:
130    
131     command: mcp-fs
132     arguments: --stdio, --name, code, /home/alice/src/project
133    
134     These describe separate arguments, not one shell command string.
135     Use an absolute executable path if the client cannot find C<mcp-fs>.
136     See L</CLIENT EXAMPLES> for examples of particular clients.
137    
138     Use B<HTTP> when the client connects to an already-running server, or when
139     it cannot launch a local process. Start this in a terminal on the server
140     machine and leave it running:
141    
142     mcp-fs --name code --bind :31741 /home/alice/src/project
143    
144     In another terminal, obtain the matching connection URL:
145    
146     mcp-fs --name code --bind :31741 --print-url
147    
148     The second command prints a credential-bearing URL and exits without
149     opening a listener. Configure that URL in the client. The default address
150     is IPv4 loopback, so this example is reachable from the same machine only.
151     A hosted client needs a suitable tunnel or reachable endpoint; its own
152     C<localhost> is not your computer.
153    
154     Repeat the same name and listener overrides when printing the URL.
155     Both commands must use the same user and configuration directory.
156     Port zero chooses an ephemeral port, which C<--print-url> cannot predict;
157     use an explicit port for this walkthrough.
158    
159     The HTTP server generates and saves its private master secret when needed.
160     You can initialize it explicitly with C<anyevent-mcp init>, but that
161     command is unnecessary when configuration already exists and will refuse
162     to replace it. Keep the printed URL private: possession of its token
163     authenticates a client.
164    
165     =head2 Make a useful request
166    
167     Once your client reports that the server is connected, ask the LLM:
168    
169     Show me the configured workdirs. List the top-level files in the
170 root 1.19 project, then read its README if it has one. Do not modify files
171     or run commands.
172 root 1.5
173     C<workdirs> returns the configured paths, sandbox grants, trusted mounts
174     and runtime paths. Listing names requests C<inspect> permission; reading
175     contents requests C<read> permission. Expect a permission prompt when
176     there is no saved rule allowing the operation.
177    
178     Choose C<Allow once> for the first operation. The worker then runs with
179     the requested sandbox grants. A denial is a tool failure that the LLM
180     should report, rather than an empty file or a disconnected server.
181    
182     For a slightly larger task, ask:
183    
184     Find TODO comments in this project and explain the three that look
185     most useful to address next. Do not modify files or run commands.
186    
187     This can use C<find>, C<grep> and C<read-lines>. You need not write MCP
188     requests yourself. If a client offers its own tool-approval prompt, that
189     is an additional client policy; it does not replace mcp-fs's permissions.
190    
191 root 1.19 =head2 Give the server a purpose
192    
193     To explain why an instance exists, provide a short purpose:
194    
195     mcp-fs --stdio --name memory \
196     --custom-instructions 'Use this server to retrieve and store persistent memory.' \
197     /home/alice/memory
198    
199     For persistent configuration, use C<custom_instructions> in the global
200     configuration's C<[program mcp-fs]> or C<[instance memory]> section. Instance
201     settings override program settings; the command line overrides both.
202     This purpose appears first in the advertised MCP instructions so a model can
203     decide whether to discover the server's tools.
204    
205     Servers using C<AnyEvent::MCP::Server::Simple> also expose the instance
206     purpose and complete operating instructions as a C<meta-instructions> tool
207     description. Calling that tool returns the complete text when a client
208     truncates descriptions. Clients that understand MCP server instructions
209     still receive a short purpose or routing hint at discovery time, followed
210     by an automatic pointer to the full instructions in the tool description.
211    
212 root 1.5 =head2 Understand the workdir
213    
214     The directory passed at startup tells mcp-fs which workdir to expose.
215     It does not grant permission for every operation in that directory.
216     Each operation still requests its action and sandbox grants.
217    
218     With one workdir, tools can omit the C<workdir> argument. With several:
219    
220     mcp-fs --stdio --name code /home/alice/src/project /home/alice/notes
221    
222 root 1.14 tools select one using a persistent positive integer ID, a numeric string
223     or an exact configured/resolved path returned by C<workdirs>. The
224     C<workdirs> and C<resolved_workdirs> objects use these IDs as keys.
225     Relative tool paths are relative to that selection. Permission rules
226     continue to use the configured path, not its numeric ID.
227    
228     IDs are shared across filesystem servers in
229     C<$XDG_CONFIG_HOME/anyevent-mcp/fs-workdir-ids.json>, or under
230     C<$HOME/.config> by default. They identify resolved absolute paths and
231 root 1.15 survive restarts and argument reordering. Startup resolves IDs once and
232     reserves new allocations under the lock. A timer runs immediately and every
233     5.25 days to reread the registry and refresh the server's fixed assignments.
234     Other entries expire after seven days and their IDs may be reused. Restart
235     servers after manually changing the registry.
236 root 1.5
237     C<workdir-read> exposes the selected workdir read-only.
238     C<workdir-write> makes it writable and implies read access.
239     A path in another configured workdir requires all-workdirs authority;
240     a path elsewhere requires suitable home/world or shared-tmp authority.
241     A symlink cannot make an unmounted target appear inside the sandbox.
242    
243     Prefer separate, non-overlapping workdirs. Overlapping mounts have
244     unspecified access effects. See L<mcp-fs/SANDBOX GRANTS> before granting
245     access beyond the selected workdir.
246    
247 root 1.6 =head2 Inspect version-control changes
248    
249     For a Git, SVN, CVS or Mercurial working copy, ask the LLM to use
250     C<vcs-diff> and C<vcs-status>, with C<backend> set to C<git>, C<svn>, C<cvs>
251     or C<hg>. C<workdirs> reports the available clients. These tools accept
252     filenames and construct the command themselves; no shell pipeline or arbitrary
253     VCS options need to be approved.
254    
255     For example:
256    
257     Show the CVS diff for this project, limited to 200 lines.
258     Then show its status, keeping stdout lines matching "File:|Status:".
259    
260     These operations have their own permission actions. They request read access
261 root 1.19 to the selected workdir. CVS additionally requests the C<ssh-agent> grant,
262     which includes network access, the agent socket and C<known_hosts>, but not
263     general home-directory access. Read permission for ordinary file tools does
264     not automatically authorize a VCS operation.
265 root 1.6
266     For arbitrary C<exec> commands, the same output options are available:
267     C<grep> filters stdout using PCRE, C<max_lines> limits matching stdout lines,
268     and C<max_bytes> bounds returned bytes per stream. Prefer these options to a
269     shell wrapper that mixes execution and output processing. Stderr is unfiltered,
270     and exit status still describes the original command.
271    
272     Defaults return at most 2000 stdout lines and 64 KiB per stream. Raw capture
273     has a separate 1 MiB limit per stream. A true C<capture_truncated> means
274     output was omitted before filtering or collection ended on timeout, so absent
275     matches do not prove the omitted output had none. See L<mcp-fs/Command output>
276     for all result flags and limits.
277    
278 root 1.5 =head1 CONFIGURING YOUR SETUP
279    
280     There are three different things to configure: how the client connects,
281     how the server runs, and which operations the user allows. Changing one
282     does not necessarily change the other two.
283    
284     =head2 Where each setting belongs
285 root 1.1
286     =over
287    
288 root 1.5 =item Directories to expose
289    
290     Pass workdirs on the mcp-fs startup command. For a stdio server, that
291     command belongs in the client's server configuration. For an HTTP server,
292     it belongs in the command used to run the service.
293 root 1.1
294 root 1.5 =item Connection transport
295 root 1.1
296 root 1.5 The client launches a command for stdio or connects to a URL for HTTP.
297     C<--stdio> selects the former for mcp-fs and the multibroker.
298 root 1.1
299 root 1.5 =item Listener address, port and tokens
300 root 1.1
301 root 1.5 Use C<[instance NAME]> in the global configuration or command-line
302     C<--bind> and C<--token> overrides.
303 root 1.1
304 root 1.5 =item Trusted mounts and utility paths
305    
306     For mcp-fs, use C<[program NAME]> defaults and C<[instance NAME]>
307     overrides in the global configuration.
308    
309     =item Allowed operations and sandbox grants
310    
311     Use the permission rules file, normally created through approval dialogs.
312     This file is separate from the global configuration.
313    
314     =item Location of permission prompts
315    
316 root 1.12 Use C<--ask helper>, C<--ask tty>, C<--ask yad>, C<--ask auto> or C<--ask mcp>, or set
317 root 1.5 C<PERL_ANYEVENT_MCP_PERMISSION_ASK> in the server's environment.
318    
319     =item Combined server connections
320    
321     Put prefix/server pairs on the multibroker startup command. HTTP child
322     credentials can also use C<[client PREFIX]> in the global configuration.
323 root 1.1
324     =back
325    
326 root 1.5 =head2 One complete named configuration
327    
328     The global file is C<$XDG_CONFIG_HOME/anyevent-mcp/global.ini>, falling
329     back to C<$HOME/.config/anyevent-mcp/global.ini>. Settings are UTF-8
330     C<key = value> lines; values are unquoted. Whole-line C<#> and C<;>
331     comments are allowed. See L<AnyEvent::MCP/GLOBAL CONFIGURATION> for the
332     complete format.
333    
334     Start with the existing file, preserving its C<[global]> secret.
335     If you have no file yet, C<anyevent-mcp init> creates it privately.
336 root 1.19 Add this section:
337 root 1.5
338     [instance code]
339     bind = 127.0.0.1:31741
340    
341     Now start:
342    
343     mcp-fs --name code /home/alice/src/project
344    
345     and retrieve its URL with:
346    
347     mcp-fs --name code --print-url
348    
349     Both use C<[instance code]>. No explicit token is needed: the server
350     derives one from its name and the existing master secret.
351    
352     For this setup:
353    
354     instance settings: [instance code]
355     selected workdir: /home/alice/src/project
356 root 1.8 permission file: ~/.config/anyevent-mcp/rules/fs-code.ini
357 root 1.5 rule-manager profile: fs-code
358    
359     The permission pathname above assumes the default configuration directory.
360     C<anyevent-mcp manage-rules fs-code> opens the graphical rule manager;
361     C<anyevent-mcp edit-rules fs-code> opens the file in your editor.
362    
363 root 1.19 Settings shared by all mcp-fs instances go in C<[program mcp-fs]>.
364     Instance settings override program settings.
365    
366 root 1.22 File ownership and permissions are under the user's control. The global
367     configuration contains a master authentication secret, so take care when
368     sharing it. C<--config FILE> on C<anyevent-mcp init>
369 root 1.5 selects that command's output file; it does not make the servers use an
370     arbitrary alternate file. Use the same C<HOME>/C<XDG_CONFIG_HOME>
371     environment when running the server and its management commands.
372    
373     =head2 Names, prefixes and profiles
374    
375     C<--name code> selects instance settings, derived HTTP credentials and
376 root 1.8 mcp-fs's C<rules/fs-code.ini>. Without C<--name>, mcp-fs uses C<default>,
377     giving profile C<fs-default>. Two processes with the same program, name and
378 root 1.5 configuration share credentials and rules, even if their workdirs differ.
379    
380     A multibroker prefix, such as C<files>, only routes tools: C<grep> becomes
381     C<files.grep>. It does not rename the child server or select its rules.
382     For example:
383    
384     mcp-multibroker files \
385     'stdio:mcp-fs --name code /home/alice/src/project'
386    
387     The tools are C<files.*>, but the child still uses instance C<code>
388     and rule-manager profile C<fs-code>. The multibroker's own C<--name>
389     selects its upstream listener settings.
390 root 1.1
391 root 1.5 =head2 Configuration changes and restarts
392 root 1.1
393 root 1.5 Command-line listener options override the named global settings.
394     For mcp-fs trusted settings, an instance entry overrides the corresponding
395     program entry; an empty instance mount value suppresses the inherited mount.
396 root 1.1
397 root 1.5 Workdirs, mounts, utility paths, listener settings and tokens are read at
398     startup. Change the file or startup command, then restart the affected
399     server. The multibroker also needs restarting to change its prefix/server
400     pairs; refreshing discovery does not change those pairs.
401    
402     Permission rules are reread on permission checks, so editing them does
403     not require a restart. A client's displayed tool list can still be cached.
404     After restarting a child, refresh tool discovery or reconnect the client
405     as described in L</COMBINING SERVERS>.
406    
407     =head1 PERMISSIONS IN PRACTICE
408    
409     HTTP authentication establishes that the client may connect.
410     Permission checks decide whether a tool may perform an operation.
411     A correct token therefore does not prevent permission prompts.
412    
413     =head2 What the prompt means
414    
415     The prompt describes an action, paths or command, a reason and sandbox
416     grants. For filesystem tools, the actions are:
417    
418 root 1.6 inspect stat, list, find
419     read file-read, read-lines, grep
420     write file-write, file-patch
421     manage path-op
422     exec arbitrary command execution
423     vcs-diff working-copy differences
424     vcs-status working-copy status
425 root 1.5
426     The action and grants are independent. Allowing C<read> does not allow
427     C<write>, even if a worker grant permits both kinds of filesystem access.
428     C<exec> runs arbitrary commands; it is not a classification of supposedly
429     safe command prefixes.
430    
431     Choose allow/deny once, or always. Closing the dialog denies once.
432     An optional denial reason is returned with the error; it is not added to
433 root 1.13 successful tool results. An always choice opens a rule editor. Choose an
434     indefinite lifetime (the default), 900 seconds or 16 hours. Finite lifetimes
435     are stored as C<expires> Unix timestamps. Expired rules disappear on every
436     read; the next ordinary save removes them from disk. Expiry affects future
437     permission checks, not operations already authorized.
438 root 1.5 Filesystem allow rules can select grants and the selected workdir when
439     the authority depends on it. Deny rules can also select an exact affected
440     path. Exec offers persistent command/argv subjects.
441    
442     For exec, C<View stdin...> lets you inspect supplied input without closing
443 root 1.9 the approval dialog. Filesystem and Vim patch tools similarly offer
444     C<View patch...>, including the target file or editor and buffer. Longer
445     text is shown as an explicitly incomplete preview. These are YAD button
446     labels; other interfaces can show the details inline.
447     That input is display-only: an exec allow rule does
448 root 1.5 not constrain future stdin. Allowing an interpreter command can therefore
449     allow a different script on its next invocation.
450    
451     A worker accessing several paths requests their combined sandbox authority
452     once. If the chosen grants are insufficient, it fails before starting.
453    
454     =head2 Save a useful read-only policy
455    
456     After trying individual operations, you might want the LLM to inspect and
457     read the project without asking each time, while keeping changes subject
458 root 1.8 to approval. Put these rules in C<rules/fs-code.ini>, or create equivalent
459 root 1.5 allow rules through the prompt:
460    
461     [rule]
462     decision=allow
463     action=inspect
464     workdir=/home/alice/src/project
465     sandbox-grants=workdir-read
466    
467     [rule]
468     decision=allow
469     action=read
470     workdir=/home/alice/src/project
471     sandbox-grants=workdir-read
472    
473     [rule]
474     decision=deny
475     action=exec
476 root 1.1
477 root 1.5 Use the exact workdir spelling passed at server startup. Absolute startup
478 root 1.22 paths make this easier. Rule-file permissions follow the usual Unix filesystem
479     rules; any user who can edit the file can change the server's approval policy.
480    
481     Without matching rules, write and manage operations still ask. The final rule
482     denies command execution outright; omit it if you want execution to ask instead.
483 root 1.1
484 root 1.5 Rules run in order, stopping at the first match. An allow rule matches only
485     when its grants cover the request, including implications.
486     C<workdir-write> implies C<workdir-read>; C<network> remains independent.
487     Action and subject match exactly unless beginning with C<^>, which selects
488     a Perl regular expression. Workdir matching is always exact.
489     An explicit C<ask> rule can override later allow rules.
490    
491     These allow rules authorize sandbox access to the selected workdir.
492     They cannot confine authority to one file or a subtree inside it.
493     Filesystem operations do not offer persistent path subjects.
494     An exact C<path> matcher is available for deny rules only.
495     Trusted runtime and configured mounts remain baseline access independently
496     of these grants. See L<mcp-fs/TRUSTED CONFIGURATION>.
497    
498     =head2 Change or remove saved rules
499    
500     Use:
501    
502     anyevent-mcp manage-rules fs-code
503     anyevent-mcp edit-rules fs-code
504    
505     The first command lets you delete and reorder rules in YAD.
506     The second uses C<$VISUAL>, C<$EDITOR>, C<sensible-editor> or C<vi>.
507     An earlier deny or ask rule can explain why adding a later allow rule
508     does not change the result.
509    
510     For a custom application with another rule pathname, use:
511    
512     anyevent-mcp manage-rules-file /path/to/rules.ini
513     anyevent-mcp edit-rules-file /path/to/rules.ini
514    
515     A failed attempt to save a permanent rule is an error, not a successful
516 root 1.22 permanent approval. The file mode is preserved when saved through these
517     commands. For full syntax and programming interfaces, see
518 root 1.5 L<AnyEvent::MCP::Server::Permissions>.
519    
520     =head2 Choose where to ask
521    
522     The default C<helper> mode runs C<anyevent-mcp-askpermission> on the server
523     machine. It tries YAD, then C</dev/tty>, then denies if neither can be used.
524     The helper inherits the server's display environment.
525 root 1.12 C<--ask tty> and C<--ask yad> instead force the built-in terminal or YAD
526     interface. They ignore custom helper settings and never try another
527     interface. These modes work for permission prompts and ordinary forms,
528     including forms handled by a multibroker.
529 root 1.5 C<PERL_ANYEVENT_MCP_PERMISSION_HELPER> selects a different executable.
530    
531     For a modern client supporting MCP form elicitation, you can instead use:
532    
533     mcp-fs --stdio --name code --ask auto /home/alice/src/project
534    
535     C<auto> uses the client's form support when advertised for that request,
536     otherwise the local helper. C<mcp> requires that support and fails when
537     unavailable. It does not silently fall back. Use client-side permission
538     approval only when that client is a trusted authority to grant access.
539    
540     To set the default for servers using the shared permission engine:
541    
542     PERL_ANYEVENT_MCP_PERMISSION_ASK=auto \
543     mcp-fs --stdio --name code /home/alice/src/project
544    
545     An explicit application C<ask> setting or C<--ask> overrides the environment.
546     For spawned stdio children, C<mcp-multibroker --ask auto> passes this
547     default to them. It cannot change the environment of an independently
548     running HTTP server.
549    
550 root 1.7 The multibroker can handle form elicitation locally for both stdio and HTTP
551     children. C<--ask helper> selects local dialogs even if the upstream client
552     advertises native forms; C<--ask mcp> forwards forms upstream, and C<auto>
553     uses native forms when advertised. If a client claims support but silently
554     declines questions, use C<helper>. A decline never causes a fallback prompt.
555    
556     Standalone C<mcp-ask-user> also supports these modes and defaults to the
557     local helper. A question is different from an approval: answering it does
558     not grant a filesystem worker any authority.
559 root 1.5
560     =head1 COMBINING SERVERS
561    
562 root 1.20 Once the first connection works, C<mcp-multibroker> lets you give the
563     client one connection for several MCP servers. It works with the servers
564     in this distribution and with third-party MCP servers, including ones
565     written in other languages. Each downstream server can be a local
566     subprocess communicating over stdio or an existing HTTP endpoint; you
567     can mix both in one broker. The broker discovers their tools and
568     forwards calls to the appropriate server without changing how that
569     server implements its tools.
570    
571     For example, combine two filesystem instances:
572 root 1.5
573     mcp-multibroker --name tools --bind :31740 \
574     code 'stdio:mcp-fs --name code /home/alice/src/project' \
575     notes 'stdio:mcp-fs --name notes /home/alice/notes'
576    
577     Quote each C<stdio:> shell command as one argument.
578     The broker supplies the child's stdio environment and starts ordinary
579     children lazily, on first use. The explicit child names give them separate
580     permission profiles C<fs-code> and C<fs-notes>.
581    
582     Obtain the upstream HTTP URL with:
583    
584     mcp-multibroker --name tools --bind :31740 --print-url
585    
586     Configure this URL in place of the client's old direct connection.
587     The client can now see C<code.grep>, C<code.read-lines>, C<notes.find>
588     and other prefixed tools. It does not need a separate connection to each
589     child.
590    
591     For a client launching the multibroker locally, configure:
592    
593     mcp-multibroker --stdio --name tools \
594     code 'stdio:mcp-fs --name code /home/alice/src/project' \
595     notes 'stdio:mcp-fs --name notes /home/alice/notes'
596    
597     C<--stdio> selects the upstream connection. The child commands still use
598     C<stdio:>; that selects each downstream connection independently.
599     No upstream HTTP URL is needed in this case.
600    
601 root 1.20 The same setup can include Vim, browser pages, a third-party stdio
602     server or a remote HTTP service. See L</Add an HTTP child> for an
603     example mixing local and remote servers, and L<mcp-multibroker/DOWNSTREAM
604     SERVERS> for the complete syntax, including direct argv execution,
605     credentials and per-child options.
606    
607 root 1.5 =head2 Discover and refresh tools
608    
609     Ask the LLM:
610    
611     Call discover-brokers and list-tools, then show me which servers
612     are available and what each is for.
613    
614 root 1.17 C<discover-brokers> returns advertised instructions (which may be short),
615     no instructions, or an error for each configured server.
616     C<list-tools> requests current tool definitions, including any prefixed
617     C<meta-instructions> tools and their full instruction descriptions;
618 root 1.5 unreachable servers are omitted. A reachable server can still fail later.
619    
620     If the client still has an old direct tool list, C<call-tool> can invoke
621     an exact prefixed name found by C<list-tools>. Refresh the client's MCP
622     connection if it continues to hide newly available tools.
623    
624 root 1.15 Discovery queries configured servers and currently registered reverse
625     connections. Changing the static downstream command still requires a restart.
626    
627     =head2 Let a server connect to the multibroker
628    
629     To add independently started servers without editing the multibroker command,
630     keep its HTTP/extension listener active alongside stdio:
631    
632     mcp-multibroker --stdio --listen --bind 127.0.0.1:31740
633     mcp-multibroker --bind 127.0.0.1:31740 --print-url
634    
635     Append an alias to the returned credential-bearing URL:
636    
637     mcp-fs --connect http://127.0.0.1:31740/TOKEN/files /home/alice/project
638    
639     The filesystem server initiates the TCP connection but remains the MCP server.
640     The multibroker authenticates the same token used for HTTP, registers the
641     alias and discovers the tools. A configured or connected alias cannot be
642     replaced. After disconnecting, the server retries once per second for sixty
643     attempts. Pending calls fail and are never replayed. Remote registration does
644     not grant the multibroker spawned-child shutdown authority.
645    
646     The hello is a raw JSON line, followed by ordinary MCP JSONL on the same socket;
647     the HTTP-shaped URL is an address and credential, not an HTTP request.
648     The bundled connector supports plain C<http://> endpoints. An HTTP listener is
649     already active by default when the upstream connection is HTTP.
650 root 1.5
651     =head2 Add an HTTP child
652    
653 root 1.20 A broker can mix spawned stdio servers and existing HTTP endpoints,
654     including independently implemented third-party servers:
655 root 1.5
656     mcp-multibroker --stdio \
657     code 'stdio:mcp-fs --name code /home/alice/src/project' \
658     remote https://example.org/mcp/ --bearer TOKEN
659    
660     C<--bearer> immediately after the HTTP pair belongs to that child.
661     C<--token> before all pairs configures the multibroker's own HTTP listener.
662     They authenticate different connections.
663    
664     To avoid putting a child's bearer token in the startup command, add:
665    
666     [client remote]
667     bearer = TOKEN
668     timeout = 300
669    
670     to the private global configuration, and omit C<--bearer> from the command.
671     The prefix C<remote> selects these client defaults. The command-line URL
672     still chooses the endpoint. Use the actual credential accepted by that
673     server, not the literal placeholder C<TOKEN>.
674    
675     A token already present in a child's URL needs no separate bearer option.
676     The bundled servers use static URL-safe tokens; they do not validate
677     OAuth access tokens or implement HTTP Basic authentication.
678     Use TLS or an appropriate tunnel when credentials cross untrusted networks.
679    
680     The multibroker does not put every child inside the mcp-fs sandbox.
681     Each process or remote service has its own authority and enforcement.
682    
683     =head2 Add a live Vim editor
684    
685     Install the Vim plugin using L<mcp-vim/VIM PLUGIN INSTALLATION>. It is
686     included in the source distribution but is not installed by Perl's
687     C<make install>.
688    
689 root 1.19 Without a multibroker, configure the MCP client to launch:
690    
691     mcp-vim --stdio --name editor
692    
693     Even in stdio mode, mcp-vim listens separately for editor connections.
694     If using a multibroker, start its child eagerly so Vim can connect
695     before the first MCP tool call:
696 root 1.5
697     mcp-multibroker --stdio \
698     code 'stdio:mcp-fs --name code /home/alice/src/project' \
699     vim 'stdio:mcp-vim --name editor' --eager
700    
701 root 1.19 In another terminal, obtain the editor broker's URL prefix:
702 root 1.5
703     mcp-vim --name editor --print-url
704    
705     Append the desired target name in Vim:
706    
707     :Mcp http://HOST:PORT/TOKEN/my-editor
708    
709     Use the actual printed prefix in place of C<http://HOST:PORT/TOKEN/>.
710 root 1.19 Ask the LLM to call C<targets>, then C<state> before reading or editing
711     buffers (C<vim.targets> and C<vim.state> through the multibroker).
712     These tools see live, possibly unsaved buffers. Edits require a current
713     changedtick and do not save files to disk.
714 root 1.5
715 root 1.13 To pass arguments directly, use C<PREFIX --- PROGRAM ARG... --->:
716    
717     mcp-multibroker --stdio \
718     vim --- mcp-vim --name editor --bind :: --- --eager \
719     code --- mcp-fs --name code '/home/alice/project with spaces' ---
720    
721     Only the invoking shell processes quoting. The broker passes all arguments
722     between the delimiters unchanged, including empty arguments and child options.
723     Use C<stdio:COMMAND> for shell syntax or a literal C<---> child argument.
724     An empty command or missing closing delimiter is an error.
725    
726     C<--eager> belongs immediately after its stdio URL or closing C<--->.
727 root 1.5 An eager connection failure is logged; the broker does not continuously
728     restart the child. Later tool use can try connecting again.
729    
730     =head2 Ask the client's human a question
731    
732 root 1.19 To let the assistant ask you questions, configure its MCP client to launch:
733    
734     mcp-ask-user --stdio
735    
736     Or add the question server to a multibroker:
737 root 1.5
738     mcp-multibroker --stdio \
739     code 'stdio:mcp-fs --name code /home/alice/src/project' \
740     questions 'stdio:mcp-ask-user'
741    
742 root 1.19 The LLM can call C<ask-user> (C<questions.ask-user> through the multibroker)
743     with a question, up to three suggested answers and room for free text.
744     For example, tell it to use that tool if choosing among several possible
745     tasks needs your input. For several fields or other value types,
746     C<ask-form> (C<questions.ask-form> through the multibroker) accepts
747 root 1.10 C<message> and C<requestedSchema> directly and returns the standard
748     elicitation response. Both tools use the same configured presentation mode.
749 root 1.5 Decline and cancel are distinct results; neither supplies an answer.
750    
751 root 1.7 By default the multibroker displays questions locally, using YAD or a terminal.
752     Add C<--ask mcp> before the broker entries to use the client's native forms,
753     or C<--ask auto> to select by advertised capability. This also works with
754     C<mcp-ask-user> started separately: give that server C<--ask mcp> so it
755     delegates presentation to its connecting multibroker.
756    
757     C<anyevent-mcp-form-elicitation> is the standalone form renderer. It reads standard MCP
758     form parameters as UTF-8 JSON on stdin and writes an accept/decline/cancel
759     response as JSON on stdout. C<PERL_ANYEVENT_MCP_ELICITATION_HELPER> selects
760     a replacement executable. See L<anyevent-mcp-form-elicitation> for supported fields
761     and L<mcp-ask-user> for question arguments and result fields.
762 root 1.5
763 root 1.19 =head1 CONNECTED BROWSER PAGES
764    
765     C<mcp-webbrowser> is the browser-page counterpart to C<mcp-vim>. It exposes
766     only tabs explicitly allowed by the browser user. Configure your MCP client
767     to launch:
768    
769     mcp-webbrowser --stdio
770    
771     The broker keeps its own HTTP/WebSocket listener active even in stdio mode;
772     the userscript connects to that listener, not to MCP's stdio stream.
773     In a separate terminal, obtain its URL:
774    
775     mcp-webbrowser --print-url
776    
777     Use the same instance name and configuration as the broker. Keep this
778     credential-bearing URL private.
779     Install the companion userscript from
780     C<webbrowser/mcp-webbrowser.user.js> in the source distribution or from
781     L<https://dist.schmorp.de/mcp-webbrowser/1/mcp-webbrowser.user.js>.
782     Chromium with ScriptCat has been tested. On a tab you want to expose,
783     choose B<Allow MCP access to this tab> from the userscript menu and enter
784     the printed URL when prompted. Other tabs remain unexposed.
785    
786 root 1.21 The broker supplies C<tabs>, C<execute> and C<add-element> tools, permission
787 root 1.19 prompts, cancellation and execution timeouts. See
788     L<mcp-webbrowser/USERSCRIPT INSTALLATION AND USE> for setup, compatibility
789     and the current ScriptCat discarded-tab limitation.
790    
791     If the multibroker launches the browser broker, keep that child running
792     from startup so browser tabs can connect:
793    
794     mcp-multibroker --stdio browser --- mcp-webbrowser --- --eager
795    
796 root 1.5 =head1 HTTP TOKENS AND SERVER IDENTITY
797    
798     For the ordinary bundled HTTP endpoints, a client can present an accepted
799     token in either of these ways:
800    
801     POST /TOKEN/
802     POST / Authorization: Bearer TOKEN
803    
804     URL tokens are path components, not browser cookies.
805     For another configured endpoint, C</TOKEN> prefixes that endpoint path.
806 root 1.23 The HTTP server also accepts C</TOKEN> and the corresponding bare path
807     without the final slash when the endpoint is configured with one. This
808     works around clients (observed with Claude) that drop the final slash
809     from a configured URL.
810 root 1.5 All accepted tokens authenticate the same operations; they are not separate
811     users or permission levels. Permissions still govern the tool operation.
812    
813     By default, the master secret and server name determine one stable token
814     and a port in 16384..32767. Changing a server's name changes its derived
815     credentials and default port. Changing or losing the master secret changes
816     all derived credentials. Keep an existing C<[global]> secret when editing
817     other configuration.
818    
819     To configure explicit tokens:
820    
821     [instance code]
822     tokens = first-secret,second-secret
823 root 1.1
824 root 1.5 Replace those placeholders with actual unguessable URL-safe tokens.
825     Repeated C<--token> options replace the whole configured list and the
826     derived default. The first token appears in C<--print-url>; all are accepted.
827     mcp-vim also accepts its token set for Vim and browser WebSocket connections.
828    
829     If C<--print-url> disagrees with the client's URL, compare the name,
830     command-line overrides, user and configuration environment with the running
831     process. The command resolves configuration; it does not ask the running
832     server which URL it uses. A changed file needs a server restart.
833    
834     An Origin allowlist restricts browser origins; it does not authenticate
835     clients. A CORS preflight can succeed without a token, while the MCP POST
836     still requires one. See L<AnyEvent::MCP::Server::HTTP/AUTHENTICATION> for
837     the low-level server interface.
838    
839     =head1 CLIENT EXAMPLES
840    
841     Client settings and command syntax evolve independently of this distribution.
842     These examples show the connection choices; consult the linked client
843     documentation if its interface differs. Replace illustrative paths and
844     credentials with your own.
845 root 1.1
846 root 1.5 =head2 OpenAI Codex CLI
847 root 1.1
848 root 1.5 For the first direct filesystem connection:
849 root 1.1
850 root 1.5 codex mcp add code -- \
851     mcp-fs --stdio --name code /home/alice/src/project
852 root 1.1 codex mcp list
853    
854 root 1.5 For a multibroker connection:
855    
856     codex mcp add mytools -- \
857     mcp-multibroker --stdio \
858     code 'stdio:mcp-fs --name code /home/alice/src/project'
859    
860 root 1.1 Use C</mcp> within Codex to inspect connections.
861     See L<Codex MCP documentation|https://learn.chatgpt.com/docs/extend/mcp>.
862    
863 root 1.5 =head2 Anthropic Claude Code
864 root 1.1
865 root 1.5 For the direct connection:
866 root 1.1
867 root 1.5 claude mcp add --transport stdio --scope user code -- \
868     mcp-fs --stdio --name code /home/alice/src/project
869 root 1.1 claude mcp list
870    
871 root 1.5 Replace the launched command with the multibroker command above when you
872     want several servers. Use C</mcp> for connection status. See
873 root 1.1 L<Claude Code MCP documentation|https://code.claude.com/docs/en/mcp>.
874    
875 root 1.5 =head2 Google Gemini CLI
876 root 1.1
877 root 1.5 Merge a direct server entry into C<~/.gemini/settings.json>:
878 root 1.1
879     {
880     "mcpServers": {
881 root 1.5 "code": {
882     "command": "mcp-fs",
883 root 1.1 "args": [
884 root 1.5 "--stdio", "--name", "code", "/home/alice/src/project"
885     ]
886 root 1.1 }
887     }
888     }
889    
890 root 1.5 For a combined connection, use C<mcp-multibroker> as the command and its
891     C<--stdio> and prefix/server pairs as the argument array.
892     Use C</mcp> to inspect the connection. See
893     L<Gemini CLI MCP documentation|https://geminicli.com/docs/tools/mcp-server/>.
894    
895     =head2 Hosted clients, including ChatGPT web
896    
897     A hosted client cannot spawn your local stdio command or reach your
898 root 1.21 machine's loopback address directly. A Secure MCP Tunnel runs locally,
899     connects out to OpenAI, and forwards MCP requests to a local stdio command
900     or HTTP URL. No public listener or inbound firewall port is needed.
901    
902     First create a tunnel in OpenAI Platform tunnel settings and obtain its
903     C<tunnel_...> ID and a runtime API key. Arrange for
904     C<CONTROL_PLANE_API_KEY> to be set securely in the tunnel client's
905     environment; do not put a real key in a script, command line or example.
906     Associate the tunnel with the ChatGPT workspace where you want to use it.
907    
908     For B<stdio>, put the server startup command in a small executable wrapper,
909     for example C</home/alice/bin/my-mcp>:
910    
911     #!/bin/sh
912     exec mcp-multibroker --stdio \
913     code --- mcp-fs --name code /home/alice/src/project --- \
914     questions --- mcp-ask-user ---
915    
916     With a tunnel installation providing C<tunnel-client-runtime>, run:
917    
918     tunnel-client-runtime run \
919     --log.format=struct-text \
920     --log.level=warn \
921     --control-plane.tunnel-id=tunnel_... \
922     --mcp.connection-max-ttl=120s \
923     --mcp.command=/home/alice/bin/my-mcp
924    
925     The tunnel starts the wrapper as its stdio MCP server. Do not start a
926     separate copy yourself. Make the wrapper executable and ensure its
927     programs and Perl modules are on the tunnel process's C<PATH>.
928 root 1.5
929 root 1.21 For B<HTTP>, instead start the server or multibroker separately:
930    
931     mcp-multibroker --name tools --bind 127.0.0.1:16586 \
932     code 'stdio:mcp-fs --name code /home/alice/src/project'
933    
934     Obtain the matching credential-bearing URL:
935    
936     mcp-multibroker --name tools --bind 127.0.0.1:16586 --print-url
937    
938     Then point the tunnel runtime at that URL, rather than a command:
939    
940     tunnel-client-runtime run \
941     --log.format=struct-text \
942     --log.level=warn \
943     --control-plane.tunnel-id=tunnel_... \
944     --mcp.connection-max-ttl=120s \
945     --mcp.server-url=http://127.0.0.1:16586/TOKEN/
946    
947     Replace C<TOKEN> with the actual URL path printed above, and keep it
948     private. In this mode, the multibroker must remain running separately;
949     the tunnel only connects to it. Both modes require the tunnel runtime
950     to remain active while the hosted client uses the server. Use B<one>
951     of C<--mcp.command> and C<--mcp.server-url>, not both.
952    
953     In ChatGPT, add a custom MCP server using a Tunnel connection and select
954     the tunnel ID. Creation and visibility depend on the Platform and ChatGPT
955     workspace permissions. The tunnel client's CLI and supported configuration
956     forms can vary between releases; the examples above use the direct runtime
957     CLI rather than its optional profile setup. See
958     L<Secure MCP Tunnel|https://developers.openai.com/api/docs/guides/secure-mcp-tunnels>
959     for obtaining a tunnel, runtime, credentials and connecting it to ChatGPT.
960 root 1.5
961     =head1 TROUBLESHOOTING
962    
963     =head2 The server does not start
964    
965     Read stderr or the client's server log. Missing Perl modules, a missing
966     workdir, unsuitable utilities or an unavailable bubblewrap executable can
967     fail startup. Confirm that the client launches the same executable and
968     arguments you intended, with the expected C<PATH> and Perl installation.
969    
970     For a local sandbox check, run from the project directory:
971    
972     mcp-fs --exec-cmd workdir-read -- ls
973 root 1.1
974 root 1.5 This runs C<ls> with the named grants and trusted baseline mounts, without
975     MCP or saved permission rules. A failure here can identify a bubblewrap
976     or runtime problem. It does not test the client connection or approval UI.
977     C<--sandbox none> disables isolation and changes worker authority; it is
978     not a fix that preserves the same permission boundary.
979 root 1.1
980 root 1.5 =head2 The client cannot connect
981    
982     For stdio, configure a command the client launches, rather than a URL.
983     A separately running stdio process is not the client's connection.
984     Do not put banners or diagnostics on stdout.
985    
986     For HTTP, leave the server running and check its address and port.
987     C<--print-url> exits without starting it. Loopback binds accept local
988     connections only; hosted or remote clients need the appropriate route or
989     tunnel. An occupied port causes a listener error, so check the server log.
990    
991     =head2 Authentication fails
992    
993     Obtain the URL with the same name, bind/token overrides and configuration
994 root 1.23 environment as the running process. Use the complete path; the final
995     slash is optional for endpoints whose configured path ends in one.
996     A clean URL needs an accepted bearer token.
997 root 1.5
998     A multibroker child credential is not necessarily the upstream listener's
999     credential. C<--bearer> after a child pair and C<--token> before the pairs
1000     configure different sides of the connection.
1001    
1002     If the server warns that it cannot save the master secret, another process
1003 root 1.22 may derive a different token. Check write access to the global configuration.
1004     Do not replace an existing secret simply to add a setting.
1005 root 1.5
1006     =head2 Connected, but there are no tools
1007    
1008     Inspect the server's stderr for omitted utilities. mcp-fs's C<workdirs>
1009     tool reports configuration even when a utility-dependent tool is absent.
1010     For a multibroker, call C<discover-brokers> to see individual connection
1011     errors, then C<list-tools> to refresh definitions.
1012    
1013     A third-party child might require initialization or features this client
1014     implementation does not support. See L<AnyEvent::MCP::Client> and its
1015     transport documentation for limitations.
1016    
1017     =head2 There is no approval dialog
1018    
1019     First check whether the tool was denied by a saved rule or is waiting for
1020     the client's own approval. An allowed operation needs no server prompt.
1021    
1022     The default helper runs on the server machine. A background service may
1023     have neither a usable display nor C</dev/tty>, even though your interactive
1024     shell has both. Supply the appropriate display environment, a usable helper,
1025     or C<--ask auto> with a modern client supporting form elicitation.
1026     C<--ask mcp> reports an error if that support is absent.
1027    
1028     Setting an asking mode cannot make an unsupported client display a form.
1029     Check stderr and the tool error instead of assuming a missing dialog is
1030     an approval.
1031    
1032     =head2 It asks again after I chose allow
1033 root 1.1
1034 root 1.5 Allow-once covers one tool invocation, including its permission retries.
1035     The next invocation asks again. Use allow-always to save a rule.
1036 root 1.1
1037 root 1.5 Inspect the saved rule's action, workdir and grants. Listing names and
1038     reading contents are different actions. A rule for one exact workdir
1039     spelling will not match a differently spelled startup argument.
1040     A request for extra authority, such as networking, does not match a
1041     workdir-read-only allow rule. Earlier ask or deny rules take precedence.
1042 root 1.1
1043 root 1.5 Confirm that the prompt's permanent rule was successfully saved and that
1044     you are editing the rules for the actual child name, not merely its
1045     multibroker prefix.
1046 root 1.1
1047 root 1.5 =head2 The worker cannot see a directory or executable
1048 root 1.1
1049 root 1.5 The worker sees granted mounts and trusted baseline mounts, not everything
1050     the server process can see. Check C<workdirs> for the selected path, mounts
1051     and runtime paths. A symlink target outside those mounts is unavailable.
1052 root 1.1
1053 root 1.19 The ordinary sandbox runtime includes C</usr>, C</bin> and system libraries,
1054     but not C</opt>. For tools or libraries under C</opt>, add this to
1055     C<[program mcp-fs]> in the private global configuration:
1056    
1057     mount.opt = ro:/opt
1058    
1059     This assumes C</opt> exists. Restart mcp-fs after changing trusted mounts.
1060     If your worker Perl is C</opt/bin/perl>, you can also set
1061     C<executable.perl = /opt/bin/perl> in that program section. Supply the
1062     actual executable path: selecting it does not itself mount the
1063     executable or its dependencies inside the worker.
1064    
1065 root 1.5 A trusted mount supplies baseline access to every worker using it; a
1066     writable mount likewise supplies baseline write authority.
1067 root 1.1
1068 root 1.5 An arbitrary command might also need its user's configuration or repository
1069     credentials under HOME, or network access. Request the corresponding grants
1070     when needed; do not assume C<workdir-read> includes them.
1071 root 1.7 For example, CVS over SSH can use C<workdir-read> and C<ssh-agent>.
1072     The latter includes network access, the agent socket and C<~/.ssh/known_hosts>,
1073     without exposing private key files or the rest of HOME. The broker must
1074     inherit C<SSH_AUTH_SOCK> from your environment. User-configured helpers
1075     outside the runtime mounts need an explicit trusted mount.
1076     An explicit exec grant array replaces the default rather than adding to it.
1077 root 1.1
1078 root 1.5 =head2 My configuration change seems to be ignored
1079 root 1.1
1080 root 1.5 Check which file and section the process actually selects. Global settings
1081     use the server user's C<HOME>/C<XDG_CONFIG_HOME>. Instance names, program
1082     basenames and multibroker prefixes serve different purposes.
1083 root 1.1
1084 root 1.5 Restart after changing startup settings, mounts or utilities. Permission
1085     rules need no restart, but their order still matters. Refresh discovery
1086     after a child restart; reconnect a client that retains an old tool list.
1087     C<--print-url> reads the current configuration, which can differ from an
1088     older running process.
1089 root 1.1
1090 root 1.5 =head2 The command failed, but the MCP request succeeded
1091 root 1.1
1092 root 1.5 C<exec> reports exit status, signal or timeout as a normal tool result.
1093     A successful MCP exchange is not a successful Unix command.
1094     Conversely, a transport failure does not prove a command did nothing:
1095     it may have completed before the connection was lost. Calls are not
1096     automatically replayed after a transport failure.
1097 root 1.1
1098 root 1.11 =head1 TESTING
1099    
1100     The default test level is 0. It checks protocol behaviour, permissions,
1101     validation and ordinary process operation, including worker cancellation
1102     and reaping. Watchdogs allow slow machines time to finish; they do not
1103     make successful tests wait for the whole timeout.
1104    
1105     prove -Ilib t
1106    
1107     Set C<PERL_ANYEVENT_MCP_TESTS> to 1 to include the extended tests:
1108    
1109     PERL_ANYEVENT_MCP_TESTS=1 prove -Ilib t
1110    
1111     Level 1 adds GNU find/grep/sed/patch operations, real Vim scripting, browser
1112     transfer integration, short idle-lifetime tests, a helper descendant holding
1113     a pipe open, and tests which deliberately wait for a command timeout or
1114     cancel a form helper across several processes. Run this level before releases.
1115     Values greater than 1 currently select the same tests as level 1.
1116    
1117     Missing GNU utilities or required Vim functions cause explicit skips even
1118     at level 1. The permission and form UI tests use a YAD stand-in: neither
1119     level requires YAD, X11 or an interactive display. The filesystem tests
1120     use a bubblewrap stand-in and check arguments and worker behaviour; they
1121     do not test kernel isolation. The browser tests use simulated peers.
1122    
1123 root 1.5 =head1 WHERE TO GO NEXT
1124 root 1.1
1125 root 1.5 For available tools and server-specific options:
1126 root 1.1
1127     perldoc mcp-fs
1128     perldoc mcp-multibroker
1129 root 1.5 perldoc mcp-vim
1130     perldoc mcp-ask-user
1131 root 1.1 perldoc anyevent-mcp
1132    
1133 root 1.5 For a complete first Perl server, options, replies, permission checks and
1134     asynchronous work, see L<AnyEvent::MCP::Server::Simple/TUTORIAL>.
1135     For the module map and shared configuration reference, see L<AnyEvent::MCP>.
1136     For permission rule details, see L<AnyEvent::MCP::Server::Permissions>.
1137 root 1.1
1138     =head1 SEE ALSO
1139    
1140     L<AnyEvent::MCP>, L<AnyEvent::MCP::Server::Simple>,
1141 root 1.5 L<mcp-fs>, L<mcp-multibroker>, L<mcp-vim>, L<mcp-ask-user>,
1142     L<AnyEvent::MCP::Server::Permissions>
1143 root 1.1
1144     =cut