cxxmcp 1.2.8
C++ MCP SDK
Loading...
Searching...
No Matches
authoring.hpp File Reference

High-level server authoring helpers and typed App builder adapters. More...

#include <cstdint>
#include <memory>
#include <stdexcept>
#include <string>
#include <string_view>
#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::detail::has_tool_title< T, class >
 
struct  mcp::server::detail::has_tool_title< T, std::void_t< decltype(T::title)> >
 
struct  mcp::server::detail::has_tool_description< T, class >
 
struct  mcp::server::detail::has_tool_description< T, std::void_t< decltype(T::description)> >
 
struct  mcp::server::detail::has_tool_definition< T, class >
 
struct  mcp::server::detail::has_tool_definition< T, std::void_t< decltype(std::declval< const T & >().definition())> >
 
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...
 
class  mcp::server::App
 Convenience entry point for compact server applications. More...
 
class  mcp::server::App::Builder
 Higher-level server builder with callable adapters. More...
 

Functions

template<class Tool , class Text >
std::string mcp::server::detail::static_tool_text (Text value)
 
template<class Args , class Result >
TypedToolBuilder< Args, Result > mcp::server::tool (std::string name)
 Starts a typed tool registration builder.
 
template<class Tool >
auto mcp::server::tool (Tool value)
 Builds a typed tool registration from a tool object type.
 
template<class Tool >
auto mcp::server::tool ()
 Builds a typed tool registration from a default-constructible tool object type.
 
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)
 

Detailed Description

High-level server authoring helpers and typed App builder adapters.

Function Documentation

◆ tool()

template<class Tool >
auto mcp::server::tool ( Tool  value)
inline

Builds a typed tool registration from a tool object type.

Tool must expose using Args, using Result, static name, and a callable operator() compatible with the typed tool handler rules. Optional static title and description members are copied into the advertised tool definition.