oatpp-mcp

by oatpp

50 stars
322 downloads
Not rated
GitHub Website

About

Anthropic's Model Context Protocol implementation for Oat++

Details

Author
oatpp
GitHub stars
50
Downloads
322
Categories
Other

- Autogenerates MCP tools from ApiController for LLM querying.
- Supports STDIO and HTTP SSE transport.
- Implements Prompts, Resources, and Tools per the MCP specification.
- Integrates directly with the Oat++ web framework.

Build and install the module after installing the main oatpp module, then include it in your project. Use the oatpp::mcp::Server class to add prompts, resources, and tools, and serve via STDIO (server.stdioListen()) or HTTP SSE (attach the SSE controller to your HTTP server router). Redirect Oat++ logging to a different stream when using STDIO.

oatpp-mcp

Anthropic’s Model Context Protocol implementation for Oat++

Read more:
- About Oat++
- Oat++ Repository
- Model Context Protocol

Supported features

Autogenerated tools for API

:tada: oatpp-mcp can automatically generate tools from ApiController so that you can query your API with LLM. :tada:

- Detailed tutorial
- Example project example-crud (branch add_mcp_server)

Transport

- STDIO
- HTTP SSE

Server features

- Prompts
- Resources
- Tools

Build And Install

Pre Requirements

- Install the main oatpp module

Install module

- Clone this repository.
- In the root of the repository run:

   mkdir build && cd build
cmake ..
make install


Examples

Find working example in tests /test/oatpp-mcp/app/ServerTest.cpp

Serve via STDIO

Note: make sure to redirect oatpp logging to a different stream - ex.: to file by providing 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();

Serve via SSE

  / 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());

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.