Skip to main content
Glama
EfazAhmed

MCP Server

by EfazAhmed

MCP Server

A lightweight Model Context Protocol (MCP) server built from scratch in Python, implementing Streamable HTTP, JSON-RPC 2.0, and Server-Sent Events (SSE).

The server allows MCP-compatible clients to discover and execute tools through a standardized interface without relying on an MCP SDK.

Features

  • MCP protocol version 2026-07-28

  • Streamable HTTP transport

  • JSON-RPC 2.0 request and response handling

  • Tool discovery and execution

  • Real-time timer notifications using SSE

  • Input validation and error handling

  • Automated unit and HTTP integration tests

Related MCP server: Simple MCP Server

Available Tools

Tool

Description

today

Returns the current date in a specified format.

weekday

Returns the weekday for a given date.

timer

Runs a timer with progress updates every 10 seconds.

calculator

Evaluates mathematical expressions using bc.

Project Structure

src/
├── __init__.py
├── server.py
├── protocol.py
└── tools.py

tests/
├── test_protocol.py
├── test_server.py
└── test_tools.py
  • server.py — Handles HTTP requests, responses, and SSE streaming.

  • protocol.py — Implements MCP discovery, JSON-RPC, and tool validation.

  • tools.py — Contains the implementations of the four tools.

  • tests/ — Contains unit and HTTP integration tests.

Getting Started

Prerequisites

  • Python 3.12+

  • uv

  • just

  • Node.js (for MCP Inspector)

  • bc calculator

Installation

Clone the repository and install dependencies:

git clone https://github.com/EfazAhmed/CSEE-4119-Project-1-MCP-Server.git
cd CSEE-4119-Project-1-MCP-Server
uv sync

Running the Server

Start the MCP server:

just run

The server runs locally at:

http://localhost:8000/mcp

Testing with MCP Inspector

In a separate terminal, launch MCP Inspector:

just inspector

Connect using:

  • Transport: Streamable HTTP

  • Protocol Era: Modern (2026-07-28)

  • Server URL: http://localhost:8000/mcp

Use the Tools tab to discover and execute the available tools.

Testing

Run the automated test suite:

just test

The project includes 20 automated tests covering:

  • Tool functionality and input validation

  • MCP discovery and JSON-RPC handling

  • HTTP requests and responses

  • SSE timer notifications

Development

Command

Description

just run

Start the MCP server

just inspector

Launch MCP Inspector

just test

Run automated tests

just lint

Check code with Ruff

just lint --fix

Automatically fix supported lint errors

just format

Format Python code

License

This project is licensed under the MIT License.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A self-contained, dependency-free MCP server that provides utility tools for time, date, mathematical calculations, and shell command execution. It supports remote connectivity through SSE and is designed for easy deployment via Docker.
    GPL 3.0
  • F
    license
    A
    quality
    D
    maintenance
    A general-purpose MCP server providing time-related utilities such as fetching current time, Unix timestamps, and formatting services. It supports both local stdio and remote SSE communication modes for versatile AI client integration.
    3
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server framework enabling standardized tool registration, discovery, and invocation over JSON-RPC 2.0, with support for InProcess, SSE, and WebSocket transports, plus built-in tools such as calculator, text processor, and JSON formatter.
    MIT