> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uplink.build/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

> Drive Uplink from any MCP-capable AI client (Claude Code, Cursor, Windsurf, etc.)

The Uplink MCP server (`@uplink-code/mcp`) exposes Uplink's browser automation surface to any AI client that speaks the [Model Context Protocol](https://modelcontextprotocol.io). With it, an LLM running in Claude Code, Cursor, or Windsurf can pair a real mobile device, navigate pages, run JavaScript, and inspect the network traffic that the page produces — useful for reverse-engineering how a consumer website actually works.

## When to use it

<CardGroup cols={2}>
  <Card title="Reverse-engineering" icon="binoculars">
    Have an AI assistant drive a logged-in mobile session and observe the real API calls a site makes.
  </Card>

  <Card title="Investigative automation" icon="magnifying-glass-chart">
    Ad-hoc "show me how X works" workflows without writing a script first.
  </Card>

  <Card title="AI agent prototyping" icon="robot">
    Test an automation idea interactively before committing it to a JavaScript SDK script.
  </Card>

  <Card title="Live debugging" icon="bug">
    Ask the model to drive a flow and surface the network requests or console logs that broke.
  </Card>
</CardGroup>

## What it isn't

The MCP server is **not** a wrapper around an official OAuth API. Uplink drives a real device's browser; the AI inspects whatever traffic the site itself produces. There's no `client_id` / `client_secret` step for the site you're investigating — the user simply logs in interactively on their paired device.

## How it works

```mermaid theme={null}
sequenceDiagram
  participant User as Claude Code / Cursor
  participant MCP as @uplink-code/mcp
  participant Relay as Uplink Relay
  participant Device as Paired Device

  User->>MCP: uplink_connect
  MCP->>Relay: POST /sessions (Bearer JWT)
  Relay-->>MCP: sessionId, pairing code
  MCP-->>User: Pair with code XXX-XXX
  User->>Device: Type code in Connect app
  Device->>Relay: register as worker
  User->>MCP: uplink_run_script (...)
  MCP->>Device: page.goto, page.click, etc.
  Device-->>MCP: xhr events, results
  MCP-->>User: structured response
```

## Next steps

<CardGroup cols={2}>
  <Card title="Install + sign in" icon="download" href="/mcp/installation">
    Get the MCP server running in Claude Code or your preferred AI client.
  </Card>

  <Card title="Tool reference" icon="list" href="/mcp/tools">
    Full catalog of `uplink_*` tools the AI can call.
  </Card>
</CardGroup>
