Skip to main content
Glama
Claude MCP Server Starter

Claude MCP Server Starter

by shipready-ai
README.md
# Claude MCP Server Starter (Python)

A small, working **remote MCP server in Python** that Claude Code, Claude Desktop and the Claude API can connect to. It gives Claude four tools over a notes file, so you can see the whole Model Context Protocol flow in one 150-line file and then swap in your own tools.

Built with the official **MCP Python SDK** (`mcp` 2.3, streamable HTTP, stateless JSON mode).

> Need it in production, with API keys, scopes, rate limits, an audit log, HTTPS and a one-command AWS deploy? See the **[MCP Server Starter Kit](https://kimhoang36.gumroad.com/l/mcp-server-kit?utm_source=github&utm_medium=readme&utm_campaign=claude-mcp-server-starter)**.

## Run it in 2 minutes

```bash
git clone https://github.com/shipready-ai/claude-mcp-server-starter
cd claude-mcp-server-starter
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python server.py            # MCP endpoint: http://localhost:8000/mcp
```

Connect **Claude Code**:

```bash
claude mcp add --transport http notes http://localhost:8000/mcp
claude    # then ask: "What notes do I have about goals?"
```

Connect **Claude Desktop** (local, over stdio). Add this to `claude_desktop_config.json` and restart the app:

```json
{
  "mcpServers": {
    "notes": { "command": "/full/path/to/.venv/bin/python", "args": ["/full/path/to/server.py", "--stdio"] }
  }
}
```

## The tools

| Tool | Read only | What it does |
|---|---|---|
| `list_notes` | yes | All notes, newest first, optionally filtered by tag |
| `search_notes` | yes | Notes whose title or text contains every word |
| `get_note` | yes | One note in full. A wrong id returns a helpful error Claude can recover from |
| `add_note` | no | Saves a new note |

## How it works

```mermaid
sequenceDiagram
    participant C as Claude (Code / Desktop / API)
    participant S as server.py (/mcp)
    participant F as notes.json
    C->>S: tools/list
    S-->>C: 4 tools, with descriptions and read-only hints
    C->>S: tools/call search_notes {"query": "goals"}
    S->>F: read
    S-->>C: [{"id": 2, "title": "Q1 goals"}]
```

Three things make tools work well with Claude, and you can see each in `server.py`:

1. **The docstring and `Field` descriptions are all Claude knows about a tool.** Say what it returns and when to use it.
2. **Return small, plain data.** Ids, titles and short text, not whole database rows.
3. **Raise `ToolError` with a sentence Claude can act on** ("No note with id 999. Use search_notes to find ids."), so Claude fixes its own mistakes instead of giving up.

## Add your own tool

```python
@server.tool(title="Weather", annotations=READ)
def get_weather(city: str) -> dict:
    """Current temperature in a city, in Celsius."""
    return {"city": city, "temp_c": 31}
```

Restart the server and Claude sees the new tool.

## Tests

```bash
pip install pytest httpx
pytest -q
```

## Lite version vs the full kit

This repo is for learning and local use. **It has no authentication**, so do not put it on the internet as it is.

| | This repo (free) | [MCP Server Starter Kit](https://kimhoang36.gumroad.com/l/mcp-server-kit?utm_source=github&utm_medium=readme&utm_campaign=claude-mcp-server-starter) |
|---|---|---|
| Streamable HTTP + stdio | ✅ | ✅ |
| Example tools | 4 over a JSON file | 8 over a SQLite shop + a template for wrapping any REST API |
| API keys per person/app, hashed, revocable | | ✅ |
| Read vs write scopes enforced in code | | ✅ |
| Rate limit per key, audit log of every call, usage report | | ✅ |
| DNS rebinding protection, safe errors | | ✅ |
| Docker, Caddy HTTPS, one-command AWS deploy and teardown | | ✅ |
| Guides for Claude Code, Claude Desktop and the Claude API MCP connector | | ✅ |
| 20 tests | 3 | 20 |

## More starter kits

Production-ready Claude projects with one-command AWS deploys: [all ShipReady AI kits](https://shipready-ai.github.io/?utm_source=github&utm_medium=readme&utm_campaign=claude-mcp-server-starter).

## License

MIT. See [LICENSE](LICENSE).