AEM Assets MCP Server
An MCP server that enables interaction with Adobe Experience Manager (AEM) Assets through the Author API. It allows users to browse folders, search for assets, retrieve detailed asset information, and perform bulk metadata updates using natural language.
README
AEM Assets MCP Server
A Model Context Protocol (MCP) server for Adobe Experience Manager (AEM) Assets Author API built with Python and FastAPI. Can be deployed to Vercel (Phase 1) or Google Cloud Run (Phase 2) and used with ChatGPT.
๐ Features
This MCP server provides tools to interact with AEM Assets:
- List folders - Browse folders in your AEM Assets repository
- List published assets - Find all assets that have been published
- Search assets - Search for assets by keywords (e.g., "Electric Vehicle")
- List assets by folder - Get all assets within a specific folder
- Bulk update metadata - Update metadata for all assets in a folder
- List assets by creator - Find assets uploaded by a specific user
- Get asset details - Retrieve detailed information about a specific asset
๐ Prerequisites
General Requirements
-
Adobe Experience Manager Assets Author API Access
- AEM base URL
- OAuth Server-to-Server credentials:
- Client ID (API Key)
- Client Secret
- Scopes
- See GET_CREDENTIALS.md for how to obtain these
-
Python 3.11+
Phase 1 Requirements (Vercel)
- Vercel account
- ChatGPT Plus/Pro (to use MCP servers)
Phase 2 Requirements (Google Cloud Run)
- Google Cloud Platform account
gcloudCLI installed- Terraform installed (for infrastructure as code)
- Docker installed
- GitHub account (for CI/CD)
๐ ๏ธ Tech Stack
- Python 3.11 - Core language
- FastAPI - Modern async web framework
- HTTPX - Async HTTP client
- Pydantic - Data validation
- OAuth Server-to-Server - Automatic token refresh
- Docker - Containerization
- Terraform - Infrastructure as Code
- GitHub Actions - CI/CD
๐ Project Structure
.
โโโ app/
โ โโโ __init__.py # Package initialization
โ โโโ main.py # FastAPI application
โ โโโ aem_client.py # AEM Assets API client
โ โโโ models.py # Pydantic models
โโโ terraform/
โ โโโ main.tf # Main Terraform configuration
โ โโโ variables.tf # Terraform variables
โ โโโ terraform.tfvars.example
โโโ .github/workflows/
โ โโโ deploy-cloud-run.yml # Cloud Run deployment
โ โโโ terraform-apply.yml # Terraform workflow
โ โโโ test.yml # Testing workflow
โโโ Dockerfile # Docker configuration
โโโ requirements.txt # Python dependencies
โโโ vercel.json # Vercel configuration
โโโ env.example # Environment template
โโโ README.md
๐ Quick Start
Local Development
- Clone the repository:
cd "SC Practice 20260130 - Assets MCP"
- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Configure environment:
# Option 1: Interactive setup (recommended)
./create-env.sh
# Option 2: Manual setup
cp env.example .env
nano .env # Edit with your AEM credentials
See GET_CREDENTIALS.md for how to get your OAuth credentials.
- Run locally:
uvicorn app.main:app --reload
Visit http://localhost:8000 to see the server info.
Docker Development
# Build image
docker build -t aem-mcp-server .
# Run container
docker run -p 8080:8080 \
-e AEM_BASE_URL="https://author-p12345-e67890.adobeaemcloud.com" \
-e AEM_CLIENT_ID="your_client_id_here" \
-e AEM_CLIENT_SECRET="your_client_secret_here" \
aem-mcp-server
๐ฆ Phase 1: Deploy to Vercel
See DEPLOYMENT_VERCEL.md for detailed instructions.
Quick steps:
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel
# Add environment variables in Vercel dashboard
# Deploy to production
vercel --prod
Your API will be available at: https://your-project.vercel.app/api/mcp
๐๏ธ Phase 2: Deploy to Google Cloud Run
See DEPLOYMENT_CLOUDRUN.md for detailed instructions.
Option 1: Using GitHub Actions (Recommended)
- Set up GCP and GitHub Secrets
- Push to main branch - Automatically deploys
- Service URL will be shown in Actions log
Option 2: Using Terraform
cd terraform
# Copy and edit variables
cp terraform.tfvars.example terraform.tfvars
nano terraform.tfvars
# Initialize Terraform
terraform init
# Preview changes
terraform plan
# Deploy infrastructure
terraform apply
Option 3: Manual Docker Deployment
# Build and tag
docker build -t gcr.io/YOUR_PROJECT/aem-mcp-server .
# Push to Container Registry
docker push gcr.io/YOUR_PROJECT/aem-mcp-server
# Deploy to Cloud Run
gcloud run deploy aem-assets-mcp-server \
--image gcr.io/YOUR_PROJECT/aem-mcp-server \
--platform managed \
--region us-central1 \
--allow-unauthenticated
๐ง Configuration
Environment Variables
Create a .env file with:
# AEM Instance
AEM_BASE_URL=https://author-p12345-e67890.adobeaemcloud.com
# OAuth Server-to-Server Credentials
AEM_CLIENT_ID=your_client_id_here
AEM_CLIENT_SECRET=your_client_secret_here
Get AEM Credentials
Quick Setup:
./create-env.sh # Interactive credential setup
Manual Setup:
See GET_CREDENTIALS.md for detailed instructions.
Summary:
- Go to Adobe Developer Console
- Create/select project
- Add "AEM Assets Author API"
- Configure "OAuth Server-to-Server" authentication
- Copy Client ID and Client Secret
- Copy Scopes from the credential page
Key Benefits:
- โ Automatic token refresh (every ~1 hour)
- โ No manual token management
- โ Production-ready authentication
- โ Based on Adobe's OAuth S2S guide
๐ค Connect to ChatGPT
See CHATGPT_SETUP.md for complete integration guide.
Quick summary:
- Create Custom GPT in ChatGPT
- Add Action with OpenAPI schema
- Point to your deployed URL
- Test with natural language prompts
๐ฌ Usage Examples
Once connected to ChatGPT:
โ
"List all the folders in the root directory"
โ
"Show me all published assets"
โ
"Find assets related to Electric Vehicle"
โ
"Update all assets in /content/dam/products with jancode: ABCDEFG"
โ
"List all assets uploaded by user@example.com"
๐ API Reference
Endpoints
GET /- Server informationGET /api/mcp- Server informationPOST /api/mcp- Execute MCP toolGET /health- Health check
Available Tools
1. list_folders
{
"tool": "list_folders",
"arguments": {
"path": "/content/dam"
}
}
2. list_published_assets
{
"tool": "list_published_assets",
"arguments": {
"limit": 50
}
}
3. search_assets
{
"tool": "search_assets",
"arguments": {
"query": "Electric Vehicle",
"limit": 100
}
}
4. list_assets_by_folder
{
"tool": "list_assets_by_folder",
"arguments": {
"folderPath": "/content/dam/products"
}
}
5. bulk_update_metadata
{
"tool": "bulk_update_metadata",
"arguments": {
"folderPath": "/content/dam/products",
"metadata": {
"jancode": "ABCDEFG",
"category": "Electronics"
}
}
}
6. list_assets_by_creator
{
"tool": "list_assets_by_creator",
"arguments": {
"createdBy": "user@example.com",
"limit": 50
}
}
7. list_all_assets
{
"tool": "list_all_assets",
"arguments": {
"path": "/content/dam",
"limit": 200
}
}
8. get_asset_details
{
"tool": "get_asset_details",
"arguments": {
"assetId": "urn:aaid:aem:12345"
}
}
๐งช Testing
Manual Testing
# Test health endpoint
curl http://localhost:8000/health
# Test tool call
curl -X POST http://localhost:8000/api/mcp \
-H "Content-Type: application/json" \
-d '{
"tool": "list_folders",
"arguments": {"path": "/"}
}'
Run Tests (when available)
pytest tests/ -v
๐ Security
- โ Environment variables for credentials
- โ CORS configured for API access
- โ Secret Manager for Cloud Run
- โ Service Account with minimal permissions
- โ HTTPS enforced
Important:
- Never commit
.envorterraform.tfvars - Rotate AEM tokens regularly
- Use Workload Identity Federation for GitHub Actions
- Restrict Cloud Run access as needed
๐ Troubleshooting
Common Issues
Import errors in FastAPI:
pip install --upgrade -r requirements.txt
Docker build fails:
# Check Docker is running
docker ps
# Build with no cache
docker build --no-cache -t aem-mcp-server .
Terraform errors:
# Re-initialize
cd terraform
rm -rf .terraform
terraform init
Cloud Run deployment fails:
- Check Secret Manager has correct values
- Verify service account permissions
- Check Artifact Registry has image
- Review Cloud Run logs
๐ Additional Documentation
- DEPLOYMENT_VERCEL.md - Phase 1 deployment guide
- DEPLOYMENT_CLOUDRUN.md - Phase 2 deployment guide
- CHATGPT_SETUP.md - ChatGPT integration guide
- AEM Assets API Docs
๐ค Contributing
- Fork the repository
- Create feature branch
- Make changes
- Test thoroughly
- Submit pull request
๐ License
MIT License - See LICENSE file for details
๐ Resources
- FastAPI Documentation
- Google Cloud Run
- Terraform Documentation
- Adobe Developer Console
- Model Context Protocol
๐ก Tips
- Start with Phase 1 (Vercel) for quick testing
- Use Terraform for reproducible infrastructure
- Monitor logs in Cloud Run console
- Set up alerts for production deployments
- Use Secret Manager for all sensitive data
Need Help? Check the documentation files or open an issue on GitHub.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.