AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Mcp Server Samples

mcp-nogataka-mcp-server-samples · by nogataka

MCP server from nogataka/mcp-server-samples.

No reviews yet
0 installs
21 views
0.0% view→install

Install

$ agentstack add mcp-nogataka-mcp-server-samples

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-nogataka-mcp-server-samples)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
11mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Mcp Server Samples? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

MCP Server 実装例集

[](https://github.com/nogataka/mcp-server-samples)

このリポジトリには、Model Context Protocol (MCP) サーバーの3つの異なるトランスポート方式による実装例が含まれています。

💡 このサンプルアプリについて

各実装は、OpenAI APIをMCPツールとして提供するシンプルなサーバーです。Claude DesktopなどのMCPクライアントから、OpenAIのGPTモデルに質問を投げて回答を得ることができます。

主な機能:

  • ask_openaiツール: OpenAI APIに質問を送信し、回答を取得
  • モデル選択: 使用するGPTモデルを指定可能(デフォルト: gpt-4o-mini)
  • エラーハンドリング: API呼び出しの失敗を適切に処理

ユースケース例:

Claude: 「OpenAIのGPT-4に、Pythonのリスト内包表記について説明してもらえますか?」
→ MCPサーバーがask_openaiツールを実行
→ OpenAI APIから回答を取得
→ Claudeに結果を返す

このシンプルな実装を通じて、MCPサーバーの3つの異なるトランスポート方式(STDIO、SSE、HTTP)の違いと使い分けを学ぶことができます。

📚 ドキュメント

  • [クイックスタートガイド](QUICKSTART.md) - 素早く始めるための手順
  • [詳細な比較記事](MCPSERVERCOMPARISON.md) - 3つの実装方式の徹底比較と解説

🗂️ プロジェクト構成

mcp-server-samples/
├── mcp-stdio/              # STDIO トランスポート実装
│   ├── src/
│   │   └── index.ts
│   ├── package.json
│   ├── tsconfig.json
│   └── README.md
├── mcp-sse/                # SSE トランスポート実装
│   ├── src/
│   │   └── index.ts
│   ├── package.json
│   ├── tsconfig.json
│   └── README.md
├── mcp-streamable-http/    # Streamable HTTP トランスポート実装
│   ├── src/
│   │   └── index.ts
│   ├── package.json
│   ├── tsconfig.json
│   └── README.md
├── MCP_SERVER_COMPARISON.md # 詳細な比較記事
├── QUICKSTART.md           # クイックスタートガイド
├── setup.sh                # 一括セットアップスクリプト
└── README.md               # このファイル

🚀 クイックスタート

1. リポジトリのクローン

git clone https://github.com/nogataka/mcp-server-samples.git
cd mcp-server-samples

2. 一括セットアップ

chmod +x setup.sh
./setup.sh

3. 環境変数の設定

各プロジェクトで.envファイルを作成:

# 例: mcp-stdio
cd mcp-stdio
cp .env.example .env
# .envファイルを編集してOPENAI_API_KEYを設定

4. サーバーを起動

# STDIO Server
cd mcp-stdio && npm start

# SSE Server
cd mcp-sse && npm start
# → http://localhost:3000

# Streamable HTTP Server
cd mcp-streamable-http && npm start
# → http://localhost:3001

詳細は[クイックスタートガイド](QUICKSTART.md)を参照してください。

📊 3つの実装方式

1. STDIO トランスポート (mcp-stdio/)

標準入出力を使用したMCPサーバー

const transport = new StdioServerTransport();
await server.connect(transport);

特徴:

  • ✅ 最もシンプルな実装
  • ✅ 低レイテンシー
  • ✅ プロセス間通信(IPC)
  • ❌ ローカル環境専用

適用シーン:

  • Claude Desktopアプリ
  • ローカル開発ツール
  • 個人プロジェクト

2. SSE トランスポート (mcp-sse/)

Server-Sent Eventsを使用したMCPサーバー

app.get("/sse", async (req, res) => {
  const transport = new SSEServerTransport("/message", res);
  await server.connect(transport);
});

特徴:

  • ✅ リアルタイム通信
  • ✅ HTTP上で動作
  • ✅ サーバープッシュ対応
  • ⚠️ 2つのHTTPチャネルが必要

適用シーン:

  • Webアプリケーション
  • リアルタイムダッシュボード
  • 通知システム

3. Streamable HTTP トランスポート (mcp-streamable-http/)

標準的なHTTP POST/Responseを使用したMCPサーバー

app.post("/mcp", async (req, res) => {
  const response = await server.handleRequest(req.body);
  res.json(response);
});

特徴:

  • ✅ 最も汎用的
  • ✅ REST APIライク
  • ✅ 高スケーラビリティ
  • ✅ ファイアウォールフレンドリー

適用シーン:

  • マイクロサービス
  • エンタープライズシステム
  • 公開API

📋 比較表

| 項目 | STDIO | SSE | Streamable HTTP | |------|-------|-----|-----------------| | 実装難易度 | ⭐ 易 | ⭐⭐ 中 | ⭐⭐ 中 | | パフォーマンス | ⭐⭐⭐ 最高 | ⭐⭐ 良 | ⭐⭐ 良 | | スケーラビリティ | ⭐ 低 | ⭐⭐ 中 | ⭐⭐⭐ 高 | | ネットワーク対応 | ❌ | ✅ | ✅ | | リアルタイム性 | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ | | デバッグ容易性 | ⭐⭐ | ⭐⭐ | ⭐⭐⭐ |

詳細な比較は[MCPSERVERCOMPARISON.md](MCPSERVERCOMPARISON.md)を参照してください。

🛠️ 技術スタック

  • 言語: TypeScript
  • ランタイム: Node.js 18+
  • フレームワーク: Express (SSE/HTTP版)
  • SDK: @modelcontextprotocol/sdk
  • API: OpenAI API

📝 各プロジェクトの機能

全ての実装で以下のツールを提供:

ask_openai ツール

OpenAI APIを使用して質問に回答します。

パラメータ:

  • prompt (string, required): OpenAIに送信する質問
  • model (string, optional): 使用するモデル(デフォルト: gpt-4o-mini)

使用例:

{
  "name": "ask_openai",
  "arguments": {
    "prompt": "TypeScriptの特徴を教えてください",
    "model": "gpt-4o-mini"
  }
}

🧪 テスト方法

STDIO Server

Claude Desktopで設定して使用します。

SSE Server

# ヘルスチェック
curl http://localhost:3000/health

# SSE接続
curl -N http://localhost:3000/sse

Streamable HTTP Server

# ツール一覧
curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

# ツール実行
curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc":"2.0",
    "id":2,
    "method":"tools/call",
    "params":{
      "name":"ask_openai",
      "arguments":{"prompt":"Hello!"}
    }
  }'

🔧 開発

ビルド

npm run build

実行

npm start

開発モード

npm run dev

📖 学習リソース

🤝 コントリビューション

このプロジェクトは学習目的で作成されています。改善提案やバグ報告は歓迎します。

プルリクエストを送る前に:

  1. リポジトリをフォーク
  2. フィーチャーブランチを作成 (git checkout -b feature/amazing-feature)
  3. 変更をコミット (git commit -m 'Add some amazing feature')
  4. ブランチにプッシュ (git push origin feature/amazing-feature)
  5. プルリクエストを作成

📄 ライセンス

MIT License

👤 著者

@nogataka

このプロジェクトは、MCPサーバーの異なる実装方式を学習・比較するために作成されました。

🎯 次のステップ

  1. リポジトリをクローン
  2. [クイックスタートガイド](QUICKSTART.md)で環境をセットアップ
  3. [詳細な比較記事](MCPSERVERCOMPARISON.md)で各実装を理解
  4. 自分のユースケースに合った実装を選択
  5. カスタムツールを追加して拡張

⭐ Star をお願いします!

このプロジェクトが役に立ったら、GitHubでスターをつけていただけると嬉しいです!


質問や問題がある場合は、Issuesで報告してください。

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.