mcp-cpp-sdk

Getting Started

  • Overview
  • Installation
    • Availability rule
    • Supported baseline
    • CMake linkage selection
    • Conan 2
    • APT / DEB
    • RPM
    • Arch Linux and derivatives
    • Homebrew
    • Chocolatey
    • GitHub Release and source builds
    • AppImage and Snap
  • Getting Started
    • Prerequisites
    • Installation
      • Using Conan (Recommended)
      • Using CMake FetchContent
      • Using Git Submodule
    • Building from Source
    • Quick Start: Minimal Server
      • Advanced: Manual Transport Setup
    • Quick Start: Minimal Client
    • Next Steps
  • Examples
    • Overview
    • Feature Examples
    • Benchmarks
    • server_stdio
    • client_stdio
    • server_with_sampling
    • echo_websocket
    • http_loopback
    • llama_server
    • debugger_server
    • Building All Examples
    • Using Examples as Templates

Core Documentation

  • Core Concepts
    • Tools
      • Basic Tool Registration
      • Typed Handlers
      • Async Handlers with Context
        • Progress and Cancellation
      • Error Handling
      • Tool Output Schema
      • Structured Content
      • See Also
    • Resources
      • Static Resources
      • Resource Templates
      • Dynamic Resources
      • Resource Subscriptions
      • Resource Change Notifications
      • Resource Capabilities
      • Best Practices
    • Prompts
      • Registering a Basic Prompt
      • Parameterized Prompts and Arguments
      • Structured Prompt Results
        • Roles
        • Content Blocks
      • Advanced Registration
        • Async Handlers
        • Using Context
      • Prompt List Change Notifications
      • Prompt Capabilities
    • Transports
      • Standard Transports
      • Stdio Transport (Local)
        • Server Side
        • Client Side
      • HTTP Transport (Network)
        • HTTP Server Convenience
        • Manual HTTP Configuration
      • WebSocket Transport
      • MemoryTransport for Testing
        • Creating Transport Pairs
        • Usage in Integration Tests
      • TransportFactory and Runtime
      • Choosing the Right Transport
      • Custom Transports
    • Middleware
      • Overview
      • Registering Middleware
      • Execution Order
      • Short-circuiting
      • Composition Patterns
      • Common Examples
        • Authentication
        • Logging
      • Best Practices
      • See Also
    • OAuth
      • Challenge-driven authorization
        • What the manager validates
        • Auditing an attempt
      • Protecting a server
        • Validating tokens
        • Health checks and other routes
        • Request body size
      • Security boundary
      • Low-level building blocks
        • Configuration
        • Discovery and PKCE
        • Token storage and refresh
        • HTTP authentication
      • Example and current limits
      • Cross-references
    • Server Context
      • Core Responsibilities
      • Lifecycle and Safety
      • Logging
      • Progress Reporting
        • Prerequisites
        • Usage Details
      • Cancellation
        • How it works
        • Implementation Pattern
      • Sampling (Reverse RPC)
        • Usage Example
      • Elicitation
        • Modes of Elicitation
      • Roots
      • Advanced: Context Internal Architecture
      • Best Practices
      • Cross-References
      • Summary
    • Completions
      • Overview
      • Server-side Setup
      • CompleteParams
      • CompleteResult
      • Client-side Usage
      • Example Walkthrough
    • Notifications and Subscriptions
      • Subscriptions Overview
      • Resource Subscriptions
        • Server-side Subscription Callbacks
      • Resource Change Notifications
      • List Change Notifications
      • Client-side Notification Handling
      • Example Walkthrough
      • Architecture of Notifications
      • Subscription State Management
      • Example Walkthrough
      • Advanced Notification Patterns
        • Custom Notifications
        • Throttling and Debouncing
      • See Also
    • Elicitation
      • Server-side Elicitation
      • Form-based Elicitation
      • URL-based Elicitation
      • Client-side Handling
      • ElicitResult Actions
      • Example Walkthrough
      • See Also
    • Pagination
      • Server-side Configuration
      • Cursor-based Pagination
      • Client-side Handling
      • Automatic Pagination
      • Implementation Details
      • Client-side Example
      • Pagination Best Practices
      • See Also
    • Roots
      • Roots Overview
      • Client-side Setup
      • Server-side Discovery
      • Handling Roots Requests
      • Roots Change Notifications
      • Example Walkthrough
  • Guides
    • Testing MCP Applications
      • Overview
      • MemoryTransport for Testing
      • Using create_memory_transport_pair()
      • Testing Patterns
        • Loopback Test Pattern
      • Writing Scripted Tests
      • E2E Testing Patterns
      • Mocking and Stubbing
      • CI Integration
      • Best Practices
    • Error Handling
      • Overview
      • JSON-RPC Error Codes
      • Server-side Error Handling
        • Choosing Between Exceptions and Error Results
        • Example: Throwing an Exception
        • Example: Returning an Error Result
        • Implicit Exceptions
      • Client-side Error Handling
        • Request Timeouts
        • Catching Server Errors
        • Handling Application Errors
      • Graceful Degradation Patterns
      • Retry Strategies
      • Logging and Monitoring
      • Example Walkthrough
    • OAuth Security and Deployment
      • Token Persistence and Storage
        • Implementing a Persistent TokenStore
        • Credential-to-Issuer Binding
      • The Class That Applies These Controls
        • Worked Flow
      • Metadata-Fetch Policy and Origin Validation
        • Policy Default Behavior
        • Configuring Allowed Origins
        • Deny List Always Wins
        • Runtime Override with origin_allowance Callback
      • Issuer Comparison and Canonical Form
        • Why No Canonicalization
      • Localhost Plain-HTTP Loopback Opt-Out
      • SSRF and DNS-Rebinding Prevention
        • Blocked Address Classes
        • Resolve-Then-Pin
        • Bounded and Re-Validated Redirects
        • Response Size Caps
      • Example: Hardened Policy Configuration
      • Cross-References
    • Deployment Guide
      • Overview
      • HTTP Server Setup
        • Convenience API (run_http)
        • Manual HTTP Setup
      • Graceful Shutdown
        • Signal Handling
      • Production Considerations
        • Port Binding and Security
      • Unix Daemon / Service Setup
        • systemd Integration
      • Docker Deployment
      • Load Balancing and Scaling
        • Sticky Sessions
        • Health Checks
      • Monitoring and Logging
      • Example Walkthrough
      • Cross-References
  • Client App Integrations
    • Validating Your Server
      • Using the MCP Inspector
      • Using our Interactive Client
    • Desktop Client Integrations
      • Claude Desktop
      • IDE Plugins (e.g., Cursor, VSCode)
    • Troubleshooting Integrations
  • API Reference
    • Overview
    • Core Classes
      • Server
        • mcp::Server
      • Client
        • mcp::Client
      • Context
        • mcp::Context
      • Transport Interface
        • mcp::ITransport
      • HTTP Transports
        • mcp::HttpClientTransport
        • mcp::HttpServerTransport
        • mcp::StreamableHttpSessionManager
      • Authentication
        • mcp::auth::OAuthHttpClient
        • mcp::auth::OAuthDiscoveryClient
        • mcp::auth::OAuthClientTransport
        • mcp::auth::InMemoryTokenStore
        • mcp::auth::Authenticator
        • mcp::auth::OAuthAuthenticator
    • Core Types
      • Task<T>
        • Task
    • Protocol Types
      • RequestId
        • mcp::RequestId
    • Complete Index

Project Info

  • Architecture
    • Design Principles
      • Compiled library boundaries
      • RAII and Value Semantics
      • Coroutine-Based Async
      • Type Safety
    • Component Overview
      • Server
      • Client
      • Transport Abstraction
      • Context
      • Core Types
      • Protocol Types
    • Data Flow
    • Design Decisions
      • Why Boost.Asio?
      • Authentication and Authorization
      • Why nlohmann_json?
      • Why compiled library variants?
      • Why Multiple Handler Signatures?
    • Thread Safety Model
    • Performance Characteristics
    • Extensibility
    • Future Work
  • Contributing
    • Development Setup
    • Code Style
      • C++20 Standards
      • Naming Conventions
      • Code Formatting
      • Doxygen Comments
    • Testing
      • Writing Tests
      • Running Tests
      • Code Coverage
      • Sanitizers
    • Pull Request Process
      • 1. Fork and Branch
      • 2. Make Changes
      • 3. Commit
      • 4. Push and Create PR
      • PR Template
      • 5. Code Review
      • 6. Merge
    • Reporting Bugs
    • Known Issues
    • GCC 11 SSO Coroutine Bug
    • GCC 12 and 13 Initializer-List Coroutine ICE
    • Feature Requests
    • Community Guidelines
mcp-cpp-sdk
  • Guides
  • View page source

Guides

Practical guides for common tasks when working with the mcp-cpp-sdk. These guides provide step-by-step instructions and best practices for testing, error handling, and deployment.

  • Testing MCP Applications
    • Overview
    • MemoryTransport for Testing
    • Using create_memory_transport_pair()
    • Testing Patterns
    • Writing Scripted Tests
    • E2E Testing Patterns
    • Mocking and Stubbing
    • CI Integration
    • Best Practices
  • Error Handling
    • Overview
    • JSON-RPC Error Codes
    • Server-side Error Handling
    • Client-side Error Handling
    • Graceful Degradation Patterns
    • Retry Strategies
    • Logging and Monitoring
    • Example Walkthrough
  • OAuth Security and Deployment
    • Token Persistence and Storage
    • The Class That Applies These Controls
    • Metadata-Fetch Policy and Origin Validation
    • Issuer Comparison and Canonical Form
    • Localhost Plain-HTTP Loopback Opt-Out
    • SSRF and DNS-Rebinding Prevention
    • Example: Hardened Policy Configuration
    • Cross-References
  • Deployment Guide
    • Overview
    • HTTP Server Setup
    • Graceful Shutdown
    • Production Considerations
    • Unix Daemon / Service Setup
    • Docker Deployment
    • Load Balancing and Scaling
    • Monitoring and Logging
    • Example Walkthrough
    • Cross-References
Previous Next

© Copyright 2026, MCP C++ SDK Contributors.

Built with Sphinx using a theme provided by Read the Docs.