sample-building s-with-rust
This project provides sample MCP servers that can be used with Amazon Q CLI or other MCP-compatible AI assistants
claude mcp add --transport stdio aws-samples-sample-building-mcp-servers-with-rust ./target/release/s3_server
How to use
This MCP server suite provides Rust-based MCP servers that extend an AI assistant with practical capabilities. The calculator server offers basic arithmetic operations, the RDS server interacts with Amazon RDS instances, the S3 server manages S3 buckets and objects, and the PostgreSQL server connects to PostgreSQL databases to run read-only queries and fetch schema information. To integrate with an MCP-compatible assistant (such as Amazon Q), configure each server in your MCP client (for example, the Amazon Q CLI) so that the client can dispatch requests to the appropriate server. Each server is started as a separate binary, allowing you to run only the services you need. When configuring the client, provide the binary path for each server along with any required connection strings or credentials in the corresponding arguments or environment settings.
How to install
Prerequisites:
- Rust and Cargo installed on your machine
- AWS credentials configured if you plan to interact with RDS or S3
- An MCP-compatible AI assistant to connect with (e.g., Amazon Q)
Installation steps:
-
Clone the repository: git clone <repository-url> cd mcp-sample
-
Build all server binaries (or build individually as needed): cargo build --release
or for individual servers:
cargo build --release --bin calculator_server cargo build --release --bin rds_server cargo build --release --bin s3_server cargo build --release --bin postgresql_server
-
Run the required server binaries locally (paths correspond to the release build): ./target/release/calculator_server ./target/release/rds_server ./target/release/s3_server ./target/release/postgresql_server "postgresql://username:password@hostname:port/database"
-
Optional: configure MCP integration (e.g., Amazon Q CLI) by adding entries similar to the following to your configuration: { "mcpServers": { "calculator": {"command": "./target/release/calculator_server", "args": []}, "s3": {"command": "./target/release/s3_server", "args": []}, "rds": {"command": "./target/release/rds_server", "args": []}, "postgres": {"command": "./target/release/postgresql_server", "args": ["postgresql://username:password@hostname:port/database"]} } }
Additional notes
Notes and tips:
- The PostgreSQL server is designed for read-only queries and can provide schema information; ensure your database credentials and network access are correctly configured.
- For AWS-related features (RDS and S3), ensure AWS credentials are available in your environment (e.g., AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION).
- When running multiple servers locally, be mindful of port conflicts and ensure each server binds to the appropriate address/port if applicable.
- Build and run in release mode for better performance in production-like scenarios.
- If you encounter permission issues running the binaries, make sure they are executable (chmod +x) on Unix-based systems.
Related MCP Servers
turbovault
MCP server that transforms your Obsidian vault into an intelligent knowledge system
mcp-loxone
An opinionated Model Context Protocol (MCP) server for controlling Loxone home automation systems.
oura
Oura Ring Model Controller Protocol (MCP).
ultrafast
High-performance, ergonomic Model Context Protocol (MCP) implementation in Rust
firecrawl -zed
Firecrawl MCP Server for Zed
promptz
MCP Server implementation for promptz.dev