MCP::Se...ansport(3)

πŸ“¦
version 0.150.0 Β· 2 versions
, in opensuse-leap 16.0

πŸŽ€ MCP::Transport πŸŽ€

okay so bestie, buckle up β€” this one's from the User Contributed Perl Documentation and honestly? it's giving foundational. it's the base class energy, the main character origin story. let's get into it πŸ’…


✨ NAME ✨

MCP:Transport β€” the Transport base class. that's it, that's the vibe. it's the blueprint everything else inherits from 🫢


🌸 SYNOPSIS 🌸

bestie you literally just do this and you're off:

package MyMCPTransport;
use Mojo::Base 'MCP::Server::Transport';

1;

that 1; at the end? non-negotiable. it's the "return true so Perl knows we're chill" moment. iconic. πŸŽ€


πŸ’– DESCRIPTION πŸ’–

so MCP::Server::Transport is a base class for MCP (Model Context Protocol) transport implementations. like, it's not doing the work itself β€” it's the blueprint that other transport classes build on top of. the whole squad inherits from it. lowkey the mother of the group chat πŸ’œ


πŸ¦‹ ATTRIBUTES πŸ¦‹

MCP::Server::Transport implements the following attributes. yes, the fancy word for "things it has." slay.

⭐ server ⭐

my $server = $transport->server;
$transport = $transport->server(MCP::Server->new);

this is the server instance that this transport is associated with β€” like, which server is this transport riding for? that one. you can read it and you can set it. getter and setter, we love a versatile icon πŸ‘‘


πŸ”₯ METHODS πŸ”₯

MCP::Server::Transport implements the following methods. the verbs. the actions. the moments.

🌈 notifications 🌈

my $bool = $transport->notifications;

true when the transport can push server-to-client notifications outside an in-flight response. read that again: outside an in-flight response. so even when nobody asked, this transport can still slide into the client's DMs with a notification. it's giving main character energy, honestly 🫢✨


πŸ‘€ SEE ALSO πŸ‘€

go click around, bestie, iykyk πŸ’…


ngl this page is short but it's load-bearing. if you're building a transport, this is the class you inherit from, periodt. don't skip the 1; and don't skip the base class. fr fr. πŸ“

k bye ily, this page was brought to you by perl v5.42.0 dated 2026-07-31, straight from the User Contributed Perl Documentation πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from