Skip to main content
Glama
README.md
## A minimal MCP server built from scratch — no SDK.

> Implements the [Model Context Protocol](https://spec.modelcontextprotocol.io) (`2025-03-26`) 
> over both **Streamable HTTP** and **WebSocket**, with a clean separation between transport, protocol, registry, and execution layers.



## Tools

<div style="display:flex; gap:24px; align-items:flex-start;">

<img src="static/img/arnsLLDWXvyojtEBDQ3eVQ@2k.png" width="300" height="250">

<div>

| Tool | Description |
|---|---|
| `shell` | Run a shell command |
| `readfile` | Read a file from disk |
| `writefile` | Write a file to disk |
| `fetch` | Fetch a URL |

</div>
</div>

</td>
</tr>
</table>

## Quickstart

```bash
uv sync
python serve.py
```

Connect via [MCP Inspector](https://github.com/modelcontextprotocol/inspector):

```bash
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.