App-MCP-CLI
view release on metacpan or search on metacpan
lib/App/MCP/CLI.pm view on Meta::CPAN
package App::MCP::CLI;
use strict;
use warnings;
use version;
our $VERSION = qv('v0.0.1');
our $AUTHORITY = 'cpan:MANWAR';
=encoding utf8
=head1 NAME
App::MCP::CLI - Command line interface for MCP servers
=head1 VERSION
Version v0.0.1
=head1 SYNOPSIS
# Install and run via the bundled script
mcpcli list
mcpcli call <tool_name> [key=value ...]
mcpcli interactive --server myserver
=cut
use App::Cmd::Setup -app;
sub plugin_search_path { 'App::MCP::CLI::Command' }
sub global_opt_spec {
my ($class) = @_;
return (
$class->SUPER::global_opt_spec(),
[ 'version|V', 'print version and exit' ],
);
}
=head1 DESCRIPTION
C<App::MCP::CLI> is a Perl implementation of a command-line client for servers
that implement the B<Model Context Protocol (MCP)>, a JSON-RPC 2.0-based protocol
for exposing callable "tools" to AI agents and other automation clients.
The distribution provides five sub-commands:
=over 4
=item * B<list> - enumerate all tools advertised by an MCP server.
=item * B<call> - invoke a specific tool, passing arguments inline or through
an interactive prompt when none are supplied.
=item * B<interactive> (alias: B<chat>) - start an agent-style REPL that routes
natural-language queries through a local LLM (currently Ollama) to the appropriate
MCP tool and streams the results back.
=item * B<servers> - show the servers defined in the configuration file.
=item * B<version> - print the installed version.
=back
Both stdio servers and HTTP/SSE servers are supported by every command that
talks to a server (C<list>, C<call>, C<chat>), through the shared
L<App::MCP::CLI::Client>.
=head1 CONFIGURATION
Sub-command options (server path, LLM provider, model, config file) are
documented under each command's C<--help> output. See also
L<App::MCP::CLI::Command::interactive> for the JSON configuration file format.
=head1 SEE ALSO
=over 4
=item * L<App::MCP::CLI::Command::list>
=item * L<App::MCP::CLI::Command::call>
=item * L<App::MCP::CLI::Command::interactive>
=item * L<App::MCP::CLI::Command::servers>
=item * L<App::MCP::CLI::Client>
=item * L<App::MCP::CLI::Config>
=item * L<App::Cmd> - the framework used to dispatch sub-commands.
=item * MCP specification: L<https://modelcontextprotocol.io/specification>
=back
( run in 3.002 seconds using v1.01-cache-2.11-cpan-4e491c91c6e )