ZackFairTS/aos-mcp-serverless
If you are the rightful owner of aos-mcp-serverless 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.
The AOS MCP Server is a Lambda-based Model Context Protocol server designed for Amazon OpenSearch Service, offering vector search and knowledge base management capabilities.
AOS MCP Server (Amazon OpenSearch Model Context Protocol)
This project is a Lambda-based MCP (Model Context Protocol) server designed for Amazon OpenSearch Service, supporting vector search and knowledge base management capabilities. The server can be deployed in AWS China regions and integrates with embedding services available in China regions.
Key Features
- Based on AWS Serverless architecture using Lambda and API Gateway
- Supports text-to-vector embedding conversion
- Provides vector similarity search functionality
- Integrates with Amazon OpenSearch Service
- Supports session management and authentication
Technology Stack
- Python 3.12
- AWS Serverless Application Model (SAM)
- AWS Lambda
- Amazon API Gateway
- Amazon DynamoDB
- Amazon OpenSearch Service
- Silicon Flow Embedding API (China region)
Project Structure
.
āāā app.py # Main application entry point
āāā template.yaml # SAM template
āāā requirements.txt # Python dependencies
āāā lambda_mcp/ # MCP server core code
āāā authorizer/ # API authentication handler
āāā common/ # Shared components and utilities
Installation and Deployment
Prerequisites
- AWS CLI installed and configured
- AWS SAM CLI installed
- Valid AWS account (China region)
- Amazon OpenSearch Service cluster created
- Silicon Flow API token
Deployment Steps
- Clone the repository
git clone <repository-url>
- Build the project
sam build
- Deploy the project
sam deploy --profile cn
Or with parameter overrides:
sam deploy --profile cn --parameter-overrides \
"McpAuthToken=your-auth-token" \
"OpenSearchHost=your-opensearch-endpoint" \
"OpenSearchUsername=your-username" \
"OpenSearchPassword=your-password" \
"EmbeddingApiToken=your-embedding-api-token"
Usage
After deployment, you will receive an API Gateway endpoint URL. You can use this URL to interact with the MCP server.
Searching Similar Documents
export API_ENDPOINT=https://xxxxx/Prod/mcp
export AUTH_TOKEN=xxxx
python strands_agent_test/similarity_search_demo.py
Configuration Parameters
Parameter Name | Description | Default Value |
---|---|---|
McpAuthToken | Authentication token for the MCP server | - |
OpenSearchHost | OpenSearch cluster endpoint | - |
OpenSearchPort | OpenSearch port | 443 |
OpenSearchIndex | OpenSearch index name | dockb-index |
OpenSearchUsername | OpenSearch username | - |
OpenSearchPassword | OpenSearch password | - |
EmbeddingApiToken | API token for embedding service | - |
China Region Specific Notes
- The project is optimized for AWS China regions
- Uses the China region Silicon Flow API endpoint (
https://api.siliconflow.cn/v1/embeddings
) - Default model for text embedding is
Pro/BAAI/bge-m3
Security Considerations
- Sensitive credentials are passed through environment variables
- API authentication uses a token mechanism
- AWS Secrets Manager is recommended for managing sensitive information in production environments