mcp-dino について
mcp-dinoは、恐竜データとインタラクティブなダッシュボードを通じて、MCPツール、リソース、MCP Appsを示すGo製のリファレンス実装です。MCPやGoサーバーの実装を学ぶ開発者向けで、ブラウザー単独でも表示できます。
主な機能
- 01恐竜関連の3つのツール
- 02MCP Appとしてのインタラクティブなダッシュボード
- 03stdioとStreamable HTTPに対応
- 04HTMLリソースをバイナリに埋め込み
- 05APIキーなしで動作
活用シーン
- 01GoでのMCPサーバー実装の学習
- 02MCP Appsの対話型UIのテスト
- 03クライアントやブラウザーで恐竜データを表示
MCP 対応
stdioとStreamable HTTPに対応するMCPサーバーで、3つのツール、HTMLリソース、MCP Appsによるダッシュボードを提供します。
設定
ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。
このサーバーのパッケージやリモートエンドポイントはまだ取得できていません。プロジェクトの README の手順に従ってください。
ツール
ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。
詳細
インタラクティブな HTML ダッシュボード UI を備えた、本番環境対応の MCP サーバーです — Go で記述され、使いやすさにもこだわっています。
📋 目次
🦕 概要と理由
dino-mcp は、最新の MCP スタックの各レイヤーをすべて紹介する、Go による Model Context Protocol(MCP) のリファレンス実装です。
| レイヤー | 実装 | 重要な理由 |
|---|---|---|
| トランスポート | stdio + Streamable HTTP | Claude Desktop とウェブブラウザーの両方で動作します |
| MCP Apps | @modelcontextprotocol/ext-apps App class | Claude Desktop の iframe でインタラクティブな HTML UI を表示します |
| ツール | dino_think、dino_ask、dino_dashboard | 型付きの Go ハンドラー、構造化された JSON 結果 |
| リソース | //go:embed HTML → text/html;profile=mcp-app | 約 11MB の自己完結型バイナリで、実行時の依存関係はゼロです |
MCP サーバーを一から構築する場合も、MCP Apps プロトコルを学ぶ場合も、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
データは 3 つの経路を通って流れます:
| 経路 | プロトコル | クライアント | 用途 |
|---|---|---|---|
| MCP ツール | stdio 上の JSON-RPC | Claude Desktop | テキストツール(dino_think、dino_ask) |
| MCP Apps | stdio 上の JSON-RPC + postMessage | Claude Desktop iframe | インタラクティブ UI(dino_dashboard) |
| スタンドアロン | HTTP GET | ブラウザー | 直接アクセス(/dashboard、/api/dinosaurs) |
✨ 機能
MCP 標準への準拠
| 機能 | ステータス | 備考 |
|---|---|---|
ツール(tools/list、tools/call) | ✅ 完了 | 型付けされた 3 つのツールと構造化 JSON レスポンス |
リソース(resources/list、resources/read) | ✅ 完了 | //go:embed の HTML を ui:// URI で提供 |
| 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で公開trycloudflare.comURL を作成 - API キー不要 — すべての恐竜データがバイナリに組み込まれています
- ランタイム依存関係ゼロ — HTML を埋め込んだ単一の静的バイナリ
インタラクティブなダッシュボード
dino_dashboard ツールは、Claude Desktop の iframe 内に HTML のカードグリッドを表示します。
- 食性でフィルター — 肉食、草食、またはすべてを表示
- 時代でフィルター — 三畳紀、ジュラ紀、白亜紀
- 12 種の恐竜 — T-Rex から Velociraptor まで
- フォールバックモード —
http://localhost:9010/dashboardを直接開く
注:フィルターはツールの呼び出し時にサーバー側で適用されます。特定のフィルターで開くと、アプリ内のフィルターボタンで絞り込めるのは同じ結果セット内だけです。最初の呼び出しで除外された種を再び表示することはできません。
HTML ビューは公式の @modelcontextprotocol/ext-apps SDK で構築され、postMessage を介した JSON-RPC で通信します。
🎮 試してみる
Claude Desktop で
Show me the dinosaur dashboard with carnivores
→ Claude が MCP App を検出 → iframe を表示 → フィルター可能な恐竜カードが表示されます
ブラウザーで
open http://localhost:9010/dashboard
→ 組み込み REST API からすべての恐竜データを取得するスタンドアロン HTML
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 フレームワークを採用しています。4 つのドキュメント形式があり、それぞれ異なるニーズに対応します。
| 対象読者 | まずはこちら | 対象者 |
|---|---|---|
| 👋 プロジェクトを初めて利用する方 | クイックスタート | すべての方 |
| 🧑💻 ツールを追加する方 | 初めてのツール | 開発者 |
| 🦕 恐竜を追加する方 | 恐竜を追加する | コンテンツ編集者 |
| 🧪 Inspector でテストする方 | Inspector でテストする | QA/開発者 |
| 🔍 リファレンスを確認したい方 | CLI リファレンス | 運用担当者 |
| 🏗 設計を理解したい方 | アーキテクチャ | アーキテクト |
| 🤖 AI を利用して実装する方 | AGENTS.md | AI コーディングエージェント |
| 📚 アーキテクチャを深く理解したい方 | ARCHITECTURE.md | シニアエンジニア |
| 📐 技術仕様を確認したい方 | TECH_DESIGN.md | 実装チーム |
| ⏳ 開発の履歴を確認したい方 | MEMORY.md | すべてのコントリビューター |
| 📋 ロードマップを確認したい方 | PLAN.md | ステークホルダー |
| ⚖️ 設計上のトレードオフを確認したい方 | DESIGN.md | アーキテクト |
| 🎯 スキルのリファレンスを確認したい方 | SKILL.md | 開発者/AI エージェント |
| 🤝 貢献方法を確認したい方 | CONTRIBUTOR.md | コントリビューター |
| 📜 行動規範を確認したい方 | CODE_CONDUCT.md | コミュニティ |
| 📄 ADR | docs/adr/ | 意思決定の履歴を確認する方 |
| 🤖 LLM 向けの完全なコンテキスト | llms-full.txt | AI エージェント(RAG) |
📊 プロジェクトのステータス
MVP ── Production ── Enhanced UI ── Ecosystem ── Advanced
● ○ ○ ○
| フェーズ | ステータス | 主な内容 |
|---|---|---|
| MVP | ✅ 完了 | 3 つのツール、MCP Apps UI、7 件のテスト、ドキュメント |
| 本番環境 | 🔄 進行中 | Go のユニットテスト、CI、レート制限、Docker |
| UI の拡張 | 📅 予定 | リアルタイムデータ、比較、タイムライン |
| エコシステム | 📅 予定 | Homebrew、GitHub リリース、MCP Registry |
| 高度な機能 | 💭 将来 | ストリーミングによるツール入力、WebSocket 同期 |
ビルド指標
| 指標 | 値 |
|---|---|
| バイナリサイズ | 約 11 MB(圧縮後) |
| バイナリ形式 | Mach-O 64-bit arm64 |
| Go のバージョン | 1.25 |
| MCP SDK のバージョン | v1.7.0 |
| 依存関係 | 30 個以上の Go モジュール(すべて間接依存) |
| UI バンドル | 354 KB の埋め込み HTML(単一ファイルの Vite) |
| テストカバレッジ | 7 件中 7 件の統合テストに合格(シェルベース。Go のユニットテストはまだありません) |
📖 さらに読む
| リソース | リンク |
|---|---|
| MCP 仕様 | spec.modelcontextprotocol.io |
| MCP Go SDK | github.com/modelcontextprotocol/go-sdk |
| MCP Apps プロトコル | modelcontextprotocol.io/docs/apps/overview |
| ext-apps SDK | github.com/modelcontextprotocol/ext-apps |
| Gin Web フレームワーク | github.com/gin-gonic/gin |
| Go プログラミング言語 | go.dev |
❤️ を込めて、Go、 Gin、 MCP Go SDK、 および @modelcontextprotocol/ext-apps を使用して構築
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。