|
cxxmcp 1.1.6
C++ MCP SDK
|
High-level server authoring helpers and typed App builder adapters. More...
#include <cstdint>#include <memory>#include <stdexcept>#include <string>#include <type_traits>#include <utility>#include "cxxmcp/config.hpp"#include "cxxmcp/server/detail/handler_dispatch.hpp"#include "cxxmcp/server/server.hpp"Go to the source code of this file.
Classes | |
| struct | mcp::server::TypedToolRegistration< Args, Result, Handler > |
| Typed tool registration produced by mcp::server::tool(). More... | |
| class | mcp::server::TypedToolBuilder< Args, Result > |
| Fluent typed tool builder for low-boilerplate server authoring. More... | |
| struct | mcp::server::TypedPromptRegistration< Args, Handler > |
| Typed prompt registration produced by mcp::server::prompt(). More... | |
| class | mcp::server::TypedPromptBuilder< Args > |
| Fluent typed prompt builder for low-boilerplate server authoring. More... | |
| struct | mcp::server::TypedResourceRegistration< Args, Handler > |
| Typed resource registration produced by mcp::server::resource(). More... | |
| class | mcp::server::TypedResourceBuilder< Args > |
| Fluent typed resource builder for low-boilerplate server authoring. More... | |
Functions | |
| template<class Args , class Result > | |
| TypedToolBuilder< Args, Result > | mcp::server::tool (std::string name) |
| Starts a typed tool registration builder. | |
| template<class Args > | |
| TypedPromptBuilder< Args > | mcp::server::prompt (std::string name) |
| template<class Args > | |
| TypedPromptBuilder< Args > | mcp::server::prompt (protocol::Prompt prompt) |
| template<class Args > | |
| TypedResourceBuilder< Args > | mcp::server::resource (std::string uri, std::string name) |
| template<class Args > | |
| TypedResourceBuilder< Args > | mcp::server::resource (protocol::Resource resource) |
| protocol::ResourceTemplateBuilder | mcp::server::resource_template (std::string uri_template, std::string name) |
| class | mcp::server::CXXMCP_DEPRECATED ("App is a compatibility entry point; use ServerPeer::builder() with " "cxxmcp/run.hpp instead") App |
| Convenience entry point for compact server applications. | |
High-level server authoring helpers and typed App builder adapters.
| class mcp::server::CXXMCP_DEPRECATED | ( | "App is a compatibility entry point; use ServerPeer::builder() with " "cxxmcp/run.hpp instead" | ) |
Convenience entry point for compact server applications.
App::builder() exposes a higher-level builder that can create common transports and adapt simple C++ callables into MCP handlers.
Higher-level server builder with callable adapters.
Sets the advertised server name.
Sets the advertised server version.
Sets the advertised server instructions.
Adds a stdio server transport.
Adds a caller-supplied transport.
| value | Transport owned by the built server. |
Enables server-side task processing for task-aware tools.
Installs an optional JSON Schema validator.
Registers a tool using a typed argument adapter.
| Args | Type decoded from the JSON arguments object. |
| Result | Expected handler result type. |
| Handler | Callable invoked with Args. |
| name | Tool name advertised to clients. |
| handler | Callable returning Result or core::Result<Result>. |
Registers a typed callable using an explicit tool definition.
Registers a typed tool registration built by mcp::server::tool().
Registers a fully described tool and low-level handler.
Registers a prompt using a callable adapter.
| name | Prompt name advertised to clients. |
| handler | Callable accepting Json, string, PromptContext, one of the Json/string plus PromptContext combinations, or no argument. Returns prompt text/result or core::Result of either. CancellationToken may be accepted directly with Json/string where cooperative cancellation is useful. |
Registers a fully described prompt and low-level handler.
Registers a resource using a callable adapter.
| name | Resource URI and default display name. |
| handler | Callable accepting Json params, requested URI string, ResourceContext, one of the Json/string plus ResourceContext combinations, or no argument. Returns resource text/contents/result, protocol::Resource metadata, or core::Result of these. CancellationToken may be accepted directly with Json/string where cooperative cancellation is useful. |
Registers a fully described resource and low-level read handler.
Registers a resource template using a callable adapter.
| name | Default resource-template name and URI template when the handler does not fill those fields. |
| handler | Callable returning a ResourceTemplate or core::Result<ResourceTemplate>. |
| std::runtime_error | if a Result-returning handler fails during registration. |
Registers a fully described resource template.
Registers a completion request handler adapter.
Registers a sampling request handler adapter.
Registers a logging notification handler adapter.
Registers a raw request hook adapter.
Builds the configured server.
Builds, starts, and runs the configured server application.
Creates a new convenience server builder.