Self-Host the Apify MCP Server on Railway for AI Web Scraping

Model Context Protocol (MCP) is changing how AI assistants interact with the web. Instead of giving your AI a browser or hoping it can parse raw HTML, you give it tools — real, purpose-built APIs that return structured data. The Apify MCP Server is one of the most powerful examples: it connects any MCP-compatible client to the entire Apify Store of 3,000+ Actors for web scraping, data extraction, and automation.

The problem? Setting up an MCP server usually means managing infrastructure, dealing with deployments, and keeping it running. That's where the Apify MCP Server Railway Template comes in — it provisions a production-ready MCP endpoint in about 60 seconds with zero configuration.

What You Get

The template deploys a Node.js server running the official Apify MCP Server on Railway's infrastructure. It uses the Streamable HTTP transport, so any MCP client that supports HTTP transport can connect — including Claude Desktop, Cursor IDE, and Windsurf.

Once deployed, Railway assigns a public HTTPS URL. You configure your AI client to point at that URL with your Apify API token as a Bearer token, and suddenly your AI can:

  • Scrape Google Search results for any query
  • Extract product data from Amazon, eBay, or Walmart
  • Pull TikTok and Instagram content
  • Scrape Twitter/X profiles and tweets
  • Extract data from Google Maps listings
  • Crawl and scrape any website
  • And thousands more — the full Apify Store is at your fingertips

One-Click Deploy

Deploying is as simple as clicking a link:

https://railway.com/deploy/apify-mcp-server-1

You only need one thing: an Apify API token. Get one for free from console.apify.com. Railway prompts you for it during deployment — paste it in, and the server is live.

The template uses:

  • NIXPACKS builder — Railway auto-detects the Node.js project and installs dependencies
  • Express.js — Healthy HTTP server with a /health endpoint for monitoring
  • @apify/actors-mcp-server v0.13 — The latest stable MCP server
  • @modelcontextprotocol/sdk v1.30 — Streamable HTTP transport support

Connecting Your AI Assistant

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "apify": {
      "type": "url",
      "url": "https://your-railway-url.railway.app",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}

Cursor IDE

Go to Settings > Features > MCP Servers and add a new server with the same URL and Bearer token.

Windsurf

Configure the MCP server with the endpoint URL and Bearer authorization header in your Windsurf MCP settings.

Why Railway?

Railway handles all the infrastructure concerns automatically:

  • Always-on — No need to start/stop the server; it stays available whenever you need it
  • Auto-deploy from GitHub — Push changes to your repo and Railway rebuilds and deploys
  • Custom domains — Point your own domain at the MCP endpoint
  • Health monitoring — Built-in health checks keep the server running
  • Free tier — Start with Railway's generous free tier and scale when needed

How It Works

The Apify MCP Server translates MCP tool calls into Apify API requests. When your AI assistant asks to scrape a website, the flow is:

  1. Your AI client sends a call_tool request over HTTP to your Railway endpoint
  2. The Apify MCP Server authenticates the request using your Apify API token
  3. It starts the appropriate Apify Actor with the parameters your AI provided
  4. The Actor runs on Apify's infrastructure, scraping the target website
  5. Results stream back through MCP to your AI assistant
  6. Your AI processes the data and presents it to you in a structured format

Real-World Use Cases

  • Market research — Ask Claude to scrape competitor pricing from Amazon and compile a comparison table
  • Social media monitoring — Have Cursor extract trending topics from Twitter and analyze sentiment
  • SEO analysis — Use Windsurf to scrape Google Search results for your target keywords
  • Lead generation — Automatically extract business listings from Google Maps for your sales pipeline
  • Content aggregation — Build an AI-powered news aggregator that scrapes multiple sources

Get Started

Ready to give your AI superpowers? Deploy the template now:

🚀 Deploy Apify MCP Server on Railway

Or check out the open-source repository on GitHub to see the full source code and contribute.

This is a stateless proxy — no database or persistent storage needed. Your Apify API token is the only credential. All scraping happens on Apify's cloud infrastructure, not on your Railway instance.