5#ifndef PT_MCP_STDIOSERVICE_H
6#define PT_MCP_STDIOSERVICE_H
9#include <Pt/Mcp/ToolDeclaration.h>
10#include <Pt/Remoting/ServiceDefinition.h>
11#include <Pt/System/Api.h>
72 std::string dispatchToolsCall(
const std::string& json);
73 std::string dispatchInitialize(
const std::string& json);
74 std::string dispatchToolsList(
const std::string& json);
76 static std::string extractMethod(
const std::string& json);
77 static Pt::int64_t extractId(
const std::string& json);
~StdioService()
Destroys the service.
void writeMessage(std::ostream &os, const std::string &json)
Writes a Content-Length framed message json to os.
std::string readMessage(std::istream &is)
Reads one Content-Length framed message from is.
std::string dispatch(const std::string &json)
Dispatches an MCP request and returns the response JSON.
StdioService(Remoting::ServiceDefinition &serviceDef, const ToolDeclaration &decl, System::EventLoop &loop)
Creates a service for serviceDef, decl and loop.
Remote service definition.
Definition ServiceDefinition.h:59
Event loop of a thread or process.
Definition EventLoop.h:83
int_type int64_t
Signed 64-bit integer type.
Definition Api-Types.h:59
Model Context Protocol (MCP) services.
Core module.
Definition Allocator.h:33