Model Context Protocol

Overview

Anchor provides a hosted Model Context Protocol (MCP) integration, allowing you to use browser automation directly from your preferred AI tools without any local setup. Our hosted MCP server runs on our infrastructure and is available to all users with an Anchor API key. This enables seamless browser control from Cursor, VS Code, Claude, ChatGPT, and other MCP-compatible tools without managing any local dependencies.

What is MCP?

Model Context Protocol (MCP) is an open standard that allows AI assistants to interact with external tools and data sources. In our case, it enables AI-powered tools to access and control our browser automation capabilities directly within your IDE, agent apps, or CI/CD pipelines.

Hosted vs Self-Hosted

Our hosted MCP service provides:
  • ✅ Zero setup - just add your API key
  • ✅ Always up-to-date with latest features
  • ✅ Managed infrastructure and updates
  • ✅ Built-in scaling and reliability
  • ✅ Direct integration with Anchor’s cloud browsers
For advanced customization needs, see our Open Source MCP Server documentation.

Usage

Once configured, you can use Anchor Browser directly in your conversations with your AI assistant.

Available Tools

The hosted MCP integration provides access to all main Anchor capabilities: MCP Tools

Programmatic Usage (Python SDK)

You can also use the hosted MCP service programmatically in your Python applications using the MCP client library:

Installation

pip install mcp

Basic Example

import asyncio
from mcp.client.streamable_http import streamablehttp_client
from mcp import ClientSession

async def list_tools():
    async with streamablehttp_client(
        url="https://api.anchorbrowser.io/mcp",
        headers={"anchor-api-key": "sk-your-key"}
    ) as (
        read_stream,
        write_stream,
        _,
    ):
        async with ClientSession(read_stream, write_stream) as session:
            await session.initialize()
            tools = await session.list_tools()
            for tool in tools.tools:
                print(f"{tool.name}: {getattr(tool, 'description', '')}")

asyncio.run(list_tools()) 

CI/CD Integration

The hosted MCP service works in CI/CD environments without requiring local browser installations:
# GitHub Actions example
name: AI Browser Testing
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Run AI tests
        env:
          ANCHOR_API_KEY: ${{ secrets.ANCHOR_API_KEY }}
        run: |
          python ai_test_runner.py

Getting Help

If you encounter issues with the hosted MCP integration:
  1. Check API Key: Ensure your API key is valid
  2. Restart MCP Client: Disable and re-enable the MCP server in your client
  3. Contact Support: Reach out at support@anchorbrowser.io

Migration from Self-Hosted

Moving from a self-hosted MCP server to our hosted service:
  1. Update Configuration: Change your MCP client to use https://api.anchorbrowser.io/mcp
  2. Add API Key: Include your Anchor API key in the headers
  3. Remove Local Dependencies: Uninstall local MCP server and dependencies
  4. Test Integration: Verify all your existing MCP workflows still work