README.mdโข2.92 kB
# Hello MCP Server
Simple MCP (Model Context Protocol) server with AWS Lambda deployment.
## ๐ Quick Start
### Local Development
```bash
npm install
npm run dev
```
Connect to Claude Desktop by adding to config:
```json
{
"mcpServers": {
"hello-mcp": {
"command": "npx",
"args": ["tsx", "/Users/mingfang/Code/hello-mcp/index.ts"]
}
}
}
```
### Deploy to AWS Lambda
```bash
# 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:
```bash
sam deploy --parameter-overrides BearerToken="your-new-token"
```
## ๐งช Test Deployment
```bash
# 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`
```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:**
```bash
# โ
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
- [FastMCP](https://github.com/punkpeye/fastmcp)
- [MCP Protocol](https://modelcontextprotocol.io/)
- [AWS Lambda](https://docs.aws.amazon.com/lambda/)