Skip to main content
Glama

Go MCP Go SDK Gin Tests License Binary Size


📋 Inhaltsverzeichnis


Related MCP server: Relay

🦕 Was – und Warum

dino-mcp ist eine Referenzimplementierung des Model Context Protocol (MCP) in Go, die jede Schicht des modernen MCP-Stacks demonstriert:

Ebene

Implementierung

Warum es wichtig ist

Transport

stdio + Streamable HTTP

Funktioniert in Claude Desktop UND Webbrowsern

MCP Apps

@modelcontextprotocol/ext-apps App class

Interaktive HTML-UI in Claude Desktop-Iframes

Tools

dino_think, dino_ask, dino_dashboard

Typisierte Go-Handler, strukturierte JSON-Ergebnisse

Resources

//go:embed HTML → text/html;profile=mcp-app

In sich geschlossene ~11 MB Binärdatei, null Abhängigkeiten zur Laufzeit

Egal, ob Sie einen MCP-Server von Grund auf neu bauen, das MCP Apps-Protokoll lernen oder eine Blaupause für die Integration von Go – Gin – ext-apps SDK benötigen, dieses Projekt hat alles, was Sie brauchen.


⚡ Schnellstart

# Clone & enter
git clone https://github.com/shennawardana23/mcp-dino.git && cd mcp-dino

# Build & run in one shot (≈2 seconds)
make build-fast && make dev-http

# Open the standalone dashboard
open http://localhost:9010/dashboard
=== dino-mcp server ===
Transport: http
Listening on :9010

[GIN] 2026/06/21 - 12:30:00 | 200 | 4.2ms | ::1 | GET "/dashboard"
[GIN] 2026/06/21 - 12:30:01 | 200 | 2.1ms | ::1 | GET "/api/dinosaurs"

🏗 Architektur auf einen Blick

flowchart TB
  subgraph CLI["CLI Layer"]
    STDIO["stdio subcommand"]
    HTTP["http subcommand"]
  end

  subgraph SERVER["Server (internal/server/)"]
    GIN["Gin Router :9010"]
    MCPH["MCP StreamableHTTPHandler"]
    CORS["CORS Middleware"]
    TOOLS["Tools: think · ask · dashboard"]
    RES["Resources: //go:embed HTML"]
  end

  subgraph UI["View (ui/src/)"]
    APP["ext-apps App class"]
    POST["postMessage protocol"]
  end

  subgraph FALLBACK["Standalone Fallback"]
    DASH["/dashboard (HTML)"]
    API["/api/dinosaurs (JSON)"]
  end

  CLI --> GIN
  GIN --> CORS
  CORS --> MCPH
  MCPH --> TOOLS
  TOOLS --> RES
  RES --> APP
  APP --> POST
  MCPH -.->|"MCP Apps"| APP
  GIN -.->|"direct route"| DASH
  GIN -.->|"direct route"| API

  style CLI fill:#1a1a2e,color:#e0e0e0,stroke:#2d2a44
  style SERVER fill:#1a1a2e,color:#e0e0e0,stroke:#2d2a44
  style UI fill:#1a1a2e,color:#e0e0e0,stroke:#2d2a44
  style FALLBACK fill:#1a1a2e,color:#e0e0e0,stroke:#2d2a44
  style STDIO fill:#2d2a44,color:#a78bfa
  style HTTP fill:#2d2a44,color:#a78bfa
  style GIN fill:#0099e5,color:#fff
  style MCPH fill:#a78bfa,color:#fff
  style TOOLS fill:#22c55e,color:#fff
  style RES fill:#22c55e,color:#fff
  style APP fill:#facc15,color:#000
  style POST fill:#facc15,color:#000
  style DASH fill:#f87171,color:#fff
  style API fill:#f87171,color:#fff

Daten fließen durch drei Kanäle:

Kanal

Protokoll

Client

Anwendungsfall

MCP Tools

JSON-RPC über stdio

Claude Desktop

Textwerkzeuge (dino_think, dino_ask)

MCP Apps

JSON-RPC über stdio + postMessage

Claude Desktop iframe

Interaktive UI (dino_dashboard)

Eigenständig

HTTP GET

Browser

Direkter Zugriff (/dashboard, /api/dinosaurs)


✨ Funktionen

Funktion

Status

Anmerkungen

Tools (tools/list, tools/call)

✅ Abgeschlossen

3 typisierte Werkzeuge mit strukturierten JSON-Antworten

Resources (resources/list, resources/read)

✅ Abgeschlossen

//go:embed HTML bereitgestellt unter ui://-URIs

MCP Apps-Protokoll

✅ Abgeschlossen

_meta.ui.resourceUri + ui/initialize-Handshake

stdio-Transport

Claude Desktop, Cursor, Copilot

Streamable HTTP

MCP Inspector, curl, Browser, Tunnel

SSE-Transport

❌ Entfernt

Veraltet in MCP-Spezifikation v2025-11-25

  • 3-Sekunden-Build-Zyklusmake build-fast && make dev-http

  • 7 Integrationstestsmake test testet jede Protokollmethode

  • Interaktives Debuggingmake test-inspector startet MCP Inspector

  • Remote-Testsmake run-tunnel erstellt eine öffentliche trycloudflare.com-URL

  • Keine API-Schlüssel – alle Dinosaurierdaten sind in die Binärdatei eingebettet

  • Null Laufzeitabhängigkeiten – einzelne statische Binärdatei mit eingebettetem HTML

Das dino_dashboard-Werkzeug rendert ein HTML-Kartenraster im Iframe von Claude Desktop:

  • Nach Ernährung filtern – Fleischfresser, Pflanzenfresser oder Alle anzeigen

  • Nach Periode filtern – Trias, Jura, Kreide

  • 12 Dinosaurierarten – von T-Rex bis Velociraptor

  • Fallback-Modus – direkt öffnen unter http://localhost:9010/dashboard

Hinweis: Der Filter wird serverseitig zum Zeitpunkt des Aufrufs angewendet. Wenn das Dashboard mit einem bestimmten Filter geöffnet wurde, können die Filterknöpfe in der App nur noch innerhalb desselben Ergebnissatzes weiter eingrenzen – sie können nicht wieder auf Arten erweitern, die der anfängliche Aufruf ausgeschlossen hat.

Die HTML-Ansicht wird mit dem offiziellen @modelcontextprotocol/ext-apps-SDK erstellt und kommuniziert über JSON-RPC per postMessage.


🎮 Ausprobieren

In Claude Desktop

Show me the dinosaur dashboard with carnivores

→ Claude erkennt die MCP-App → rendert einen Iframe → Sie sehen filterbare Dinosaurierkarten

In Ihrem Browser

open http://localhost:9010/dashboard

→ Eigenständiges HTML mit allen Dinosaurierdaten, die von der integrierten REST-API abgerufen werden

Mit MCP Inspector

make test-inspector

→ Öffnet http://localhost:5173 → verbindet sich mit http://localhost:9010/mcp

Per curl

# Initialize
curl -s -X POST http://localhost:9010/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}' \
  | python3 -m json.tool

# List tools
SID="<session-id-from-above>"
curl -s -X POST http://localhost:9010/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Mcp-Session-Id: $SID" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
  | python3 -m json.tool

# Call dino_think
curl -s -X POST http://localhost:9010/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Mcp-Session-Id: $SID" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"dino_think","arguments":{}}}' \
  | python3 -m json.tool

🔧 Tool-Referenz

Tool

Typ

Eingabe

Ausgabe

Beispiel-Prompt

dino_think

Text

{}

Zufallsfakt + Arten-JSON

"Erzähl mir einen Dinosaurier-Fakt"

dino_ask

Text

{"question": "..."}

Antwort + Frage-JSON

"Was hat T-Rex gefressen?"

dino_dashboard

MCP App

{"filter": "Carnivore"}

HTML-Iframe + JSON-Daten

"Zeig mir fleischfressende Dinosaurier"

dino_ask gibt derzeit unabhängig von der gestellten Frage dieselbe allgemeine Übersicht über die Dinosaurier-Ära zurück – es verzweigt noch nicht auf den Fragetext. Wird als bekannte Einschränkung vermerkt.

Beispielantwort dino_think:

{
  "content": [
    { "type": "text", "text": "🦕 Did you know? The Velociraptor was only about the size of a turkey!" }
  ],
  "structuredContent": {
    "fact": "The Velociraptor was only about the size of a turkey",
    "species": "Velociraptor"
  }
}

Beispielantwort dino_dashboard:

{
  "content": [
    { "type": "text", "text": "Displaying dinosaur dashboard with 4 dinosaurs (filter: Carnivore)" }
  ],
  "structuredContent": {
    "filter": "Carnivore",
    "dinosaurs": [
      {
        "name": "Tyrannosaurus Rex",
        "period": "Cretaceous",
        "diet": "Carnivore",
        "length": "40 ft (12 m)",
        "weight": "9 tons (8,000 kg)",
        "funFact": "T-Rex had the strongest bite of any land animal ever",
        "imageStyle": "bg-red-900"
      }
    ],
    "timestamp": "2026-06-21T12:00:00Z"
  }
}

💬 Claude Desktop-Integration

CLI-Modus (stdin/stdout)

Suchen Sie die Binärdatei und fügen Sie sie Ihrer claude_desktop_config.json hinzu:

{
  "mcpServers": {
    "dino-mcp": {
      "command": "/absolute/path/to/mcp-dino/bin/dino-mcp",
      "args": ["stdio"]
    }
  }
}

Nach dem Speichern starten Sie Claude Desktop neu. Sie sehen Hammer-Symbole (🔨) auf den Werkzeugen, wenn Sie chatten – klicken Sie, um direkt aufzurufen, oder lassen Sie Claude entscheiden.

HTTP-Modus (für Debugging)

make dev-http
# Server starts on :9010

🛠 Entwicklung

Voraussetzungen

Tool

Version

Zweck

Go

≥ 1.25

Server-Binärdatei

Node.js

≥ 18

UI-Build (Vite)

cloudflared

beliebig

Tunnel für Remote-Tests

Befehle

# Build — three options
make build            # Full: Vite UI + Go binary
make build-fast       # Quick: Go binary only (reuses existing UI)
make build-ui         # Vite UI only

# Run
make dev-http         # HTTP mode with verbose logging
make run-stdio        # stdio mode for Claude Desktop
make run-tunnel       # HTTP + Cloudflare Tunnel

# Test & verify
make test             # 7 integration tests — all must pass
make test-inspector   # Launch MCP Inspector in browser
make lint             # go vet + go fmt

# Utility
make help             # All targets with descriptions
make clean            # Remove all build artifacts

Projektstruktur

mcp-dino/
├── bin/                          # Go build output (~11MB static binary)
├── cmd/dino-mcp/main.go          # CLI entry point (stdio | http | help)
├── internal/
│   ├── server/
│   │   └── server.go             # Composition root: mcp.Server + Gin + CORS
│   ├── tools/
│   │   ├── tools.go              # Shared types, constants, helpers
│   │   ├── think.go              # RegisterThink (dino_think tool)
│   │   ├── ask.go                # RegisterAsk (dino_ask tool)
│   │   └── dashboard.go          # RegisterDashboardTool + 12 dino species + REST API
│   └── resources/
│       ├── dashboard.go          # RegisterDashboardResource + //go:embed HTML
│       └── dashboard_ui.html     # Vite-built HTML (354KB)
├── ui/
│   └── src/
│       └── mcp-app.ts            # ext-apps App class + postMessage
├── docs/                         # Diátaxis documentation (see below)
├── test_mcp.sh                   # 7 integration tests
├── AGENTS.md                     # AI agent instructions (canonical)
├── ARCHITECTURE.md               # C4 diagrams + sequence flows
├── TECH_DESIGN.md                # Interface contracts + data model
├── Makefile                      # All targets
├── go.mod + go.sum               # Go dependencies
└── README.md                     # ← you are here

🗺 Dokumentationsübersicht

dino-mcp verwendet das Diátaxis-Framework – vier Dokumentationsmodi, jeder für unterschiedliche Bedürfnisse.

Für dieses Publikum

Hier starten

Zielgruppe

👋 Neu im Projekt

Schnellstart

Alle

🧑💻 Ein Werkzeug hinzufügen

Ihr erstes Werkzeug

Entwickler

🦕 Einen Dinosaurier hinzufügen

Einen Dinosaurier hinzufügen

Content-Redakteure

🧪 Testen mit Inspector

Testen mit Inspector

QA / Entwickler

🔍 Referenz benötigt

CLI-Referenz

Betreiber

🏗 Design verstehen

Architektur

Architekten

🤖 Implementierung über KI

AGENTS.md

KI-Codierungsagenten

📚 Tiefe Architektur

ARCHITECTURE.md

Senior-Entwickler

📐 Technische Spezifikationen

TECH_DESIGN.md

Implementierungsteams

⏳ Entwicklungsgeschichte

MEMORY.md

Alle Mitwirkenden

📋 Fahrplan

PLAN.md

Stakeholder

⚖️ Design-Abwägungen

DESIGN.md

Architekten

🎯 Fähigkeiten-Referenz

SKILL.md

Entwickler / KI-Agenten

🤝 Wie man beiträgt

CONTRIBUTOR.md

Mitwirkende

📜 Verhaltenskodex

CODE_CONDUCT.md

Community

📄 ADRs

docs/adr/

Entscheidungshistoriker

🤖 LLM voller Kontext

llms-full.txt

KI-Agenten (RAG)


📊 Projektstatus

MVP ── Production ── Enhanced UI ── Ecosystem ── Advanced
  ●                    ○               ○             ○

Phase

Status

Höhepunkte

MVP

✅ Abgeschlossen

3 Werkzeuge, MCP Apps-UI, 7 Tests, Dokumentation

Produktion

🔄 In Bearbeitung

Go-Unit-Tests, CI, Ratenbegrenzung, Docker

Erweiterte UI

📅 Geplant

Echtzeitdaten, Vergleich, Zeitleiste

Ökosystem

📅 Geplant

Homebrew, GitHub-Releases, MCP-Registry

Fortgeschritten

💭 Zukunft

Streaming-Werkzeugeingaben, WebSocket-Synchronisation

Build-Metriken

Metrik

Wert

Binärgröße

~11 MB (komprimiert)

Binärtyp

Mach-O 64-bit arm64

Go-Version

1.25

MCP SDK-Version

v1.7.0

Abhängigkeiten

30+ Go-Module (alle indirekt)

UI-Bundle

354 KB eingebettetes HTML (Single-File Vite)

Testabdeckung

7/7 Integrationstests bestanden (Shell-basiert; noch keine Go-Unit-Tests)


📖 Weiterführende Literatur


F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    A production-ready MCP server with tools for weather, calculator, and mock database queries, plus resources and prompt templates, featuring a glassmorphism admin dashboard and WebSocket support.
  • A
    license
    -
    quality
    A
    maintenance
    A single MCP server with 40 tools across 7 categories - PM, Research, Brand, UX, GTM, File, and Web. Built in Go, zero dependencies, one binary. Handles file operations, web fetching, screenshots, search, and planning workflows through one MCP connection.
    11
    MIT
  • F
    license
    -
    quality
    C
    maintenance
    A self-hosted MCP gateway that aggregates all your MCP servers behind a single Streamable HTTP endpoint, with automatic registry discovery (19,000+ servers), on-demand Docker provisioning, multi-device support via SSH, OAuth2 PKCE authentication, and a workflow engine for saving and replaying multi-step tool sequences.

View all related MCP servers

Related MCP Connectors

  • A MCP server built for developers enabling Git based project management with project and personal…

  • MCP server for InsForge BaaS — database, storage, edge functions, and deployments

  • Go MCP server for GitLab: 2 dynamic tools reach 1000+ REST/GraphQL actions. Free/CE, no paid tier.

View all MCP Connectors

Latest Blog Posts

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/shennawardana23/mcp-dino'

If you have feedback or need assistance with the MCP directory API, please join our Discord server