An AWS Labs Model Context Protocol (MCP) server for Amazon Rekognition
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Amazon Rekognition MCP Server
A Model Context Protocol (MCP) server for Amazon Rekognition that enables AI assistants to analyze images using Amazon Rekognition's powerful computer vision capabilities.
Features
- Face Collection Management: Create and manage collections of faces
- Face Recognition: Index and search for faces in images
- Object and Scene Detection: Identify objects, scenes, and activities in images
- Content Moderation: Detect unsafe or inappropriate content
- Celebrity Recognition: Identify celebrities in images
- Face Comparison: Compare faces between images for similarity
- Text Detection: Extract text from images
Prerequisites
- Install
uvfrom Astral or the GitHub README - Install Python using
uv python install 3.10 - Set up AWS credentials with access to Amazon Rekognition
- You need an AWS account with Amazon Rekognition enabled
- Configure AWS credentials with
aws configureor environment variables - Ensure your IAM role/user has permissions to use Amazon Rekognition
Installation
Configure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit ~/.aws/amazonq/mcp.json):
{
"mcpServers": {
"awslabs.amazon-rekognition-mcp-server": {
"command": "uvx",
"args": ["awslabs.amazon-rekognition-mcp-server@latest"],
"env": {
"AWS_PROFILE": "your-aws-profile",
"AWS_REGION": "us-east-1",
"BASE_DIR": "/path/to/base/directory",
"FASTMCP_LOG_LEVEL": "ERROR"
},
"disabled": false,
"autoApprove": []
}
}
}
or docker after a successful docker build -t awslabs/amazon-rekognition-mcp-server .:
{
"mcpServers": {
"awslabs.amazon-rekognition-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"AWS_PROFILE",
"--env",
"AWS_REGION",
"--env",
"BASE_DIR",
"--env",
"FASTMCP_LOG_LEVEL",
"awslabs/amazon-rekognition-mcp-server:latest"
],
"env": {
"AWS_PROFILE": "your-aws-profile",
"AWS_REGION": "us-east-1",
"BASE_DIR": "/path/to/base/directory",
"FASTMCP_LOG_LEVEL": "ERROR"
},
"disabled": false,
"autoApprove": []
}
}
}
Environment Variables
AWS_PROFILE: AWS CLI profile to use for credentialsAWS_REGION: AWS region to use (default: us-east-1)BASE_DIR: Base directory for file operations (optional)FASTMCP_LOG_LEVEL: Logging level (ERROR, WARNING, INFO, DEBUG)
AWS Authentication
The server uses the AWS profile specified in the AWS_PROFILE environment variable. If not provided, it defaults to the default credential provider chain.
"env": {
"AWS_PROFILE": "your-aws-profile",
"AWS_REGION": "us-east-1"
}
Make sure the AWS profile has permissions to access Amazon Rekognition services. The MCP server creates a boto3 session using the specified profile to authenticate with AWS services.
Tools
list_collections
Returns a list of collection IDs in your account.
list_collections() -> dict
Returns a dictionary containing a list of collection IDs and face model versions.
index_faces
Detects faces in an image and adds them to the specified collection.
index_faces(collection_id: str, image_path: str) -> dict
Parameters:
collection_id: ID of the collection to add the face toimage_path: Path to the image file
Returns a dictionary containing information about the indexed faces.
search_faces_by_image
Searches for faces in a collection that match a supplied face.
search_faces_by_image(collection_id: str, image_path: str) -> dict
Parameters:
collection_id: ID of the collection to searchimage_path: Path to the image file
Returns a dictionary containing information about the matching faces.
detect_labels
Detects instances of real-world entities within an image.
detect_labels(image_path: str) -> dict
Parameters:
image_path: Path to the image file
Returns a dictionary containing detected labels and other metadata.
detect_moderation_labels
Detects unsafe content in an image.
detect_moderation_labels(image_path: str) -> dict
Parameters:
image_path: Path to the image file
Returns a dictionary containing detected moderation labels and other metadata.
recognize_celebrities
Recognizes celebrities in an image.
recognize_celebrities(image_path: str) -> dict
Parameters:
image_path: Path to the image file
Returns a dictionary containing recognized celebrities and other metadata.
compare_faces
Compares a face in the source input image with faces in the target input image.
compare_faces(source_image_path: str, target_image_path: str) -> dict
Parameters:
source_image_path: Path to the source image filetarget_image_path: Path to the target image file
Returns a dictionary containing information about the face matches.
detect_text
Detects text in an image.
detect_text(image_path: str) -> dict
Parameters:
image_path: Path to the image file
Returns a dictionary containing detected text elements and their metadata.
Example Usage
# List available face collections
collections = await list_collections()
# Index a face in a collection
indexed_face = await index_faces(
collection_id="my-collection",
image_path="/path/to/face.jpg"
)
# Search for a face in a collection
matches = await search_faces_by_image(
collection_id="my-collection",
image_path="/path/to/face.jpg"
)
# Detect labels in an image
labels = await detect_labels(
image_path="/path/to/image.jpg"
)
# Detect moderation labels in an image
moderation = await detect_moderation_labels(
image_path="/path/to/image.jpg"
)
# Recognize celebrities in an image
celebrities = await recognize_celebrities(
image_path="/path/to/celebrity.jpg"
)
# Compare faces between two images
comparison = await compare_faces(
source_image_path="/path/to/source.jpg",
target_image_path="/path/to/target.jpg"
)
# Detect text in an image
text = await detect_text(
image_path="/path/to/image_with_text.jpg"
)
Security Considerations
- Use AWS IAM roles with appropriate permissions
- Store credentials securely
- Use temporary credentials when possible
- Be aware of Amazon Rekognition service quotas and limits
License
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file awslabs_amazon_rekognition_mcp_server-0.0.2.tar.gz.
File metadata
- Download URL: awslabs_amazon_rekognition_mcp_server-0.0.2.tar.gz
- Upload date:
- Size: 67.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63a1a9626e356b6ad1fac3ba0f340993f90383b312243e2e04bdc0b0240815f1
|
|
| MD5 |
98c9064a9e628456451b1339385258c6
|
|
| BLAKE2b-256 |
6028890045e19bd0eab348406585382cc8158a44ab9c1edf969c809c6bcaf712
|
Provenance
The following attestation bundles were made for awslabs_amazon_rekognition_mcp_server-0.0.2.tar.gz:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_amazon_rekognition_mcp_server-0.0.2.tar.gz -
Subject digest:
63a1a9626e356b6ad1fac3ba0f340993f90383b312243e2e04bdc0b0240815f1 - Sigstore transparency entry: 244323012
- Sigstore integration time:
-
Permalink:
awslabs/mcp@8cba768dd016dcae9862436e38699528960f4275 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8cba768dd016dcae9862436e38699528960f4275 -
Trigger Event:
schedule
-
Statement type:
File details
Details for the file awslabs_amazon_rekognition_mcp_server-0.0.2-py3-none-any.whl.
File metadata
- Download URL: awslabs_amazon_rekognition_mcp_server-0.0.2-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a44e9d05ba708eed4b7b64bbf7168bf7b4f7e62ac0d0a1512f7878fd16f069f2
|
|
| MD5 |
95e38d12ee44e445426235b05076f878
|
|
| BLAKE2b-256 |
72cb89bfe0eef2a3ee2cb1a17c813f2d01bd63f5b018d5cc6dc883ee6381d535
|
Provenance
The following attestation bundles were made for awslabs_amazon_rekognition_mcp_server-0.0.2-py3-none-any.whl:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_amazon_rekognition_mcp_server-0.0.2-py3-none-any.whl -
Subject digest:
a44e9d05ba708eed4b7b64bbf7168bf7b4f7e62ac0d0a1512f7878fd16f069f2 - Sigstore transparency entry: 244323013
- Sigstore integration time:
-
Permalink:
awslabs/mcp@8cba768dd016dcae9862436e38699528960f4275 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8cba768dd016dcae9862436e38699528960f4275 -
Trigger Event:
schedule
-
Statement type: