AWS S3 Tables MCP Server
The `awslabs-s3-tables-mcp-server` is an AWS Labs Model Context Protocol (MCP) server that enables AI assistants to interact with Amazon S3 Tables using natural language. It simplifies the management of S3-based tables by providing capabilities to create and query tables, generate tables directly from CSV files uploaded to S3, and access metadata through the S3 Metadata Table. The current version is 0.0.22, and it is part of the broader AWS Model Context Protocol ecosystem, with updates typically aligned with AWS service enhancements and MCP specification changes.
Warnings
- breaking By default, the S3 Tables MCP server operates in read-only mode. To enable write access (create or append operations on S3 Tables), you must explicitly configure the MCP server with the necessary AWS IAM permissions and use the `--allow-write` flag when starting the server.
- gotcha Users are solely responsible for the actions and permissions of agents using the MCP server. Misconfigured permissions or unverified agent actions may result in data loss, failed operations, or unexpected LLM behavior.
- gotcha The Daft engine, utilized by the S3 Tables MCP Server for querying, has strict data type handling. This can lead to failures on numeric operations if real-world datasets have attributes stored as strings that are expected to be numeric.
- gotcha The MCP Server for S3 Tables provides a limited set of tools for managing S3 Tables. Specifically, it does not support delete or update operations for table buckets and namespaces, and only supports create, rename, and list for individual tables (no general update or delete).
Install
-
pip install awslabs-s3-tables-mcp-server uv
Quickstart
import subprocess
import os
import json
# NOTE: Ensure AWS credentials are configured (e.g., via `aws configure` or environment variables).
# The server will pick them up from the environment.
# For example:
# os.environ['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID', 'YOUR_ACCESS_KEY')
# os.environ['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY', 'YOUR_SECRET_KEY')
# os.environ['AWS_REGION'] = os.environ.get('AWS_REGION', 'us-east-1')
# 1. Define a minimal mcp_config.json content.
# This configuration tells an MCP client how to start the S3 Tables MCP server.
# In a real scenario, this file would be loaded by an AI client.
# For demonstration, we simulate running the command directly.
mcp_config_content = {
"mcpServers": {
"awslabs.s3-tables-mcp-server": {
"command": "uvx awslabs.s3-tables-mcp-server --profile default --region us-east-1",
"description": "MCP Server for Amazon S3 Tables",
"schemas": ["file://~/.config/mcp/awslabs.s3-tables-mcp-server.json"]
}
}
}
# 2. To run the server directly, you would typically execute a command.
# This example shows how an AI client might configure and run it.
# For local testing, ensure 'uv' is installed (`pip install uv`).
print("Attempting to run awslabs.s3-tables-mcp-server...")
print("This server typically runs in a long-lived process and interacts with AI clients via stdio.")
print("Press Ctrl+C to stop the server if it starts successfully.")
# Example of how an MCP client would launch the server process
try:
# The actual command might vary based on your AWS profile and region.
# Using --allow-write is generally not recommended for quickstart without understanding implications.
command_to_run = [
"uvx",
"awslabs.s3-tables-mcp-server",
"--profile", os.environ.get('AWS_PROFILE', 'default'), # Use 'default' or actual profile
"--region", os.environ.get('AWS_REGION', 'us-east-1'), # Use 'us-east-1' or actual region
# Add --allow-write if you intend to enable write operations, but be cautious!
# "--allow-write"
]
# Starting the server in a non-blocking way for demonstration.
# In a real setup, this would be managed by the AI client application.
process = subprocess.Popen(command_to_run, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
print("Server process started (PID: {})".format(process.pid))
print("Output (first few lines, server runs indefinitely):")
# Read some output to confirm it's running, then terminate for quickstart.
# In a real scenario, the process would continue running and communicate via stdio.
for _ in range(5):
line = process.stdout.readline()
if line:
print(line.strip())
else:
break
# For a quickstart, we often don't want a blocking server.
# You would typically interact with this server via an AI client (e.g., Kiro, Cline).
# For this example, we'll terminate it after a short period.
print("\n--- Server started. Terminating quickstart process. ---")
print("To interact, connect an AI client configured with this server.")
process.terminate()
process.wait(timeout=5)
except FileNotFoundError:
print("Error: 'uvx' command not found. Please ensure 'uv' is installed and in your PATH.")
except Exception as e:
print(f"An error occurred: {e}")