Labsco
MCP SERVER

MCP Simple Server

by oleksandrsirenko

A working streamable-HTTP MCP server in about 25 lines, with the deployment configs and protocol tests that make it a real starting point rather than a snippet.

Summary
The two tools are the least interesting part, deliberately.

Nobody needs a remote server to add two numbers — what people need when writing their first remote MCP server is to know whether the handshake is right, and this repository answers that with a test script that says which step failed. The remote-client notes are the other quiet payoff: the trailing slash, the HTTP flag, the Accept header. Those three details cost most people an evening, and they are written down here.

What it is

A minimal reference implementation of an MCP server with streamable HTTP transport, built with FastMCP against the 2025-06-18 specification. Two arithmetic tools stand in for whatever you will actually build; the value is the surrounding scaffolding — session handling, deployment configs and a test suite that validates the protocol flow end to end.

What you get
  • Two tools that exist to prove the wiring works — `add` and `multiply`, each taking two numbers
  • The initialization flow handled properly: initialize, the initialized notification, then session-scoped calls
  • A test script that walks the whole protocol and reports what passed, so a broken deployment tells you where it broke
  • A second test script that runs the same checks against a deployed URL rather than localhost
  • Deployment configuration for Railway, Heroku and Render, plus a Dockerfile
  • The curl commands for each protocol step, written out, which is the fastest way to understand what a client is actually sending
  • A worked remote-client configuration using `mcp-remote`, including the details that trip people up — the trailing slash on `/mcp/`, the HTTP flag and the Accept header for SSE
Requirements

No account and no key. Clone, `uv sync`, activate the environment and run `python main.py`; the server comes up at `http://localhost:8000/mcp/`. `HOST` defaults to 127.0.0.1 and `PORT` to 8000 — deployment platforms set them, and FastMCP binds accordingly. The pyproject name is `mcp-simple-server` (0.1.0). Adding your own tool is a decorated function, and the README shows the pattern.

Setup effort

Build from source — clone the repository and build it, then point your client at the binary