30 #ifndef PT_MCP_STDIOSERVICE_H
31 #define PT_MCP_STDIOSERVICE_H
33 #include <Pt/Mcp/Api.h>
34 #include <Pt/Mcp/ToolDeclaration.h>
35 #include <Pt/Remoting/ServiceDefinition.h>
36 #include <Pt/System/Api.h>
81 std::string dispatchToolsCall(
const std::string& json);
82 std::string dispatchInitialize(
const std::string& json);
83 std::string dispatchToolsList(
const std::string& json);
85 static std::string extractMethod(
const std::string& json);
86 static Pt::int64_t extractId(
const std::string& json);
97 #endif // PT_MCP_STDIOSERVICE_H
Core module.
Definition: Allocator.h:33
StdioService(Remoting::ServiceDefinition &serviceDef, const ToolDeclaration &decl, System::EventLoop &loop)
Construct with a service definition, tool declaration and the event loop used to drive asynchronous s...
Remote service definition.
Definition: ServiceDefinition.h:59
MCP protocol service over stdio.
Definition: StdioService.h:50
std::string dispatch(const std::string &json)
Dispatch an MCP request and return the response JSON.
void writeMessage(std::ostream &os, const std::string &json)
Write a Content-Length framed message to the stream.
Thread-safe event loop supporting I/O multiplexing and Timers.
Definition: EventLoop.h:83
std::string readMessage(std::istream &is)
Read a Content-Length framed message from the stream.
int_type int64_t
Signed 64-bit integer type.
Definition: Api-Types.h:55
~StdioService()
Destructor.