Skip to main content
Glama

Go MCP Go SDK Gin Tests License Binary Size


📋 목차


Related MCP server: Relay

🦕 무엇인가 — 그리고 왜인가

dino-mcp는 Go로 작성된 Model Context Protocol (MCP) 의 참조 구현체로, 현대 MCP 스택의 모든 레이어를 보여줍니다:

레이어

구현

중요한 이유

전송

stdio + Streamable HTTP

Claude Desktop 및 웹 브라우저에서 모두 작동

MCP Apps

@modelcontextprotocol/ext-apps App 클래스

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

데이터는 세 개의 파이프를 통해 흐릅니다:

파이프

프로토콜

클라이언트

사용 사례

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)


✨ 기능

기능

상태

참고

도구 (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.com URL 생성

  • API 키 불필요 — 모든 공룡 데이터가 바이너리에 내장됨

  • 런타임 의존성 제로 — HTML이 포함된 단일 정적 바이너리

dino_dashboard 도구는 Claude Desktop의 iframe 내에 HTML 카드 그리드를 렌더링합니다:

  • 식성별 필터 — 육식, 초식 또는 모두 표시

  • 시대별 필터 — 트라이아스기, 쥐라기, 백악기

  • 12종의 공룡 — 티라노사우루스부터 벨로키랍토르까지

  • 대체 모드 — 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

"티라노사우루스는 무엇을 먹었나요?"

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 참조

운영자

🏗 설계 이해

아키텍처

아키텍트

🤖 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 레지스트리

고급

💭 미래

스트리밍 도구 입력, 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 유닛 테스트 없음)


📖 추가 자료


Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    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
    Not graded
    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.
    12
    MIT