AEM Assets MCP Server

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.

Category
Visit Server

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

  1. 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
  2. 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
  • gcloud CLI 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

  1. Clone the repository:
cd "SC Practice 20260130 - Assets MCP"
  1. Create virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. 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.

  1. 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)

  1. Set up GCP and GitHub Secrets
  2. Push to main branch - Automatically deploys
  3. 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:

  1. Go to Adobe Developer Console
  2. Create/select project
  3. Add "AEM Assets Author API"
  4. Configure "OAuth Server-to-Server" authentication
  5. Copy Client ID and Client Secret
  6. 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:

  1. Create Custom GPT in ChatGPT
  2. Add Action with OpenAPI schema
  3. Point to your deployed URL
  4. 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 information
  • GET /api/mcp - Server information
  • POST /api/mcp - Execute MCP tool
  • GET /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 .env or terraform.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

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch
  3. Make changes
  4. Test thoroughly
  5. Submit pull request

๐Ÿ“„ License

MIT License - See LICENSE file for details

๐Ÿ”— Resources

๐Ÿ’ก Tips

  1. Start with Phase 1 (Vercel) for quick testing
  2. Use Terraform for reproducible infrastructure
  3. Monitor logs in Cloud Run console
  4. Set up alerts for production deployments
  5. Use Secret Manager for all sensitive data

Need Help? Check the documentation files or open an issue on GitHub.

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

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.

Official
Featured
Python
graphlit-mcp-server

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.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured