Documentation menu

MCP Server

The Model Context Protocol (MCP) is how your AI coding agent communicates with Long Horizon. When MCP is enabled, your agent can request browser tests, and Long Horizon executes them in a real browser on your machine.

How it works

  1. Your coding agent decides to run a browser test
  2. It sends a request to Long Horizon through MCP
  3. Long Horizon launches a browser and executes the test
  4. Results are returned to your agent and logged in the desktop app

Automatic configuration

During project setup, Long Horizon automatically adds its MCP server to your agent's configuration file. For Cursor, this is typically .cursor/mcp.json in your project. The MCP server URL is http://localhost:5666/mcp and it is automatically started when the Long Horizon app is opened.

{
  "mcpServers": {
    "Long Horizon": {
      "url": "http://localhost:5666/mcp"
    }
  }
}

Long Horizon preserves any existing MCP servers in your config—it only adds or updates its own entry.

Enabling MCP server in your coding agent

Cursor

  1. Open File → Preferences → Cursor Settings
  2. Navigate to Tools & MCPs
  3. Find Long Horizon in the list
  4. Toggle it on

Note: The toggle must be enabled even after the config file is created. Cursor won't send MCP requests until you explicitly enable the server.

Claude Code

After Long Horizon writes the MCP configuration, restart the Claude Code CLI.

The CLI reads MCP configuration on startup, so a restart is required for changes to take effect.

Codex

Restart the Codex CLI after configuration

Verifying the connection

To confirm MCP is working:

  1. Make sure Long Horizon is running with your project open
  2. Ask your agent to run a simple test: Test that the homepage loads successfully
  3. Watch for browser activity in Long Horizon

If the browser doesn't launch, check that:

  • Long Horizon is running (not just installed)
  • Your project is open in Long Horizon
  • MCP is enabled in your agent's settings
  • Your agent was restarted after configuration (for CLI-based agents)

Security considerations

MCP tools run with your user permissions and can access:

  • Files in your project directory
  • Your local network (to reach your dev server)
  • Any URLs your browser can access