CPP MCP-SERVER

CPP MCP-SERVER

A C++ implementation of a Model Context Protocol Server with a pluggable module architecture.

peppemas

Developer Tools
Visit Server

README

Build Status

CPP MCP-SERVER

A C++ implementation of a Model Context Protocol Server with a pluggable module architecture.

Server Resources Prompts Tools Sampling Notifications Roots Transport
MCP-SERVER ✅* stdio

* Resource Templates aren't supported yet

MCP Server Architecture

The MCP Server is designed to implement a Model Context Protocol, enabling a modular and extensible architecture. Below is an overview of the project's architecture:

Core Components

  1. Server Core:
    The central component of the server that handles the initialization and management of all major functionalities, including communication with clients, logging, and plugin management.

  2. Command-Line Interface:
    Provides command-line arguments for configuration:

    • -n: Specifies the name of the server to expose to clients.
    • -p: Sets the path to the plugins directory.
    • -l: Sets the path to the logs directory.
  3. Plugin System:
    The server is designed to load plugins dynamically from a specified directory (-p argument). Each plugin extends the server's functionality, allowing for future expansion without modifying the core codebase.

  4. Logging Module:
    Logging is centralized, with logs stored in the directory specified by the -l parameter. This enhances debugging and monitoring of the server's activity.

Execution Flow

  1. Initialization:

    • The server starts by parsing the command-line arguments to configure the server name, plugin directory, and logs directory.
    • Logs are initialized, and the plugin system is prepared.
  2. Plugin Loading:

    • Plugins from the specified directory are identified and loaded dynamically.
    • Each plugin is initialized and registered with the server.
  3. Handling Client Requests:

    • The server listens for incoming client connections.
    • It processes requests based on the implemented Model Context Protocol, which relies on registered plugins for extended capabilities.
  4. Error Handling:

    • Errors during startup or runtime are logged in the logging directory, ensuring minimal disruption to the server's operation.

Plugin Extensibility

The MCP Server's extensibility is powered by its plugin system, enabling developers to expand the server's capabilities without modifying the core logic. Plugins are dynamically loaded libraries and can be implemented in various ways depending on the operating system:

  • On Windows: Plugins are compiled as .dll files.
  • On Linux/MacOS: Plugins are compiled as .so (shared object) files.

Example Plugins

  1. Weather Plugin:
    The Weather plugin allows the server to provide weather-related functionalities. This plugin can process requests related to weather data, such as current temperature, forecasts, and other meteorological information. The plugin fetches data from third-party APIs to ensure up-to-date and accurate information. It demonstrates how the MCP server can be extended to offer services that require external data integration.

  2. Sleep Plugin:
    The Sleep plugin introduces delay or "sleep" functionality within the server's processing pipeline. This can be useful for simulating response delays or managing timed operations in protocols. Developers can leverage this plugin to build and test features related to time-based operations without altering core server behavior. It highlights how custom plugins can target specific, niche use cases.

  3. Code Review Plugin:
    The Code Review plugin is designed to assist developers in performing automated code reviews. This plugin analyzes code submitted to the server and provides helpful feedback, such as identifying potential bugs, code smells, and optimization opportunities. It follows standard coding practices and can be configured to enforce specific style guides (e.g., Google C++ Style Guide). Additionally, it supports multi-language inspection, ensuring compatibility with various programming languages. The plugin can integrate with version control systems to retrieve code changes directly for assessment, making it a valuable tool for collaborative development workflows.

Claude Desktop Configuration

{
  "mcpServers": {
    "mcp-server": {
        "command": "C:\\mcp-server\\mcp_server.exe",
        "args": [
          "-n","developer-server",
          "-l","C:\\mcp-server\\logs",
          "-p","C:\\mcp-server\\plugins"
        ],
       "env": {
          "CUSTOM_API_KEY_1": "your-api-key-here",
          "CUSTOM_API_KEY_2": "your-api-key-here",
          "SAVE_DIR": "/path/to/save/directory"
       }      
    }
  }
}

TODO LIST

  • Notifications [IN PROGRESS]
  • Sampling [IN PROGRESS]
  • Create a support class to build notifications and responses (text, images, audio, errors, etc.)
  • Use a robust serialization library for server<->plugins communication
  • Review log level implementation
  • Add json schema validator (https://github.com/pboettch/json-schema-validator)
  • Implements SSE transport
  • Test on different mcp-client (actually tested only on Claude Desktop)

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python