example-rust-mcp-server

darko-mesaros/example-rust-mcp-server

3.2

If you are the rightful owner of example-rust-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

This document provides a structured overview of a Rust-based Model Context Protocol (MCP) server designed for CRUD operations on a TODO API.

CRUD MCP Server - sample code

NOTE: This code is presented AS-IS for educational and demonstration purposes. It is not intended for production use without proper review, testing, and security considerations.

A Rust implementation of a Model Context Protocol (MCP) server that provides CRUD operations for a TODO API.

Features

  • Get TODOs: Retrieve all TODO entries from the API
  • Create TODOs: Add new TODO entries with title and body
  • Built with Rust using the rmcp crate
  • Async/await throughout for optimal performance
  • Proper error handling and MCP protocol compliance

Prerequisites

  • Rust (latest stable)
  • A running TODO API server on localhost:3000
  • Node.js (for MCP inspector testing)

Quick Start

  1. Build the project:

    just release
    
  2. Test with MCP Inspector:

    just mcp-test
    

Environment Variables

  • USER_ID: Required UUID for TODO operations (set automatically in justfile)

API Integration

The server expects the ajde TODO API running on http://localhost:3000 with these endpoints:

  • GET /todos - Returns array of TODO objects
  • POST /todos - Creates new TODO from JSON body

Usage

Once running, the MCP server provides two tools:

  • get_all_todos: Fetches and returns all TODO entries
  • create_new_todo: Creates a new TODO with specified title and body

Perfect for demonstrating Rust MCP server development patterns and async API integration.