Deploy Meta ADS MCP

Connect AI assistants to Meta Ads with secure MCP tools.

Deploy Meta ADS MCP

/var/lib/postgresql/data

faceads-mcp-v2

yvfl/faceads-mcp-v2

Just deployed

Deploy and Host Meta ADS MCP on Railway

Meta ADS MCP connects compatible AI assistants to the Meta Marketing API. It provides tools for exploring ad accounts, retrieving campaigns and performance metrics, and managing advertising resources. Each connection uses its own Meta credentials, selected accounts, and permissions, with read-only access selected by default.

About Hosting Meta ADS MCP

Deploying Meta ADS MCP requires the application service, a persistent PostgreSQL database, a public HTTPS URL, and an encryption key for stored Meta credentials. The included Docker image builds the application and applies database migrations automatically at startup.

Users connect their MCP-compatible assistant to the /mcp endpoint, authenticate, provide a valid Meta access token, and select the accounts and permissions to authorize. OAuth credentials and account selections persist in PostgreSQL. The server supports automatic OAuth renewal, paginated queries, and account-level authorization. Keep the database and encryption key backed up, and run one application replica.

Common Use Cases

  • Analyze campaign performance using spend, impressions, clicks, conversions, and breakdowns.
  • Audit campaigns, ad sets, and ads through paginated read-only tools.
  • Create paused advertising resources and manage them through explicitly authorized assistant workflows.

Dependencies for Meta ADS MCP Hosting

  • A persistent PostgreSQL database connected through DATABASE_URL.
  • A valid Meta user or system user access token with the required permissions and access to the selected advertising accounts.

Implementation Details

Configure these application variables:

MCP_BASE_URL=https://your-service.up.railway.app
MCP_ENCRYPTION_KEY=<64-character hexadecimal secret>
META_API_VERSION=v26.0

Generate the encryption key with:

openssl rand -hex 32

Preserve this key across deployments. Connect your assistant using:

https://your-service.up.railway.app/mcp

The Docker image includes the Node.js runtime. Database migrations run automatically, and /health checks application and database availability.

Run one application replica. MCP transport sessions reside in memory; multiple replicas require additional session coordination. OAuth authorizations persist in PostgreSQL.

Why Deploy Meta ADS MCP on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Meta ADS MCP on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Typesense vs Meilisearch
self-hosted Typesense vs Meilisearch

onepush
0
View Template
Betterlytics
Betterlytics is a cookieless analytics platform GDPR-compliant.

OpenSource Templates
27
View Template
Finance Tracker
Private multi-user household finance ledger with budgets and CSV import.

wotonews
0