MCP-Demo
mcp-demo
Ein minimaler Python-MCP-Server, der in Phasen aufgebaut ist, sodass jeder Commit ein Konzept vermittelt. Endzustand: Claude Code kann lokale Ollama-Modelle (gemma3:4b / 3:12b) als Tool aufrufen, um Aufgaben mit geringer Priorität von der API auf das Homelab auszulagern.
Was ist MCP eigentlich?
Das Model Context Protocol ist ein standardisiertes JSON-RPC 2.0-Protokoll, das es einem LLM-Client (Claude Code, Claude Desktop, Cursor) ermöglicht, Tools zu entdecken und aufzurufen, Ressourcen abzurufen und Prompt-Vorlagen aus separaten Prozessen, den sogenannten MCP-Servern, zu laden. MCP verhält sich zu LLM-Tooling wie LSP zur Sprachunterstützung in IDEs: ein Protokoll, viele interoperable Implementierungen.
Die beweglichen Teile
┌───────────────────┐ stdio / HTTP ┌──────────────────┐
│ MCP Client │ ◄──JSON-RPC──► │ MCP Server │
│ (Claude Code) │ │ (this repo) │
└───────────────────┘ └──────────────────┘
│ │
│ spawns as child │ hits
│ process (stdio) │ localhost:11434
▼ ▼
your shell env Ollama / gemma3Client — eingebettet in die LLM-App
Server — jeder Prozess, der MCP spricht
Transport —
stdio(Client startet Server als Kindprozess, leitet JSON-RPC weiter) oderstreamable-http(Server ist ein Webdienst). Dieses Repository verwendet stdio.
Drei Primitive, die ein MCP-Server bereitstellt
Primitiv | Was es ist | Verwendung in diesem Repo |
Tools | Funktionen, die das LLM aufrufen kann |
|
Ressourcen | Schreibgeschützte Blobs, die der Client abrufen kann |
|
Prompts | Vorgefertigte Prompt-Vorlagen | (nicht verwendet — minimal gehalten) |
Phasenfortschritt
Jede Phase ist ein Commit — git log zeigt die Entwicklung.
✅ scaffold — pyproject, README, .gitignore.
✅ hello-world server — ein
echo-Tool + Smoke-Test-Client. Beweist den vollständigen Lebenszyklus: Client-Start → Handshake → Tool-Erkennung → Tool-Aufruf.✅ ollama_ask tool — asynchrones Tool, das per POST an
localhost:11434/api/generatesendet und Gemmas Antwort zurückgibt.✅ polish — fügt den
system-Parameter zuollama_askhinzu und stellt eine Ressource unterollama://modelsbereit (Liste der geladenen Modelle).
Installation & Ausführung
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
# Phase 2+ only: run the server by hand to smoke-test
python -m mcp_demo.serverDer Server liest JSON-RPC von stdin und schreibt nach stdout — wenn Sie ihn direkt in einem Terminal ausführen, wartet er einfach auf Eingaben. Das ist erwartet. Der Client (Claude Code) ist das, was ihn tatsächlich füttert.
Registrierung bei Claude Code
Fügen Sie dies zu ~/.claude/settings.json hinzu:
{
"mcpServers": {
"mcp-demo": {
"command": "/home/booty/mcp-demo/.venv/bin/python",
"args": ["-m", "mcp_demo.server"]
}
}
}Starten Sie Claude Code neu. Die Tools erscheinen als mcp__mcp-demo__<tool_name>.
Weiterführende Literatur
Spezifikation: https://modelcontextprotocol.io/specification
Python SDK: https://github.com/modelcontextprotocol/python-sdk
Inspector (eine Debug-UI zum Testen jedes MCP-Servers):
npx @modelcontextprotocol/inspector
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for AI dialogue using various LLM models via AceDataCloud
An MCP server that gives your AI access to the source code and docs of all public github repos
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SiNBooty/MCP-Demo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server