Deploy MCP-Meta Ads
Deploy and Host MCP-Meta Ads with Railway
Just deployed
/var/lib/postgresql/data
faceads-mcp
Just deployed
Deploy and Host MCP-Meta Ads on Railway
A Model Context Protocol (MCP) server for the Meta Marketing API. Exposes 60+ tools that let AI agents query 650+ scraped Meta Ads documentation files locally and execute Facebook/Instagram ad operations: campaigns, ad sets, ads, creatives, audiences, insights, Advantage+ Creative and value rules, all from a single remote MCP endpoint.
About Hosting MCP-Meta Ads
Hosting on Railway runs the MCP server in HTTP/Streamable mode (node dist/index.js --http --port $PORT) so any MCP-compatible client can connect over the network instead of stdio. Railway's Nixpacks builder handles npm install && npm run build automatically, and the runtime serves the MCP protocol on the assigned port. Provide META_ACCESS_TOKEN to unlock the 60+ Graph API tools; without it, the documentation tools still work. For multi-tenant deployments, attach a Railway PostgreSQL plugin and set DATABASE_URL + MCP_ENCRYPTION_KEY to enable per-user OAuth sessions and encrypted token storage.
Common Use Cases
- Power AI traffic-management agents (Claude, GPT, custom assistants) with up-to-date Meta Marketing API documentation and live campaign control, exposed as a single remote MCP endpoint
- Centralize a hosted MCP backend that multiple users connect to from desktop and IDE clients (Cursor, Claude Desktop, Continue) without each user maintaining a local install
- Provide a remote MCP for OAuth-based multi-tenant integrations where each user brings their own Meta access token, with encrypted persistence in PostgreSQL
Dependencies for MCP-Meta Ads Hosting
- Node.js 18 or newer (provisioned by Railway's Nixpacks builder)
- (Optional) PostgreSQL instance for multi-tenant token storage and OAuth sessions — Railway's PostgreSQL plugin works out of the box
Deployment Dependencies
- Meta Marketing API access token: https://developers.facebook.com/docs/marketing-api/get-started
- Meta App with Marketing API permissions (only if running multi-tenant OAuth mode): https://developers.facebook.com/docs/development/create-an-app
- Railway PostgreSQL plugin (optional): https://railway.app/template/postgres
Implementation Details
Start command:
node dist/index.js --http --port $PORT
Environment variables:
| Variable | Required | Description |
|---|---|---|
META_ACCESS_TOKEN | For execution tools | Meta Marketing API token. Documentation tools work without it. |
META_API_VERSION | No | Graph API version (default: v24.0) |
MCP_BASE_URL | Recommended | Public URL of the deployment (Railway assigns one — paste it here for OAuth callbacks) |
DATABASE_URL | Multi-tenant only | PostgreSQL connection string. Auto-injected by Railway's plugin. |
MCP_ENCRYPTION_KEY | If DATABASE_URL is set | 32-byte hex key for token encryption. Generate with openssl rand -hex 32. |
Why Deploy MCP-Meta Ads 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 MCP-Meta Ads 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
faceads-mcp
yvfl/faceads-mcp