Skip to main content
Glama

Go MCP Go SDK Gin Tests License Binary Size


📋 Содержание


Related MCP server: Relay

🦕 Что — и зачем

dino-mcp — это эталонная реализация Model Context Protocol (MCP) на Go, демонстрирующая каждый слой современного стека MCP:

Слой

Реализация

Почему это важно

Транспорт

stdio + Streamable HTTP

Работает и в Claude Desktop, и в веб-браузерах

MCP Apps

Класс App из @modelcontextprotocol/ext-apps

Интерактивные HTML-интерфейсы в iframe Claude Desktop

Инструменты

dino_think, dino_ask, dino_dashboard

Типизированные Go-обработчики, структурированные JSON-результаты

Ресурсы

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

Самодостаточный бинарник ~11 МБ, ноль зависимостей во время выполнения

Создаете ли вы MCP-сервер с нуля, изучаете протокол MCP Apps или ищете blueprint интеграции Go — Gin — ext-apps SDK, этот проект вас покроет.


⚡ Быстрый старт

# 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"

🏗 Архитектура в двух словах

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

Данные проходят через три канала:

Канал

Протокол

Клиент

Сценарий использования

MCP Tools

JSON-RPC через stdio

Claude Desktop

Текстовые инструменты (dino_think, dino_ask)

MCP Apps

JSON-RPC через stdio + postMessage

iframe Claude Desktop

Интерактивный интерфейс (dino_dashboard)

Автономный

HTTP GET

Браузер

Прямой доступ (/dashboard, /api/dinosaurs)


✨ Возможности

Возможность

Статус

Примечания

Инструменты (tools/list, tools/call)

✅ Готово

3 типизированных инструмента со структурированными JSON-ответами

Ресурсы (resources/list, resources/read)

✅ Готово

//go:embed HTML, обслуживаемый по URI ui://

Протокол MCP Apps

✅ Готово

_meta.ui.resourceUri + рукопожатие ui/initialize

Транспорт stdio

✅ Готово

Claude Desktop, Cursor, Copilot

Streamable HTTP

✅ Готово

MCP Inspector, curl, браузер, туннель

Транспорт SSE

❌ Удалено

Устарел в спецификации MCP v2025-11-25

  • Цикл сборки за 3 секундыmake build-fast && make dev-http

  • 7 интеграционных тестовmake test проверяет каждый метод протокола

  • Интерактивная отладкаmake test-inspector запускает MCP Inspector

  • Удалённое тестированиеmake run-tunnel создаёт публичный URL trycloudflare.com

  • Без API-ключей — все данные о динозаврах встроены в бинарник

  • Ноль зависимостей во время выполнения — один статический бинарник с встроенным HTML

Инструмент dino_dashboard отображает сетку карточек HTML внутри iframe Claude Desktop:

  • Фильтр по типу питания — Carnivore, Herbivore или показать всех

  • Фильтр по периоду — Triassic, Jurassic, Cretaceous

  • 12 видов динозавров — от T-Rex до Velociraptor

  • Режим запасного варианта — открыть напрямую по адресу http://localhost:9010/dashboard

Примечание: фильтр применяется на стороне сервера в момент вызова инструмента. После открытия с определённым фильтром кнопки фильтра в приложении могут только сужать диапазон в пределах того же набора результатов — они не могут расширить его обратно до видов, исключённых при начальном вызове.

HTML-представление построено на официальном SDK @modelcontextprotocol/ext-apps и общается через JSON-RPC по postMessage.


🎮 Попробуйте

В Claude Desktop

Show me the dinosaur dashboard with carnivores

→ Claude обнаруживает MCP App → отображает iframe → вы видите фильтруемые карточки динозавров

В вашем браузере

open http://localhost:9010/dashboard

→ Автономный HTML, все данные о динозаврах загружаются из встроенного REST API

С MCP Inspector

make test-inspector

→ Открывается http://localhost:5173 → подключается к http://localhost:9010/mcp

Через 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

🔧 Справочник инструментов

Инструмент

Тип

Входные данные

Выходные данные

Пример запроса

dino_think

Текстовый

{}

Случайный факт + JSON вида

"Расскажи факт о динозавре"

dino_ask

Текстовый

{"question": "..."}

Ответ + JSON вопроса

"Что ел T-Rex?"

dino_dashboard

MCP App

{"filter": "Carnivore"}

HTML iframe + JSON данные

"Покажи хищных динозавров"

В настоящее время dino_ask возвращает один и тот же общий обзор эпохи динозавров независимо от заданного вопроса — он ещё не ветвится по тексту вопроса. Отмечено как известное ограничение.

Пример ответа 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"
  }
}

Пример ответа 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

Режим CLI (stdin/stdout)

Найдите бинарник и добавьте в claude_desktop_config.json:

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

После сохранения перезапустите Claude Desktop. Вы увидите иконки молотков (🔨) на инструментах при общении — нажмите, чтобы вызвать напрямую, или позвольте Claude решить.

Режим HTTP (для отладки)

make dev-http
# Server starts on :9010

🛠 Разработка

Предварительные требования

Инструмент

Версия

Назначение

Go

≥ 1.25

Бинарник сервера

Node.js

≥ 18

Сборка UI (Vite)

cloudflared

любая

Туннель для удалённого тестирования

Команды

# 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

Структура проекта

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

🗺 Карта документации

dino-mcp использует фреймворк Diátaxis — четыре режима документации, каждый для разных нужд.

Для этой аудитории

Начать здесь

Аудитория

👋 Новичок в проекте

Быстрый старт

Все

🧑💻 Добавление инструмента

Ваш первый инструмент

Разработчики

🦕 Добавление динозавра

Добавить динозавра

Контент-редакторы

🧪 Тестирование с Inspector

Тестирование с Inspector

QA / Разработчики

🔍 Нужна справка

Справка CLI

Операторы

🏗 Понимание дизайна

Архитектура

Архитекторы

🤖 Реализация через ИИ

AGENTS.md

ИИ-агенты для кода

📚 Глубокая архитектура

ARCHITECTURE.md

Старшие инженеры

📐 Технические спецификации

TECH_DESIGN.md

Команды реализации

⏳ История разработки

MEMORY.md

Все участники

📋 Дорожная карта

PLAN.md

Заинтересованные стороны

⚖️ Компромиссы в дизайне

DESIGN.md

Архитекторы

🎯 Справочник навыков

SKILL.md

Разработчики / ИИ-агенты

🤝 Как внести вклад

CONTRIBUTOR.md

Контрибьюторы

📜 Кодекс поведения

CODE_CONDUCT.md

Сообщество

📄 ADR

docs/adr/

Историки решений

🤖 Полный контекст для LLM

llms-full.txt

ИИ-агенты (RAG)


📊 Статус проекта

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

Фаза

Статус

Основные моменты

MVP

✅ Завершено

3 инструмента, UI MCP Apps, 7 тестов, документация

Продакшн

🔄 В процессе

Go-юнит-тесты, CI, ограничение скорости, Docker

Улучшенный UI

📅 Запланировано

Данные в реальном времени, сравнение, временная шкала

Экосистема

📅 Запланировано

Homebrew, релизы GitHub, реестр MCP

Продвинутый

💭 В будущем

Потоковый ввод инструментов, синхронизация WebSocket

Метрики сборки

Метрика

Значение

Размер бинарника

~11 МБ (сжатый)

Тип бинарника

Mach-O 64-bit arm64

Версия Go

1.25

Версия MCP SDK

v1.7.0

Зависимости

30+ модулей Go (все косвенные)

Пакет UI

354 КБ встроенного HTML (однофайловый Vite)

Покрытие тестами

7/7 интеграционных тестов пройдено (на shell; unit-тестов Go пока нет)


📖 Дополнительное чтение

Ресурс

Ссылка

MCP Specification

spec.modelcontextprotocol.io

MCP Go SDK

github.com/modelcontextprotocol/go-sdk

MCP Apps Protocol

modelcontextprotocol.io/docs/apps/overview

ext-apps SDK

github.com/modelcontextprotocol/ext-apps

Gin Web Framework

github.com/gin-gonic/gin

Go Programming Language

go.dev


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