Skip to content

darko-mesaros/example-rust-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

This is an example MCP server written in Rust using the rmcp crate.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published