Skip to main content
Glama
Swaroop1769

sample-mcp-server

by Swaroop1769

AI MCP Tools

A lightweight local MCP server demo built in Python.

This repository contains a small set of tool definitions for mcp, showing how to expose simple operations through a local MCP server and manage the environment with uv.

What this repo contains

  • main.py: a minimal MCP server with five tools:

    • add(a, b)

    • subtract(a, b)

    • multiply(a, b)

    • divide(a, b)

    • long_process(steps)

  • MCP.md: notes on MCP architecture and the main components of the protocol.

  • pyproject.toml, uv.lock, and .venv/: the source configuration and environment state created through uv.

Related MCP server: Arithmuse

Why this setup

I used uv to initialize and manage the Python environment, keep dependencies locked, and keep the repo light and reproducible. The goal is a clean, easy-to-run demo rather than a copied template.

Getting started

  1. Create or activate the virtual environment:

    uv venv .venv
    .\.venv\Scripts\Activate.ps1
  2. Install dependencies:

    uv install
  3. Run the MCP server locally:

    mcp dev main.py

Notes

  • The repository is designed for local development and experimentation with MCP tools.

  • uv.lock stores the exact dependency versions, so the environment can be reproduced.

  • .gitignore excludes the virtual environment and Python cache files.

Quick commands

  • uv init — initialize the project config with uv (already done)

  • uv install — install packages and update the lock file

  • uv venv .venv — create the local virtual environment

  • mcp dev main.py — start the MCP tool server

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A proof-of-concept MCP server that enables reading local files and performing basic arithmetic operations. It provides a simple foundation for understanding how tools are exposed to MCP clients.
    681 npm
    MIT
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    A minimal Python-based MCP server that provides standard arithmetic tools including addition, subtraction, multiplication, and division. It allows language models to perform basic mathematical calculations through a standardized interface.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    A sample MCP server that provides basic arithmetic tools like addition, subtraction, multiplication, and division. It serves as a demonstration for implementing the Model Context Protocol and connecting custom tools to clients like Claude Desktop.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A minimal MCP server with four tools (add, greet, text_stats, divide) demonstrating typed parameters, structured outputs, and error handling over stdio transport.
    MIT