19namespace neograph::mcp {
21struct NEOGRAPH_API MCPHttpServerSession {
22 std::unique_ptr<MCPServer> server;
25 std::shared_ptr<void> owner;
28struct NEOGRAPH_API MCPHttpServerConfig {
29 using BearerAuthorizer = std::function<std::optional<std::string>(std::string_view token)>;
31 std::string host =
"127.0.0.1";
33 std::string endpoint =
"/mcp";
38 std::size_t max_sessions = 64;
39 std::size_t max_payload_bytes = 1024 * 1024;
45 std::size_t http_threads = 8;
46 std::size_t max_http_threads = 64;
47 std::size_t max_queued_requests = 64;
50 std::chrono::milliseconds response_timeout = std::chrono::minutes(10);
55 std::chrono::milliseconds session_idle_timeout = std::chrono::minutes(30);
61 std::vector<std::string> allowed_origins;
70 std::vector<std::string> allowed_hosts;
80 BearerAuthorizer bearer_authorizer;
94 json protected_resource_metadata;
111 using ServerFactory = std::function<MCPHttpServerSession(std::string_view authorization_scope)>;
113 MCPHttpServer(ServerFactory factory, MCPHttpServerConfig config = {});
128 bool is_running()
const;
133 std::unique_ptr<Impl> impl_;
NEOGRAPH_API export/import macro for shared-library builds.
Session-aware MCP Streamable HTTP server.
bool start_async()
Bind and serve on a background listener thread.
void stop()
Stop HTTP acceptance, cancel session work, and join the listener.
bool start()
Bind and serve until stop() is called.
Reusable MCP 2025-11-25 stdio server substrate.