| 1 | package App::MCP::CLI; | ||
| 2 | |||
| 3 | 30 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 30 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 30 | ▶ | use version; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 30 | our $VERSION = qv('v0.0.1'); | |
| 8 | 30 | our $AUTHORITY = 'cpan:MANWAR'; | |
| 9 | |||
| 10 | =encoding utf8 | ||
| 11 | |||
| 12 | =head1 NAME | ||
| 13 | |||
| 14 | App::MCP::CLI - Command line interface for MCP servers | ||
| 15 | |||
| 16 | =head1 VERSION | ||
| 17 | |||
| 18 | Version v0.0.1 | ||
| 19 | |||
| 20 | =head1 SYNOPSIS | ||
| 21 | |||
| 22 | # Install and run via the bundled script | ||
| 23 | mcpcli list | ||
| 24 | mcpcli call <tool_name> [key=value ...] | ||
| 25 | mcpcli interactive --server myserver | ||
| 26 | |||
| 27 | =cut | ||
| 28 | |||
| 29 | 30 | ▶ | use App::Cmd::Setup -app; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | |||
| 31 | 30 | ▶ | sub plugin_search_path { 'App::MCP::CLI::Command' } |
|
Subroutine
plugin_search_path: called CC=1 SCAR=0.0
Pod
documented
| |||
| 32 | |||
| 33 | 28 | ▶ | sub global_opt_spec { |
|
Subroutine
global_opt_spec: called CC=1 SCAR=0.0
Pod
documented
| |||
| 34 | 28 | my ($class) = @_; | |
| 35 | return ( | ||
| 36 | 28 | $class->SUPER::global_opt_spec(), | |
| 37 | [ 'version|V', 'print version and exit' ], | ||
| 38 | ); | ||
| 39 | } | ||
| 40 | |||
| 41 | =head1 DESCRIPTION | ||
| 42 | |||
| 43 | C<App::MCP::CLI> is a Perl implementation of a command-line client for servers | ||
| 44 | that implement the B<Model Context Protocol (MCP)>, a JSON-RPC 2.0-based protocol | ||
| 45 | for exposing callable "tools" to AI agents and other automation clients. | ||
| 46 | |||
| 47 | The distribution provides five sub-commands: | ||
| 48 | |||
| 49 | =over 4 | ||
| 50 | |||
| 51 | =item * B<list> - enumerate all tools advertised by an MCP server. | ||
| 52 | |||
| 53 | =item * B<call> - invoke a specific tool, passing arguments inline or through | ||
| 54 | an interactive prompt when none are supplied. | ||
| 55 | |||
| 56 | =item * B<interactive> (alias: B<chat>) - start an agent-style REPL that routes | ||
| 57 | natural-language queries through a local LLM (currently Ollama) to the appropriate | ||
| 58 | MCP tool and streams the results back. | ||
| 59 | |||
| 60 | =item * B<servers> - show the servers defined in the configuration file. | ||
| 61 | |||
| 62 | =item * B<version> - print the installed version. | ||
| 63 | |||
| 64 | =back | ||
| 65 | |||
| 66 | Both stdio servers and HTTP/SSE servers are supported by every command that | ||
| 67 | talks to a server (C<list>, C<call>, C<chat>), through the shared | ||
| 68 | L<App::MCP::CLI::Client>. | ||
| 69 | |||
| 70 | =head1 CONFIGURATION | ||
| 71 | |||
| 72 | Sub-command options (server path, LLM provider, model, config file) are | ||
| 73 | documented under each command's C<--help> output. See also | ||
| 74 | L<App::MCP::CLI::Command::interactive> for the JSON configuration file format. | ||
| 75 | |||
| 76 | =head1 SEE ALSO | ||
| 77 | |||
| 78 | =over 4 | ||
| 79 | |||
| 80 | =item * L<App::MCP::CLI::Command::list> | ||
| 81 | |||
| 82 | =item * L<App::MCP::CLI::Command::call> | ||
| 83 | |||
| 84 | =item * L<App::MCP::CLI::Command::interactive> | ||
| 85 | |||
| 86 | =item * L<App::MCP::CLI::Command::servers> | ||
| 87 | |||
| 88 | =item * L<App::MCP::CLI::Client> | ||
| 89 | |||
| 90 | =item * L<App::MCP::CLI::Config> | ||
| 91 | |||
| 92 | =item * L<App::Cmd> - the framework used to dispatch sub-commands. | ||
| 93 | |||
| 94 | =item * MCP specification: L<https://modelcontextprotocol.io/specification> | ||
| 95 | |||
| 96 | =back | ||
| 97 | |||
| 98 | =head1 AUTHOR | ||
| 99 | |||
| 100 | Mohammad Sajid Anwar, C<< <mohammad.anwar at yahoo.com> >> | ||
| 101 | |||
| 102 | =head1 REPOSITORY | ||
| 103 | |||
| 104 | L<https://github.com/manwar/App-MCP-CLI> | ||
| 105 | |||
| 106 | =head1 BUGS | ||
| 107 | |||
| 108 | Please report any bugs or feature requests through the web interface at L<https://github.com/manwar/App-MCP-CLI/issues>. | ||
| 109 | I will be notified and then you'll automatically be notified of progress on your | ||
| 110 | bug as I make changes. | ||
| 111 | |||
| 112 | =head1 SUPPORT | ||
| 113 | |||
| 114 | You can find documentation for this module with the perldoc command. | ||
| 115 | |||
| 116 | perldoc App::MCP::CLI | ||
| 117 | |||
| 118 | You can also look for information at: | ||
| 119 | |||
| 120 | =over 4 | ||
| 121 | |||
| 122 | =item * BUG Report | ||
| 123 | |||
| 124 | L<https://github.com/manwar/App-MCP-CLI/issues> | ||
| 125 | |||
| 126 | =item * Search MetaCPAN | ||
| 127 | |||
| 128 | L<http://metacpan.org/dist/App-MCP-CLI> | ||
| 129 | |||
| 130 | =back | ||
| 131 | |||
| 132 | =head1 LICENSE AND COPYRIGHT | ||
| 133 | |||
| 134 | Copyright (C) 2026 Mohammad Sajid Anwar. | ||
| 135 | |||
| 136 | This program is free software; you can redistribute it and / or modify it under | ||
| 137 | the terms of the the Artistic License (2.0). You may obtain a copy of the full | ||
| 138 | license at: | ||
| 139 | |||
| 140 | L<http://www.perlfoundation.org/artistic_license_2_0> | ||
| 141 | |||
| 142 | Any use, modification, and distribution of the Standard or Modified Versions is | ||
| 143 | governed by this Artistic License.By using, modifying or distributing the Package, | ||
| 144 | you accept this license. Do not use, modify, or distribute the Package, if you do | ||
| 145 | not accept this license. | ||
| 146 | |||
| 147 | If your Modified Version has been derived from a Modified Version made by someone | ||
| 148 | other than you,you are nevertheless required to ensure that your Modified Version | ||
| 149 | complies with the requirements of this license. | ||
| 150 | |||
| 151 | This license does not grant you the right to use any trademark, service mark, | ||
| 152 | tradename, or logo of the Copyright Holder. | ||
| 153 | |||
| 154 | This license includes the non-exclusive, worldwide, free-of-charge patent license | ||
| 155 | to make, have made, use, offer to sell, sell, import and otherwise transfer the | ||
| 156 | Package with respect to any patent claims licensable by the Copyright Holder that | ||
| 157 | are necessarily infringed by the Package. If you institute patent litigation | ||
| 158 | (including a cross-claim or counterclaim) against any party alleging that the | ||
| 159 | Package constitutes direct or contributory patent infringement,then this Artistic | ||
| 160 | License to you shall terminate on the date that such litigation is filed. | ||
| 161 | |||
| 162 | Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND | ||
| 163 | CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED | ||
| 164 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR | ||
| 165 | NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS | ||
| 166 | REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, | ||
| 167 | INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE | ||
| 168 | OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 169 | |||
| 170 | =cut | ||
| 171 | |||
| 172 | 30 | 1; # End of App::MCP::CLI | |