Sample S3 Model Context Protocol Server
Overview
What is Sample MCP Server S3?
The ### Sample MCP Server S3 is a public repository hosted on GitHub under the organization ### aws-samples. This project serves as a demonstration of how to implement a server that interacts with Amazon S3 (Simple Storage Service), showcasing best practices and providing sample code for developers looking to integrate S3 into their applications. The repository includes various resources, including code snippets, documentation, and examples that help users understand how to effectively use S3 for storage solutions.
Features of Sample MCP Server S3
- Integration with Amazon S3: The project provides a seamless way to connect and interact with S3, allowing users to upload, download, and manage files effortlessly.
- Public Access: Being a public repository, it allows developers to access the code, contribute, and learn from the examples provided.
- Documentation: Comprehensive documentation is included to guide users through the setup and usage of the server.
- Community Support: As part of the AWS samples, it benefits from community contributions and feedback, enhancing its functionality and usability.
- Open Source: The project is open-source, allowing developers to modify and adapt the code to fit their specific needs.
How to Use Sample MCP Server S3
-
Clone the Repository: Start by cloning the repository to your local machine using the command:
git clone https://github.com/aws-samples/sample-mcp-server-s3.git
-
Set Up AWS Credentials: Ensure you have your AWS credentials configured. This can be done by setting up the AWS CLI or by providing credentials in the application configuration.
-
Install Dependencies: Navigate to the project directory and install any required dependencies. This typically involves running:
npm install
-
Run the Server: Start the server using the command:
npm start
-
Access the Application: Once the server is running, you can access the application through your web browser or API client to interact with S3.
-
Explore the Code: Review the provided examples and documentation to understand how to implement various features and functionalities.
Frequently Asked Questions
What is Amazon S3?
Amazon S3 (Simple Storage Service) is a scalable object storage service offered by AWS that allows users to store and retrieve any amount of data from anywhere on the web. It is widely used for backup, archiving, and data storage for web applications.
Is the Sample MCP Server S3 free to use?
Yes, the Sample MCP Server S3 is an open-source project and is free to use. However, you may incur costs associated with using AWS services like S3 depending on your usage.
Can I contribute to the Sample MCP Server S3?
Absolutely! Contributions are welcome. You can fork the repository, make your changes, and submit a pull request for review.
Where can I find more information about AWS S3?
You can find more information about AWS S3 on the official AWS documentation. This includes detailed guides, API references, and best practices for using S3 effectively.
Details
Sample S3 Model Context Protocol Server
An MCP server implementation for retrieving data such as PDF's from S3.
Features
Resources
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.
Tools
- ListBuckets
- Returns a list of all buckets owned by the authenticated sender of the request
- ListObjectsV2
- Returns some or all (up to 1,000) of the objects in a bucket with each request
- GetObject
- Retrieves an object from Amazon S3. In the GetObject request, specify the full key name for the object. General purpose buckets - Both the virtual-hosted-style requests and the path-style requests are supported
Configuration
Setting up AWS Credentials
- Obtain AWS access key ID, secret access key, and region from the AWS Management Console and configure credentials files using Default profile as shown here
- Ensure these credentials have appropriate permission READ/WRITE permissions for S3.
Usage with Claude Desktop
Claude Desktop
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"
]
}
}
}
</details>
<details>
<summary>Published Servers Configuration</summary>
{
"mcpServers": {
"s3-mcp-server": {
"command": "uvx",
"args": [
"s3-mcp-server"
]
}
}
}
</details>
Development
Building and Publishing
To prepare the package for distribution:
- Sync dependencies and update lockfile:
uv sync
- Build package distributions:
uv build
This will create source and wheel distributions in the dist/
directory.
- Publish to PyPI:
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token:
--token
orUV_PUBLISH_TOKEN
- Or username/password:
--username
/UV_PUBLISH_USERNAME
and--password
/UV_PUBLISH_PASSWORD
Debugging
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.
Security
See CONTRIBUTING for more information.
License
This library is licensed under the MIT-0 License. See the LICENSE file.
Server Config
{
"mcpServers": {
"sample-mcp-server-s-3": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--aws-samples--sample-mcp-server-s3--sample-mcp-server-s-3",
"s3-mcp-server"
],
"env": {}
}
}
}