mojo-mcp
Health Gecti
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 16 GitHub stars
Code Gecti
- Code scan — Scanned 3 files during light audit, no dangerous patterns found
Permissions Gecti
- Permissions — No dangerous permissions requested
This is a Perl SDK designed for building and running Model Context Protocol (MCP) servers and clients. It integrates natively with the Mojolicious real-time web framework, offering both HTTP and command-line stdio transports.
Security Assessment
Overall risk: Low. The code functions as a standard server-side framework, meaning its primary job is to listen for requests rather than make outgoing network connections. The automated code scan reviewed the core files and found no dangerous patterns, hardcoded secrets, or requests for excessive permissions. It does not silently execute shell commands or access sensitive local data. Because it is an SDK, developers write the actual tool logic, so the final security posture depends entirely on the custom code you implement.
Quality Assessment
Maintained by the official Mojolicious team, the project is under very active development with its most recent push happening today. It is fully licensed under the standard and permissive MIT license. The project has 16 GitHub stars, indicating early-stage community adoption and trust, which is reasonable given it is a newly released tool. The documentation clearly warns users that both the module and the MCP specification are evolving rapidly, so breaking changes should be expected.
Verdict
Safe to use, but expect rapid updates and potential breaking changes as the MCP specification matures.
Perl SDK for Model Context Protocol servers and clients
MCP Perl SDK
Model Context Protocol support for Perl and the
Mojolicious real-time web framework.
Features
Please be aware that this module is still in development and will be changing rapidly. Additionally the MCP
specification is getting regular updates which we will implement. Breaking changes are very likely.
- Tool calling, prompts and resources
- Streamable HTTP and Stdio transports
- Scalable with pre-forking web server and async tools using promises
- HTTP client for testing
- Can be embedded in Mojolicious web apps
Installation
All you need is Perl 5.20 or newer. Just install from CPAN.
$ cpanm -n MCP
We recommend the use of a Perlbrew environment.
Streamable HTTP Transport
Use the to_action method to add an MCP endpoint to any Mojolicious application.
use Mojolicious::Lite -signatures;
use MCP::Server;
my $server = MCP::Server->new;
$server->tool(
name => 'echo',
description => 'Echo the input text',
input_schema => {type => 'object', properties => {msg => {type => 'string'}}, required => ['msg']},
code => sub ($tool, $args) {
return "Echo: $args->{msg}";
}
);
any '/mcp' => $server->to_action;
app->start;
Authentication can be added by the web application, just like for any other route.
Server-to-Client Streaming
The HTTP transport can optionally accept GET requests to open a long-lived SSE stream the server can push
notifications to, and DELETE requests to terminate a session. This requires per-process state and is not
compatible with pre-forking web servers, so it is opt-in.
use Mojolicious::Lite -signatures;
use MCP::Server;
my $server = MCP::Server->new;
$server->tool(
name => 'echo',
description => 'Echo the input text',
input_schema => {type => 'object', properties => {msg => {type => 'string'}}, required => ['msg']},
code => sub ($tool, $args) {
$tool->notify('notifications/message', {level => 'info', data => "Echoing: $args->{msg}"});
return "Echo: $args->{msg}";
}
);
any '/mcp' => $server->to_action({streaming => 1});
app->start;
Stdio Transport
Build local command line applications and use the stdio transport for testing with the to_stdio method.
use Mojo::Base -strict, -signatures;
use MCP::Server;
my $server = MCP::Server->new;
$server->tool(
name => 'echo',
description => 'Echo the input text',
input_schema => {type => 'object', properties => {msg => {type => 'string'}}, required => ['msg']},
code => sub ($tool, $args) {
return "Echo: $args->{msg}";
}
);
$server->to_stdio;
Just run the script and type requests on the command line.
$ perl examples/echo_stdio.pl
{"jsonrpc":"2.0","id":"1","method":"tools/list"}
{"jsonrpc":"2.0","id":"2","method":"tools/call","params":{"name":"echo","arguments":{"msg":"hello perl"}}}
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi