dev-tools 3 min read

Codify MCP – Browser Automation from Casual Actions

Turn any browser action into a reusable MCP tool. Codify records Playwright workflows and exposes them as JSON-driven tools for AI agents like Claude and Cursor.

By
Share: X in
Codify MCP – browser automation pipeline

TL;DR

TL;DR: Codify MCP is an open-source MCP server that converts recorded browser actions into reusable automation tools, powered by Apify Agent under the hood.

What Is Codify MCP?

Codify MCP is an open-source Model Context Protocol server that lets AI assistants execute browser automation tasks. The core idea is simple: you record a browser workflow once using Playwright, and Codify turns it into a clean, reusable tool that AI agents can call with JSON arguments — no manual script editing required.

From the project README:

MCP server that lets AI assistants execute browser automation tasks via Apify Agent. Tools are passed as clean JSON arguments — one per line. No manual setup or file creation.

The project is part of a larger Codify effort that includes a browser-based recorder and a pipeline for scaling automations to production.

Setup

Prerequisites

  • Node.js 18 or later
  • An Apify account (free tier works for testing)
  • An AI assistant that supports MCP (Claude Desktop, Cursor, etc.)

Install the MCP Server

# Run directly with npx
npx codify-mcp

# Or install globally
npm install -g codify-mcp

Connect to Apify

# Login stores your token at ~/.apify/auth.json
apify login

# Or set the token directly
export APIFY_TOKEN="your-token-here"

Configure Your AI Assistant

Add Codify MCP to your MCP server configuration. For Claude Desktop, edit ~/.config/claude-desktop/mcp_servers.json:

{
  "mcpServers": {
    "codify": {
      "command": "npx",
      "args": ["codify-mcp"]
    }
  }
}

How It Works

Record a Browser Action

  1. Open Apify Agent in your browser
  2. Navigate to the page you want to automate
  3. Use the recorder to capture your actions
  4. Export the resulting tool JSON

Define a Tool Schema

Tools are passed as JSON with this structure:

{
  "name": "scrape_product",
  "description": "Scrape product info from a page",
  "inputSchema": {
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "description": "Product page URL"
      }
    },
    "required": ["url"]
  },
  "implementation": {
    "type": "apify-actor",
    "actorId": "cyberfly/apify-agent",
    "script": "await page.goto(inputs.url); const title = await page.textContent('h1'); return {title};"
  }
}

Use in Your AI Assistant

Once configured, you can ask your AI assistant to “scrape product info from this URL” and it will call the tool through the MCP server, which executes it via Apify Agent.

Architecture

Codify MCP sits between your AI assistant and Apify’s browser automation infrastructure:

AI Assistant → MCP Protocol → Codify MCP Server → Apify Agent → Playwright → Browser

The MCP server parses JSON tool definitions and forwards them to cyberfly/apify-agent, which handles session management, proxy rotation, and browser lifecycle.

Use Cases

  • Data extraction — scrape structured data from web pages without writing scrapers
  • Form automation — pre-fill and submit forms programmatically
  • Monitoring — track changes on pages over time
  • AI tool creation — wrap any browser workflow as a callable tool for an AI agent

Source and Accuracy Notes