30 #ifndef PT_MCP_SERVICE_H
31 #define PT_MCP_SERVICE_H
33 #include <Pt/Mcp/Api.h>
34 #include <Pt/Mcp/ToolDeclaration.h>
35 #include <Pt/Remoting/ServiceDefinition.h>
78 std::string dispatchToolsCall(
const std::string& json);
79 std::string dispatchInitialize(
const std::string& json);
80 std::string dispatchToolsList(
const std::string& json);
82 static std::string extractMethod(
const std::string& json);
83 static Pt::int64_t extractId(
const std::string& json);
93 #endif // PT_MCP_SERVICE_H
Core module.
Definition: Allocator.h:33
Service(Remoting::ServiceDefinition &serviceDef, const ToolDeclaration &decl)
Construct with a service definition and tool declaration.
Remote service definition.
Definition: Api-ServiceDefinition.h:22
int_type int64_t
Signed 64-bit integer type.
Definition: Api-Types.h:55
MCP protocol service over stdio.
Definition: Service.h:49
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.
std::string readMessage(std::istream &is)
Read a Content-Length framed message from the stream.