• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
c15r

c15r

ContextualLite

Public
Like
ContextualLite
Home
Code
12
README.md
claude-desktop-config.json
deploy.ts
example.env
H
index.ts
mcp-config.json
mcp-http-client.js
package.json
test-http.ts
test.ts
tools.ts
types.ts
Branches
2
Pull requests
Remixes
History
Environment variables
7
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
6/10/2025
Viewing readonly version of main branch: v25
View latest version
README.md

Remote HTTP AWS MCP Server

A remote HTTP Model Context Protocol (MCP) server that provides access to AWS services including DynamoDB and S3. This server exposes prompts, resources, and tools via HTTP endpoints with bearer token authentication.

Features

HTTP Endpoints

  • GET /: Server information and capabilities
  • GET /health: Health check endpoint
  • GET /mcp/prompts: List available prompts
  • POST /mcp/prompts/:name: Get specific prompt content
  • GET /mcp/resources: List S3 resources (requires auth)
  • GET /mcp/resources/*: Read specific S3 resource (requires auth)
  • GET /mcp/tools: List available tools
  • POST /mcp/tools/:name: Execute specific tool (requires auth)

Authentication

  • Uses Bearer token authentication
  • AWS_SECRET_ACCESS_KEY is passed via Authorization: Bearer <secret_key> header
  • Other AWS credentials are configured via environment variables

Prompts

  • analyze-data: Analyze data from DynamoDB and S3 resources
  • data-summary: Generate a summary of available data sources

Resources

  • S3 Objects: Access and read objects from your S3 bucket
  • Automatic MIME type detection
  • Object metadata (size, last modified)

Tools

DynamoDB Operations

  • dynamodb-get: Get an item by key
  • dynamodb-put: Store an item
  • dynamodb-delete: Delete an item by key
  • dynamodb-query: Query items with conditions

S3 Operations

  • s3-get: Download object content
  • s3-put: Upload object content
  • s3-delete: Delete an object
  • s3-move: Move/rename an object

Setup

Environment Variables

Set the following environment variables on your Val Town:

AWS_REGION=us-east-1 AWS_ACCESS_KEY_ID=your-access-key-id S3_BUCKET=your-bucket-name DYNAMODB_TABLE=your-table-name MCP_SERVER_NAME=aws-mcp-server MCP_SERVER_VERSION=1.0.0

Note: AWS_SECRET_ACCESS_KEY is NOT set as an environment variable. Instead, it's passed via the Authorization header for security.

Deployment

  1. Deploy to Val Town as an HTTP val
  2. Set the required environment variables
  3. The server will be available at your Val Town URL

Usage Examples

Authentication

All authenticated endpoints require the Authorization header:

Authorization: Bearer your-aws-secret-access-key

Server Information

curl https://your-val-town-url.web.val.run/

List Prompts

curl https://your-val-town-url.web.val.run/mcp/prompts

Get Prompt Content

curl -X POST https://your-val-town-url.web.val.run/mcp/prompts/analyze-data \ -H "Content-Type: application/json" \ -d '{"table_key": "user123", "s3_key": "data/analytics.json"}'

List Resources (S3 Objects)

curl https://your-val-town-url.web.val.run/mcp/resources \ -H "Authorization: Bearer your-aws-secret-access-key"

Read S3 Resource

curl "https://your-val-town-url.web.val.run/mcp/resources/s3://your-bucket/path/to/file.txt" \ -H "Authorization: Bearer your-aws-secret-access-key"

List Tools

curl https://your-val-town-url.web.val.run/mcp/tools

Execute DynamoDB Operations

# Get an item curl -X POST https://your-val-town-url.web.val.run/mcp/tools/dynamodb-get \ -H "Authorization: Bearer your-aws-secret-access-key" \ -H "Content-Type: application/json" \ -d '{"key": {"id": "user123"}}' # Put an item curl -X POST https://your-val-town-url.web.val.run/mcp/tools/dynamodb-put \ -H "Authorization: Bearer your-aws-secret-access-key" \ -H "Content-Type: application/json" \ -d '{"item": {"id": "user123", "name": "John Doe", "email": "john@example.com"}}' # Query items curl -X POST https://your-val-town-url.web.val.run/mcp/tools/dynamodb-query \ -H "Authorization: Bearer your-aws-secret-access-key" \ -H "Content-Type: application/json" \ -d '{"keyConditionExpression": "id = :id", "expressionAttributeValues": {":id": "user123"}}' # Delete an item curl -X POST https://your-val-town-url.web.val.run/mcp/tools/dynamodb-delete \ -H "Authorization: Bearer your-aws-secret-access-key" \ -H "Content-Type: application/json" \ -d '{"key": {"id": "user123"}}'

Execute S3 Operations

# Get object content curl -X POST https://your-val-town-url.web.val.run/mcp/tools/s3-get \ -H "Authorization: Bearer your-aws-secret-access-key" \ -H "Content-Type: application/json" \ -d '{"key": "documents/report.txt"}' # Upload content curl -X POST https://your-val-town-url.web.val.run/mcp/tools/s3-put \ -H "Authorization: Bearer your-aws-secret-access-key" \ -H "Content-Type: application/json" \ -d '{"key": "documents/new-file.txt", "content": "Hello, World!", "contentType": "text/plain"}' # Move/rename object curl -X POST https://your-val-town-url.web.val.run/mcp/tools/s3-move \ -H "Authorization: Bearer your-aws-secret-access-key" \ -H "Content-Type: application/json" \ -d '{"sourceKey": "old-location/file.txt", "destinationKey": "new-location/file.txt"}' # Delete object curl -X POST https://your-val-town-url.web.val.run/mcp/tools/s3-delete \ -H "Authorization: Bearer your-aws-secret-access-key" \ -H "Content-Type: application/json" \ -d '{"key": "documents/old-file.txt"}'

MCP Client Integration

To integrate with MCP clients like Claude Desktop, you can create a client that makes HTTP requests to these endpoints. Here's an example configuration:

{ "mcpServers": { "aws-http-mcp-server": { "command": "node", "args": ["mcp-http-client.js"], "env": { "MCP_SERVER_URL": "https://your-val-town-url.web.val.run", "AWS_SECRET_ACCESS_KEY": "${AWS_SECRET_ACCESS_KEY}" } } } }

Security Considerations

  • Bearer Token Authentication: AWS_SECRET_ACCESS_KEY is passed via Authorization header, not stored in environment variables
  • HTTPS Only: Always use HTTPS in production to protect the bearer token
  • IAM Permissions: Use IAM roles with minimal required permissions
  • Token Rotation: Regularly rotate your AWS secret access keys
  • Rate Limiting: Consider implementing rate limiting for production use

Required AWS Permissions

S3 Permissions

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:DeleteObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::your-bucket-name", "arn:aws:s3:::your-bucket-name/*" ] } ] }

DynamoDB Permissions

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "dynamodb:GetItem", "dynamodb:PutItem", "dynamodb:DeleteItem", "dynamodb:Query", "dynamodb:Scan" ], "Resource": "arn:aws:dynamodb:region:account:table/your-table-name" } ] }

Error Handling

The server includes comprehensive error handling for:

  • Missing or invalid Authorization headers
  • AWS service errors
  • Invalid parameters
  • Network connectivity issues

All errors are properly formatted and returned as JSON with appropriate HTTP status codes:

  • 401: Authentication errors
  • 400: Bad request (invalid parameters)
  • 404: Resource or tool not found
  • 500: Server errors (AWS service errors, etc.)

API Response Format

Success Response

{ "content": [ { "type": "text", "text": "Response content here" } ] }

Error Response

{ "error": "Error message description" }

Health Check

The server provides a health check endpoint:

curl https://your-val-town-url.web.val.run/health

Response:

{ "status": "healthy", "timestamp": "2024-01-01T00:00:00.000Z" }
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.