Skip to main content
Glama

A minimal MCP server built from scratch — no SDK.

Implements the Model Context Protocol (2025-03-26) over both Streamable HTTP and WebSocket, with a clean separation between transport, protocol, registry, and execution layers.

Related MCP server: MCP Server

Tools

Tool

Description

shell

Run a shell command

readfile

Read a file from disk

writefile

Write a file to disk

fetch

Fetch a URL

Quickstart

uv sync
python serve.py

Connect via MCP Inspector:

npx @modelcontextprotocol/inspector
# Transport: Streamable HTTP → http://127.0.0.1:8000/mcp
# Transport: WebSocket       → ws://127.0.0.1:8000/ws

Architecture

Transport and protocol are fully decoupled. Both HTTP and WebSocket adapters call the same dispatch() — adding a new transport means writing a thin adapter, not touching protocol logic.

Tool isolation is set per-tool: shell runs in an isolated subprocess with a timeout; trusted tools run inline.

Related MCP Connectors

Related MCP Servers