181 lines
5.6 KiB
Plaintext
181 lines
5.6 KiB
Plaintext
---
|
|
title: MCP Server
|
|
subtitle: Connect AI assistants to browser automation via Model Context Protocol
|
|
slug: going-to-production/mcp
|
|
---
|
|
|
|
The Skyvern MCP server lets AI assistants like Claude Desktop, Cursor, and Windsurf control a browser. Your AI can fill out forms, extract data, download files, and run multi-step workflows, all through natural language.
|
|
|
|
<Note>
|
|
Requires Python 3.11, 3.12, or 3.13.
|
|
</Note>
|
|
|
|
## What you can do
|
|
|
|
The MCP server exposes 31 tools across 5 categories:
|
|
|
|
| Category | Key tools | What they do |
|
|
|----------|-----------|--------------|
|
|
| **Session management** | `session_create`, `session_close`, `session_list`, `session_connect` | Open, manage, and reuse browser sessions |
|
|
| **Browser actions** | `act`, `navigate`, `click`, `type`, `scroll`, `select_option`, `press_key`, `wait` | Control the browser with natural language or CSS/XPath selectors |
|
|
| **Data extraction** | `extract`, `screenshot`, `evaluate` | Pull structured data from pages, capture screenshots, run JavaScript |
|
|
| **Validation** | `validate` | Check page conditions using AI (returns true/false) |
|
|
| **Workflows** | `workflow_create`, `workflow_run`, `workflow_status`, `workflow_get`, `workflow_update`, `workflow_delete` | Build and execute multi-step automations |
|
|
|
|
Your AI assistant decides which tools to call based on your instructions. For example, asking "go to Hacker News and get the top post title" triggers `session_create`, `navigate`, `extract`, and `session_close` automatically.
|
|
|
|
## Setup
|
|
|
|
### Option A: Setup wizard (recommended)
|
|
|
|
```bash
|
|
pip install skyvern
|
|
skyvern init
|
|
```
|
|
|
|
The wizard will:
|
|
1. Ask whether to use Skyvern Cloud or a local server
|
|
2. Configure your LLM provider (if local)
|
|
3. Detect your MCP clients (Claude Desktop, Cursor, Windsurf)
|
|
4. Write the MCP configuration file for each client automatically
|
|
|
|
<Tip>
|
|
If you chose local mode, start the server before using MCP:
|
|
|
|
```bash
|
|
skyvern run server
|
|
```
|
|
</Tip>
|
|
|
|
### Option B: Manual configuration
|
|
|
|
Add this to your MCP client's configuration file:
|
|
|
|
```json
|
|
{
|
|
"mcpServers": {
|
|
"Skyvern": {
|
|
"env": {
|
|
"SKYVERN_BASE_URL": "https://api.skyvern.com",
|
|
"SKYVERN_API_KEY": "YOUR_SKYVERN_API_KEY"
|
|
},
|
|
"command": "/usr/bin/python3",
|
|
"args": ["-m", "skyvern", "run", "mcp"]
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
Replace `/usr/bin/python3` with the output of `which python3` on your machine. For local mode, set `SKYVERN_BASE_URL` to `http://localhost:8000` and find your API key in the `.env` file after running `skyvern init`.
|
|
|
|
### Option C: Remote MCP over HTTPS (streamable HTTP)
|
|
|
|
Use this when your team provides a hosted MCP endpoint (for example: `https://mcp.skyvern.com/mcp`).
|
|
|
|
In remote HTTP mode:
|
|
- Clients must send `x-api-key` on every request.
|
|
- Use `skyvern_session_create` first, then pass `session_id` explicitly on subsequent browser tool calls.
|
|
|
|
If your MCP client supports native remote HTTP transport, configure it directly:
|
|
|
|
```json
|
|
{
|
|
"mcpServers": {
|
|
"SkyvernRemote": {
|
|
"type": "streamable-http",
|
|
"url": "https://mcp.skyvern.com/mcp",
|
|
"headers": {
|
|
"x-api-key": "YOUR_SKYVERN_API_KEY"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
<Accordion title="Config file locations by client">
|
|
|
|
| Client | Path |
|
|
|--------|------|
|
|
| **Claude Desktop** (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
| **Claude Desktop** (Linux) | `~/.config/Claude/claude_desktop_config.json` |
|
|
| **Cursor** | `~/.cursor/mcp.json` |
|
|
| **Windsurf** | `~/.codeium/windsurf/mcp_config.json` |
|
|
|
|
</Accordion>
|
|
|
|
## See it in action
|
|
|
|
**Claude Desktop** looking up the top Hacker News posts:
|
|
|
|
<video style={{ aspectRatio: '16 / 9', width: '100%' }} controls>
|
|
<source src="https://github.com/user-attachments/assets/0c10dd96-c6ff-4b99-ad99-f34a5afd04fe" type="video/mp4" />
|
|
</video>
|
|
|
|
**Cursor** finding programming jobs:
|
|
|
|
<video style={{ aspectRatio: '16 / 9', width: '100%' }} controls>
|
|
<source src="https://github.com/user-attachments/assets/084c89c9-6229-4bac-adc9-6ad69b41327d" type="video/mp4" />
|
|
</video>
|
|
|
|
**Windsurf** searching Form 5500 and downloading files:
|
|
|
|
<video style={{ aspectRatio: '16 / 9', width: '100%' }} controls>
|
|
<source src="https://github.com/user-attachments/assets/70cfe310-24dc-431a-adde-e72691f198a7" type="video/mp4" />
|
|
</video>
|
|
|
|
## Troubleshooting
|
|
|
|
<Accordion title="Python version errors">
|
|
The Skyvern MCP server requires Python 3.11, 3.12, or 3.13. Check your version with `python3 --version`. If you have multiple Python versions installed, make sure the `command` in your MCP config points to a supported version:
|
|
|
|
```bash
|
|
which python3.11
|
|
# Use this path in your MCP config
|
|
```
|
|
|
|
You can also use `pipx` to install in an isolated environment:
|
|
|
|
```bash
|
|
pipx install skyvern
|
|
```
|
|
</Accordion>
|
|
|
|
<Accordion title="Connection refused (local mode)">
|
|
Make sure the Skyvern server is running before using MCP tools:
|
|
|
|
```bash
|
|
skyvern run server
|
|
```
|
|
|
|
Confirm the server is reachable at `http://localhost:8000`. If you changed the port, update `SKYVERN_BASE_URL` in your MCP config to match.
|
|
</Accordion>
|
|
|
|
<Accordion title="MCP client doesn't detect Skyvern">
|
|
Verify that the `command` path in your MCP config is correct:
|
|
|
|
```bash
|
|
which python3
|
|
```
|
|
|
|
Use the full absolute path (e.g., `/usr/bin/python3` or `/Users/you/.pyenv/shims/python3`), not just `python3`. Restart your MCP client after editing the config file.
|
|
</Accordion>
|
|
|
|
## Next steps
|
|
|
|
<CardGroup cols={2}>
|
|
<Card
|
|
title="Run a Task"
|
|
icon="play"
|
|
href="/running-automations/run-a-task"
|
|
>
|
|
Learn the API for running browser automations
|
|
</Card>
|
|
<Card
|
|
title="API Quickstart"
|
|
icon="rocket"
|
|
href="/getting-started/quickstart"
|
|
>
|
|
Get started with the Skyvern SDK
|
|
</Card>
|
|
</CardGroup>
|