Back to MCP Catalog

Oat++ MCP Server

Developer ToolsC++
Anthropic's Model Context Protocol implementation for the Oat++ C++ web framework
Available Tools

CodeReview

A prompt tool for code review functionality

File

A resource tool for file operations

Logger

A tool for logging operations

Oat++ MCP provides a robust implementation of Anthropic's Model Context Protocol for the Oat++ C++ web framework. It enables developers to create MCP servers that can automatically generate tools from API controllers, allowing LLMs to interact directly with your RESTful services. The module supports multiple transport methods and core MCP server features including prompts, resources, and tools.

Overview

Oat++ MCP is an implementation of Anthropic's Model Context Protocol for the Oat++ C++ web framework. This module allows you to create MCP servers that can be used with LLMs like Claude to interact with your C++ applications and APIs.

Installation

Prerequisites

Before installing Oat++ MCP, you need to install the main Oat++ framework:

  1. Clone the Oat++ repository: git clone https://github.com/oatpp/oatpp.git
  2. Build and install Oat++:
    cd oatpp
    mkdir build && cd build
    cmake ..
    make install
    

Installing Oat++ MCP

  1. Clone the Oat++ MCP repository: git clone https://github.com/oatpp/oatpp-mcp.git
  2. Build and install the module:
    cd oatpp-mcp
    mkdir build && cd build
    cmake ..
    make install
    

Usage

Creating an MCP Server

You can create an MCP server in two ways: via STDIO or via HTTP Server-Sent Events (SSE).

STDIO Server

When using STDIO, make sure to redirect Oat++ logging to a different stream (e.g., to a file) by providing a custom Logger:

/* Create MCP server */
oatpp::mcp::Server server;

/* Add prompts */
server.addPrompt(std::make_shared<prompts::CodeReview>());

/* Add resource */
server.addResource(std::make_shared<resource::File>());

/* Add tools */
server.addTool(std::make_shared<tools::Logger>());

/* Run server */
server.stdioListen();

SSE Server

To serve via SSE (which can be integrated with your existing HTTP server):

/* Create MCP server */
oatpp::mcp::Server server;

/* Add prompts */
server.addPrompt(std::make_shared<prompts::CodeReview>());

/* Add resource */
server.addResource(std::make_shared<resource::File>());

/* Add tools */
server.addTool(std::make_shared<tools::Logger>());

/* Add SSE controller to your HTTP server router */
router->addController(server.getSseController());

Autogenerated Tools for API

One of the most powerful features of Oat++ MCP is its ability to automatically generate tools from your ApiController so that LLMs can query your API directly. This allows you to expose your RESTful services to LLMs without writing additional code.

To learn more about this feature, check out the detailed tutorial or explore the example project example-crud (branch add_mcp_server).

Supported Features

Oat++ MCP supports the following MCP features:

For working examples, refer to the tests in /test/oatpp-mcp/app/ServerTest.cpp in the repository.

Related MCPs

Apple Shortcuts
Developer ToolsJavaScript

Control Apple Shortcuts automations from AI assistants

Clojars Dependency Lookup
Developer ToolsJavaScript

Fetch dependency information from Clojars, the Clojure community's artifact repository

Simple Timeserver
Developer ToolsPython

Provides Claude with current time and timezone information

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.