MCP

 view release on metacpan or  search on metacpan

lib/MCP.pm  view on Meta::CPAN


  $ perl perldoc_stdio.pl
  {"jsonrpc":"2.0","id":1,"method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}
  {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"perldoc","arguments":{"module":"Mojo::JSON"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}

One JSON object per line, in and out. That is the whole protocol, and it is worth doing once before reaching for a
client.

=head2 Connecting a client

Most MCP hosts launch stdio servers themselves and are configured with a JSON file, C<claude_desktop_config.json>
for Claude Desktop and C<mcp.json> for many others.

  {
    "mcpServers": {
      "perldoc": {
        "command": "perl",
        "args": ["/absolute/path/to/perldoc_stdio.pl"]
      }
    }
  }



( run in 0.924 second using v1.01-cache-2.11-cpan-b16cb0d3907 )