by aws-samples
The sample-mcp-server-s3 is an example implementation of a Model Context Protocol (MCP) server designed to retrieve data, specifically PDF documents, from AWS S3. It enables large language models (LLMs) to access and utilize information stored in S3 buckets.
sample-mcp-server-s3 is a sample Model Context Protocol (MCP) server implementation designed to retrieve data, specifically PDF documents, from AWS S3. It allows Large Language Models (LLMs) to access and utilize information stored in S3 buckets.
To use sample-mcp-server-s3, you need to configure AWS credentials with appropriate S3 read/write permissions. The server can then be integrated with applications like Claude Desktop by modifying its configuration file to include the MCP server details. For development and debugging, tools like uv
and npm
with the MCP Inspector can be used.
ListBuckets
: Returns a list of all buckets owned by the authenticated sender.ListObjectsV2
: Returns up to 1,000 objects from a specified bucket.GetObject
: Retrieves a specific object from S3 using its key name.Resources
feature is limited to 1000 objects.Default
profile.npm
, is recommended for debugging.An MCP server implementation for retrieving data such as PDF's from S3.
Expose AWS S3 Data through Resources. (think of these sort of like GET endpoints; they are used to load information into the LLM's context). Currently only PDF documents supported and limited to 1000 objects.
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"s3-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/Users/user/generative_ai/model_context_protocol/s3-mcp-server",
"run",
"s3-mcp-server"
]
}
}
}
{
"mcpServers": {
"s3-mcp-server": {
"command": "uvx",
"args": [
"s3-mcp-server"
]
}
}
}
To prepare the package for distribution:
uv sync
uv build
This will create source and wheel distributions in the dist/
directory.
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
--token
or UV_PUBLISH_TOKEN
--username
/UV_PUBLISH_USERNAME
and --password
/UV_PUBLISH_PASSWORD
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
npx @modelcontextprotocol/inspector uv --directory /Users/user/generative_ai/model_context_protocol/s3-mcp-server run s3-mcp-server
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.
Reviews feature coming soon
Stay tuned for community discussions and feedback