Skip to main content
Glama
sourav-spd

aws-s3-connector-mcp

by sourav-spd

AWS S3 Connector MCP Server

A production-ready Model Context Protocol (MCP) server for AWS S3 operations.

Provides 4 practical tools for connecting to S3, listing objects, uploading files, and reading file contents — supporting public buckets (no credentials) and private buckets (AWS credentials).

Supports three transport modes: stdio, SSE, and Streamable HTTP.


Folder Structure

aws-s3-connector-tool-updated/
|-- aws_s3_server.py       # Main server entry point
|-- Dockerfile
|-- LICENSE
|-- mcp.example.json
|-- pyproject.toml
|-- README.md
`-- tools/
    |-- __init__.py
    |-- s3_connector_tools.py
    `-- toolhandler.py

Related MCP server: AWS Security MCP Server

Available Tools (4)

Tool

Description

connect_s3

Connect to an S3 bucket via public URL or AWS credentials

list_objects

List all objects in the connected bucket with filenames and links

upload_object

Upload a file from a local path or internet URL to S3

read_object

Read file contents from S3 (CSV, JSON, Excel, PDF, Parquet, images, text)


Tools Reference

1. connect_s3

Connect to an S3 bucket. Call this first before using other tools.

Parameters:

Parameter

Required

Description

s3_url

Yes (if no credentials)

Public S3 URL, e.g. https://my-bucket.s3.amazonaws.com or s3://my-bucket

bucket_url

Alias

Alias of s3_url (supported for compatibility)

aws_access_key_id

No

AWS access key (for private buckets)

aws_secret_access_key

No

AWS secret key (for private buckets)

region_name

No

AWS region (default: auto-detected or us-east-1)

region

Alias

Alias of region_name (supported for compatibility)

Example — public bucket:

{
  "s3_url": "https://my-public-bucket.s3.amazonaws.com"
}

Example — private bucket:

{
  "aws_access_key_id": "<access-key>",
  "aws_secret_access_key": "<secret-key>",
  "s3_url": "s3://my-private-bucket",
  "region_name": "us-east-1"
}

Returns:

{
  "status": "connected",
  "bucket": "my-bucket",
  "region": "us-east-1",
  "mode": "public"
}

2. list_objects

List all objects in the connected S3 bucket with filenames and presigned/public links.

Parameters: none (uses connection from connect_s3)

Example:

{}

Returns:

{
  "status": "success",
  "bucket": "my-bucket",
  "count": 3,
  "objects": [
    {
      "key": "data/report.csv",
      "size": 4096,
      "last_modified": "2026-06-01T10:00:00Z",
      "url": "https://my-bucket.s3.amazonaws.com/data/report.csv?..."
    }
  ]
}

3. upload_object

Upload a file to the connected S3 bucket from a local path or a URL.

Parameters:

Parameter

Required

Description

object_key

Yes

Destination S3 key (path in bucket), e.g. uploads/file.csv

key

Alias

Alias of object_key (supported for compatibility)

local_file_path

No*

Absolute local file path

local_path

Alias

Alias of local_file_path (supported for compatibility)

source_url

No*

Internet URL to download and upload

*One of local_path or source_url is required.

Example — local file:

{
  "object_key": "uploads/report.csv",
  "local_file_path": "C:/Users/me/Downloads/report.csv"
}

Example — from URL:

{
  "object_key": "uploads/data.json",
  "source_url": "https://example.com/data.json"
}

Returns:

{
  "status": "success",
  "object_key": "uploads/report.csv",
  "bucket": "my-bucket",
  "message": "Uploaded successfully"
}

4. read_object

Read and return the contents of a file stored in S3. Supports multiple file formats.

Parameters:

Parameter

Required

Description

object_key

Yes

S3 object key to read

key

Alias

Alias of object_key (supported for compatibility)

Supported formats:

Format

Extensions

Output

Text / CSV / JSON

.txt, .csv, .json, .md, .log, .xml, .html, .yaml, .yml

Raw text

Excel

.xlsx, .xls

JSON rows per sheet

Parquet

.parquet

JSON rows

PDF

.pdf

Extracted text

Images

.png, .jpg, .jpeg, .gif, .webp

Base64-encoded data URL

Other

any

Base64-encoded content

Example:

{
  "object_key": "data/report.csv"
}

Returns:

{
  "status": "success",
  "object_key": "data/report.csv",
  "format": "text",
  "content": "id,name,value\n1,Alice,100\n2,Bob,200\n"
}

Prerequisites

  • Python 3.10+

  • AWS credentials (only for private buckets)


Installation

# From the workspace root (where .venv lives)
.venv\Scripts\activate          # Windows
# source .venv/bin/activate     # macOS / Linux

cd aws-s3-connector-tool-updated
pip install -e .

Run

stdio (default — for MCP desktop clients like Claude Desktop)

aws-s3-connector-mcp --mode stdio

SSE

aws-s3-connector-mcp --mode sse --host 0.0.0.0 --port 8000

Endpoints:

  • GET /sse

  • POST /messages (also supports /messages/)

  • GET /health

Streamable HTTP

aws-s3-connector-mcp --mode streamable-http --host 0.0.0.0 --port 8000

Endpoints:

  • POST /mcp

  • GET /health

  • GET /

Environment variables (alternative to CLI flags)

Variable

Default

Description

TRANSPORT_TYPE

stdio

stdio / sse / streamable-http

APP_HOST

0.0.0.0

Bind host

APP_PORT

8000

Bind port


Docker

# Build
docker build -t aws-s3-connector-mcp .

# Run (streamable-http, port 8000)
docker run -p 8000:8000 \
  -e AWS_ACCESS_KEY_ID=<your-key> \
  -e AWS_SECRET_ACCESS_KEY=<your-secret> \
  aws-s3-connector-mcp

MCP Client Configuration

See mcp.example.json for a ready-to-use client config snippet.

stdio (Claude Desktop / Cursor):

{
  "mcpServers": {
    "aws-s3-connector": {
      "command": "aws-s3-connector-mcp",
      "args": ["--mode", "stdio"],
      "env": {
        "AWS_ACCESS_KEY_ID": "AKIA...",
        "AWS_SECRET_ACCESS_KEY": "your-secret-key",
        "AWS_REGION": "ap-south-1",
        "S3_BUCKET": "customer-kyc-demo"
      }
    }
  }
}

With this env format, you can run connect_s3 with empty arguments:

{}

Streamable HTTP (MCP Inspector / MCPmon):

http://localhost:8000/mcp

For SSE in MCP Inspector, use:

http://127.0.0.1:8000/sse

Avoid 0.0.0.0 in the inspector URL.


Architecture

MCP Client (Claude / Cursor / MCP Inspector)
    |
    | JSON-RPC 2.0
    v
Transport Layer (stdio | SSE | Streamable HTTP)   ← aws_s3_server.py
    |
    v
ToolHandler Registry (4 tools)
    |
    v
S3 Tool Handlers                                  ← tools/s3_connector_tools.py
    |
    v
boto3  ──►  AWS S3 API

Troubleshooting

NoCredentialsError — Pass credentials via connect_s3 or set AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY env vars.

NoSuchBucket — Verify the bucket name and region in connect_s3.

connect_s3 not called — Always call connect_s3 before list_objects, upload_object, or read_object.

Port already in use — Change APP_PORT env var or use --port flag.


License

MIT License — see LICENSE for details.

Available Tools

4 tools
connect_s3A

Connect to an AWS S3 bucket. Supports two modes:

  1. Credentials mode (private buckets): provide aws_access_key_id + aws_secret_access_key + region_name.

  2. Public mode (no credentials): provide s3_url only — region is auto-detected from the URL. Accepted s3_url formats: s3://bucket-name, https://bucket.s3.amazonaws.com, https://bucket.s3.REGION.amazonaws.com.

ParametersJSON Schema
NameRequiredDescriptionDefault
s3_urlYesS3 bucket URL (e.g. s3://my-bucket or https://my-bucket.s3.us-east-1.amazonaws.com)
region_nameNoAWS region (e.g. us-east-1). Auto-detected from s3_url if not provided.
aws_access_key_idNoAWS Access Key ID (required for private buckets)
aws_session_tokenNoAWS Session Token for temporary credentials (optional)
aws_secret_access_keyNoAWS Secret Access Key (required for private buckets)

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It discloses connection modes, credential requirements, and region auto-detection, but does not mention side effects (e.g., session creation, network requirements) or whether the connection is persistent. Adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, using two sentences and bullet points. It is front-loaded with the main purpose and every sentence adds value. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters, two modes, and no output schema, the description covers the accepted URL formats, mode conditions, and auto-detection. It is sufficient for an agent to understand how to invoke the tool correctly, though return value behavior is omitted.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds extra meaning by explaining the two modes and how parameters relate (e.g., region auto-detected, credentials required for private), adding value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool connects to an AWS S3 bucket and distinguishes two modes (credentials vs public). It is specific about the resource (S3 bucket) and the verb (connect), and it differentiates from sibling tools which are object operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use each mode: credentials for private buckets, public mode for public buckets. It provides clear context on prerequisites and auto-detection, but does not explicitly state when not to use the tool or mention alternatives beyond siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_objectsA

List all objects in the connected S3 bucket. Returns each object's file name, size, last modified date, and a presigned URL. Optionally filter by prefix (folder path) or limit the number of results.

ParametersJSON Schema
NameRequiredDescriptionDefault
prefixNoFilter by prefix/folder path (e.g. 'data/' or 'reports/2026/').
bucket_nameNoOverride the connected bucket name (optional).
max_resultsNoMaximum number of objects to return (default: 100).

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description must disclose behavioral traits. It implies a prior connection ('connected S3 bucket') and is read-only, but does not explicitly state safety or any side effects. This is adequate but not thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no wasted words, front-loaded with action and result. Efficient and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, but description lists return fields. Lacks details on ordering, pagination beyond max_results, and root behavior. Sufficient for a simple list tool but could be more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (all parameters have descriptions). The description adds minimal extra context (e.g., 'folder path' for prefix). No significant added value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'List all objects in the connected S3 bucket' and specifies return fields (name, size, date, presigned URL). It is distinct from siblings like connect_s3, read_object, and upload_object.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While no explicit when-to-use or alternatives are mentioned, the purpose is clear. The context of sibling tools makes usage self-evident: use this to browse objects, not to connect, read a single object, or upload.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_objectA

Read and display the contents of an object in the connected S3 bucket. Supported formats:

  • Text: .txt, .csv, .json, .jsonl, .xml, .html, .md, .log, .yaml, .yml

  • Excel: .xlsx, .xls — returns all sheet data as tables

  • Parquet: .parquet — returns schema + first 50 rows

  • PDF: .pdf — extracts text from first 10 pages

  • Images: .png, .jpg, .jpeg, .gif, .webp — returns image content

  • Unknown/binary: returns file metadata only.

ParametersJSON Schema
NameRequiredDescriptionDefault
max_charsNoMax characters to return for text files (default: 10000).
object_keyYesThe S3 object key (path/filename) to read.
sheet_nameNoFor Excel: specific sheet name to read. Reads all sheets if not provided.
bucket_nameNoOverride the connected bucket name (optional).

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description provides good behavioral transparency: it explains format-specific behaviors (e.g., PDF first 10 pages, Parquet first 50 rows, unknown returns metadata). No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded with the purpose. It uses a bullet-like structure for formats, maximizing readability with minimal text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool without an output schema, the description adequately covers return behaviors per format. It could mention the overall return structure (e.g., JSON object) but is largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so parameters are already well-documented. The description adds no new semantic details beyond the format list, which is contextual rather than param-specific.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reads and displays object contents, and lists supported formats. It is distinct from siblings like list_objects and upload_object.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. The description focuses on format support rather than usage context or exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

upload_objectA

Upload a file to the connected S3 bucket. Two sources supported:

  1. Local file: provide local_file_path (absolute path on the server).

  2. Internet URL: provide source_url — file is downloaded then uploaded to S3. Optionally set object_key (S3 path/filename). Defaults to the source filename.

ParametersJSON Schema
NameRequiredDescriptionDefault
object_keyNoS3 key (path + filename) to store the file as. Defaults to source filename.
source_urlNoPublic URL of a file to download and upload to S3.
bucket_nameNoOverride the connected bucket name (optional).
local_file_pathNoAbsolute local path of the file to upload.

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses the two upload modes and default behavior for object_key. However, it does not mention mandatory behavior (e.g., exactly one source required), file size limits, overwrite policy, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is extremely concise with only two short sentences plus a bullet list. Every sentence adds unique value. No fluff, front-loaded with the main verb and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description provides adequate context for a file upload tool. It explains the two input modes, optional parameters, and default key selection. Minor gaps: no mention of return value or success signal, but the essential behavior is covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds context about default object_key and the two source scenarios, but does not go beyond the schema's parameter descriptions. No additional semantic value for parameters like bucket_name or what 'override' means.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states verb 'Upload a file' to a specific resource 'connected S3 bucket'. Distinguishes from sibling tools (list_objects, read_object, connect_s3) by focusing on writing. Two distinct source types (local file, internet URL) are explicitly listed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description explains when to use each source (local_file_path vs source_url) and mentions optional bucket_name override. It does not explicitly state when not to use this tool or when to alternate with siblings, but the purpose is clear enough for an agent to decide.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedconnect_s3
    • First observedlist_objects
    • First observedread_object
    • First observedupload_object

TDQS

A4.3/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a distinct purpose: connect to a bucket, list objects, read object contents, and upload files. There is no overlap in functionality.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case (connect_s3, list_objects, read_object, upload_object), making them predictable.

Tool Count5/5

With 4 tools covering core S3 operations (connect, list, read, upload), the count is well-scoped and avoids being too few or too many.

Completeness4/5

The tool surface covers key read and write operations, but is missing a delete operation, which is a minor gap. Overall, it supports common workflows.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers