Railway

Deploy MCP-Meta Ads

Deploy and Host MCP-Meta Ads with Railway

Deploy MCP-Meta Ads

/var/lib/postgresql/data

faceads-mcp

yvfl/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

Implementation Details

Start command:

node dist/index.js --http --port $PORT

Environment variables:

VariableRequiredDescription
META_ACCESS_TOKENFor execution toolsMeta Marketing API token. Documentation tools work without it.
META_API_VERSIONNoGraph API version (default: v24.0)
MCP_BASE_URLRecommendedPublic URL of the deployment (Railway assigns one — paste it here for OAuth callbacks)
DATABASE_URLMulti-tenant onlyPostgreSQL connection string. Auto-injected by Railway's plugin.
MCP_ENCRYPTION_KEYIf DATABASE_URL is set32-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

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta