t

ts-mcp-fargate-ecs-starter

@mfang0126/ts-mcp-fargate-ecs-starter
0 Stars 168 次浏览 mfang0126 更新于 2026-08-23

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "hello-mcp": {
      "args": [
        "tsx",
        "/Users/mingfang/Code/hello-mcp/index.ts"
      ],
      "command": "npx"
    },
    "hello-mcp-lambda": {
      "headers": {
        "Authorization": "Bearer mcp-secret-token-12345"
      },
      "transport": "http",
      "url": "https://gjt4ggcz76.execute-api.ap-southeast-2.amazonaws.com/mcp"
    }
  }
}

服务介绍

Hello MCP Server

Simple MCP (Model Context Protocol) server with AWS Lambda deployment.

Quick Start

Local Development

npm install
npm run dev

Connect to Claude Desktop by adding to config:

{
  "mcpServers": {
    "hello-mcp": {
      "command": "npx",
      "args": ["tsx", "/Users/mingfang/Code/hello-mcp/index.ts"]
    }
  }
}

Deploy to AWS Lambda

# Build and deploy
npm run deploy

# Or step by step
npm run build:lambda
sam deploy --guided

First time setup:

  • Stack Name: hello-mcp-stack
  • Region: ap-southeast-2
  • Bearer Token: mcp-secret-token-12345
  • Confirm all: Y

Authentication

Bearer token: mcp-secret-token-12345

Change it:

sam deploy --parameter-overrides BearerToken="your-new-token"

Test Deployment

# Health check
curl https://gjt4ggcz76.execute-api.ap-southeast-2.amazonaws.com/health

# List available tools
curl -H "Authorization: Bearer mcp-secret-token-12345" \
  https://gjt4ggcz76.execute-api.ap-southeast-2.amazonaws.com/mcp

# Call sayHello tool
curl -X POST \
  -H "Authorization: Bearer mcp-secret-token-12345" \
  -H "Content-Type: application/json" \
  -d '{"tool": "sayHello", "params": {"name": "World"}}' \
  https://gjt4ggcz76.execute-api.ap-southeast-2.amazonaws.com/mcp

Connect Claude to Lambda

Edit: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "hello-mcp-lambda": {
      "url": "https://gjt4ggcz76.execute-api.ap-southeast-2.amazonaws.com/mcp",
      "transport": "http",
      "headers": {
        "Authorization": "Bearer mcp-secret-token-12345"
      }
    }
  }
}

Important: Use "transport": "http" for Lambda.

Tools

  • sayHello - Greet someone by name

Deployment Record

Stack Name: hello-mcp-stack
Region: ap-southeast-2
Deployed: 2025-10-17
Status: Tested and working

Outputs:

  • API URL: https://gjt4ggcz76.execute-api.ap-southeast-2.amazonaws.com/
  • Lambda ARN: arn:aws:lambda:ap-southeast-2:670326884047:function:hello-mcp-server
  • Authentication: Bearer token with 'http' transport

Test Results:

#  Health check working
#  Tool listing: ["sayHello"]
#  sayHello execution: "Hello, AWS Lambda! "

Project Structure

hello-mcp/
 index.ts          # Local development (stdio)
 lambda.ts         # AWS Lambda handler
 template.yaml     # AWS SAM template
 samconfig.toml    # SAM configuration
 package.json      # Dependencies
 tsconfig.json     # TypeScript config

Cost

Lambda free tier: 1M requests/month
Expected cost: $0-5/month

Learn More

相关 MCP 服务