loading…
Search for a command to run...
loading…
An MCP server that runs on AWS Lambda, enabling MCP clients like Claude Desktop to invoke tools such as weather forecasts via serverless infrastructure with OAu
An MCP server that runs on AWS Lambda, enabling MCP clients like Claude Desktop to invoke tools such as weather forecasts via serverless infrastructure with OAuth authentication.
AWS Lambda上で動作するModel Context Protocol (MCP) サーバーの実装です。このプロジェクトは、MCPサーバーをAWSのサーバーレス環境で実行し、Claude DesktopなどのMCPクライアントと連携できるようにします。
aws-mcp-lambda-server/
├── platform/ # AWS CDKインフラストラクチャとLambda関数
│ ├── bin/ # CDKアプリケーションエントリーポイント
│ ├── lib/ # CDKスタック定義
│ ├── lambda/ # Lambda関数のソースコード
│ │ ├── mcp-server/ # MCPサーバー実装
│ │ │ ├── tools/ # MCPツール(WeatherTool等)
│ │ │ ├── index.ts # Lambda関数エントリーポイント
│ │ │ ├── mcp-server.ts # MCPサーバー設定
│ │ │ └── server.ts # 開発用サーバー
│ │ ├── authorize.ts # OAuth認証処理
│ │ ├── token.ts # トークン管理
│ │ ├── revoke.ts # トークン無効化
│ │ ├── clients.ts # クライアント管理
│ │ └── utils.ts # ユーティリティ関数
│ └── package.json
├── example/ # サンプルクライアントアプリケーション
│ └── client/ # Next.jsベースのWebクライアント
│ ├── src/ # クライアントソースコード
│ └── package.json
├── .github/workflows/ # GitHub Actions CI/CD設定
│ ├── ci.yml # ビルド・テスト
│ ├── deploy.yml # AWS デプロイ
│ ├── codeql-analysis.yml # セキュリティ分析
│ └── auto-merge.yml # 自動マージ
└── package.json # ルートパッケージ設定
git clone https://github.com/poad/aws-mcp-lambda-server.git
cd aws-mcp-lambda-server
pnpm install
pnpm run build
cd platform
npx cdk deploy --all
CDKコンテキストで以下の設定が可能です:
# プロジェクト名の設定
npx cdk deploy -c project-name=my-mcp-server
# 認証の有効化
npx cdk deploy -c use-auth=true
# ドメインの設定
npx cdk deploy -c domain=my-domain
cd platform
pnpm run dev
pnpm run test
pnpm run lint
pnpm run lint-fix # 自動修正
新しいMCPツールを追加するには:
platform/lambda/mcp-server/tools/ に新しいツールファイルを作成platform/lambda/mcp-server/mcp-server.ts でツールを登録例:
// tools/MyTool.ts
interface MyToolInput {
message: string;
}
async function handler(args: MyToolInput): Promise<{
content: { type: 'text', text: string }[]
}> {
return {
content: [
{
type: 'text',
text: `処理結果: ${args.message}`,
},
],
};
}
export default handler;
// mcp-server.ts
import myTool from './tools/MyTool.js';
server.tool(
'my_tool',
'カスタムツールの説明',
{ message: z.string().describe('メッセージ') },
myTool,
);
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.json{
"mcpServers": {
"aws-mcp-lambda-server": {
"command": "node",
"args": ["/path/to/aws-mcp-lambda-server/platform/lambda/mcp-server/dist/index.js"]
}
}
}
example/client/ にNext.jsベースのWebクライアントが含まれています。
cd example/client
pnpm install
pnpm run dev
AWS Cognitoを使用したOAuth 2.0認証をサポートしています。
GitHub Actionsを使用した自動化:
MIT License
Kenji Saito
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)Run in your terminal:
claude mcp add aws-mcp-lambda-server -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.