briete/remote-mcp-server-sample
3.2
If you are the rightful owner of remote-mcp-server-sample and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This document provides a comprehensive guide to setting up and deploying a Remote MCP Server using Deno, Docker, and AWS.
Tools
coin_flip
Simulates a coin flip and returns either heads or tails.
Remote MCP Server Sample
リモートMCPサーバーの実装例です。
必要な環境
- Deno 1.x
- Docker (デプロイ時)
- AWS CLI (AWS デプロイ時)
セットアップ
環境変数
以下の環境変数を設定してください:
USERNAME=your-username
PASSWORD=your-password
PORT=8080 # オプション、デフォルトは8080
ローカル開発
# 依存関係のインストール・実行
deno task start
# 開発モード(ファイル変更時に自動再起動)
deno task dev
# リンターの実行
deno task lint
# フォーマッターの実行
deno task fmt
# 型チェック
deno task check
使用方法
サーバーが起動すると、以下のエンドポイントが利用可能になります:
POST http://localhost:8080/mcp
Basic認証を使用してアクセスしてください。
利用可能なツール
- coin_flip: コインを投げて表(heads)か裏(tails)を返します
デプロイ
DockerイメージをECRにデプロイ
# ECRにプッシュ
deno task deploy:docker
AWS CDKでのデプロイ
deno task cdk:deploy
プロジェクト構造
├── src/
│ ├── index.ts # Express サーバーとMCPエンドポイント
│ └── server.ts # MCPサーバーの実装
├── cdk/
│ ├── app.ts # CDK アプリケーション
│ └── stack.ts # AWS インフラストラクチャ定義
├── Dockerfile # Dockerイメージ定義
├── deploy.sh # ECR デプロイスクリプト
├── deno.json # Deno 設定とタスク定義
└── README.md