Model Context Protocol (MCP)
Use Oxylabs MCP to give AI assistants live web scraping, search, and extraction tools via Oxylabs products.
Model Context Protocol (MCP) is an open standard for connecting AI assistants to external tools and data. With Oxylabs MCP integrations, assistants such as Claude and Cursor can access live web data – scrape pages, search the web, crawl sites, and control remote browsers.
Oxylabs offers MCP integrations for two products:
Web API
Connect Web API to your AI agent to search the web, scrape pages in the format of your choice, extract fields as JSON, and call dedicated scrapers – all through one MCP connection. You can find all details in the Web API MCP GitHub repository.
You can connect in two ways:
Remote MCP – connect to the server hosted and maintained by Oxylabs. There is nothing to install or update.
Self-hosted MCP – deploy and manage the server in your own environment for more control.
Server runs on
Oxylabs infrastructure
Your machine or infrastructure
Setup
Add the server URL and your API key to your client
Install uv, Python, and the server, then configure your client
Updates and maintenance
Managed by Oxylabs
Managed by you
Server settings
Managed by Oxylabs
Configurable with environment variables
Best for
The quickest way to give a compatible agent access to Web API
Full control over the environment, or clients that can't connect to remote servers with a custom header
Requirements
Web API key: in the Oxylabs dashboard, create a Web API product instance, open it, and copy the API key shown at the top of the instance page.
For remote MCP: An MCP client that supports remote (HTTP) MCP servers with custom headers, such as Claude Code, Codex, Cursor, etc.
For self-hosted MCP:
uvand Python 3.10 or higher.
Available tools
search
Search the live web – query, max_results, location
scrape
Read one URL, Markdown by default, or return named fields as JSON – url, format, location, device, run_js, json_prompt, json_schema
scrape_target
Call a target-specific scraper – endpoint, params, structured, parser, json_prompt, json_schema
list_scrapers
List available scrape endpoints, or describe one – endpoint
check_scrape
Collect a queued job, such as a JavaScript-rendering scrape – request_id
read_scraped
Read a large page that was offloaded to disk, in chunks – only when the server runs locally (stdio)
Option 1: Remote MCP
Connect your client to the Oxylabs-hosted server:
The server authenticates each request with your Web API key, sent as an Authorization: Bearer header.
Set your API key as an environment variable in the terminal where you will run your client:
Then add the server to your client:
--scope user makes the server available in all your projects. Make sure OXYLABS_WEB_API_KEY is set in the environment where you start Claude Code.
Codex reads the key from the OXYLABS_WEB_API_KEY environment variable, so it must be set in the environment where you start Codex.
For any client that supports remote MCP servers with custom headers, add the server URL and an Authorization header to the client's MCP configuration. For example, in Cursor's mcp.json:
Field names can differ between clients – check your client's documentation for how to add a remote MCP server with headers.
Option 2: Self-hosted MCP
Self-host your Web API MCP server as either Local (stdio) process or a Shared Server (HTTP):
Then point your client at the oxylabs-web-api-mcp command. The source is available in the Web API MCP GitHub repository.
The agent skill is already built into the server. If you prefer to manage skills separately, Claude Code can instead take the skills repository as a plugin, which wires this server and the skills together:
Self-hosted MCP configuration
Agent Browser
Connect Agent Browser through its MCP server hb-mcp, to let your assistant open remote browsers, navigate pages, interact with elements, and collect content using advanced autonomous navigation capabilities and Residential Proxy integration. You can find all details in the Agent Browser MCP GitHub repository.
Available tools
hb_connect returns a session label that you pass to the other tools, so you can run several sessions in parallel. Sessions last up to 1 hour and count toward your concurrent session limit until closed.
hb_connect
Open a session – accepts Agent Browser parameters such as p_cc, p_device, p_src, p_fp_tag, session_name, o_profile, record, page_handler
hb_disconnect
Close one session, or all sessions
hb_session_info
List open sessions, or show the details of one
hb_page_status,
hb_page_handle,
hb_classify_page
Work with the Page Handler: read page status, handle a challenge that appeared after page load (hb_page_handle requires page_handler=true), classify the current page
hb_sessions_list,
hb_session_stop
List and stop live sessions on your account
hb_recordings_list,
hb_recording_url,
hb_recording_delete
Manage session recordings
hb_profiles_list,
hb_profile_delete
Manage persistent profiles
hb_reference
Return the parameter and error reference
browser_navigate
Open a URL
browser_snapshot
Read the page content
browser_click
Click an element from the snapshot
browser_type,
browser_fill_form
Type into one field, or fill several form fields
browser_take_screenshot
Capture a screenshot
browser_close
Close the session
Other browser_* tools
Tabs, hovering, key presses, waiting, file upload, PDF export, and more
Prerequisites
Agent Browser
usernameandpasswordfrom the Oxylabs dashboard.Node.js 20.0.0 or higher and
git.
Installation
Install the server from GitHub, as it is not published to the npm registry:
Then point your client at the hb-mcp binary:
To skip the global install, use npx -y github:oxylabs/oxylabs-ab-mcp as the command instead of hb-mcp. Startup is slower.
Location selection
Ask your assistant to open the browser in a specific country with p_cc parameter, or set a default for every session with the --default-params argument:
To choose the browser's location options, visit the Geolocation & Proxy Selection page. If you don't specify a location, one is assigned automatically based on availability.
Use multiple products together
You can run both servers in the same client. Combine their entries under one mcpServers object.
Verify the setup
Check that your servers appear as enabled in your client's MCP list (in Claude Code, run
/mcp, or in Codex, runcodex mcp list).Send a test prompt for each product you set up, and approve the tool call if prompted (e.g.
Search the web for "oxylabs" and show the top 3 results.).
Troubleshooting
| Issue | Solution |
|---|---|
Server doesn't appear in the client | Make sure the JSON is valid, then restart the app. If you used a command, run it again and check the server list. |
Server is connected and tools are listed, but tool calls fail | The API key is checked only when a tool runs. Check that the key is correct and that you're using credentials for the right product: Web API uses an API key, and Agent Browser uses a username and password. |
| The Web API key is invalid. Copy it again from the top of your Web API instance in the dashboard. |
Message that no Web API key was provided | Remote MCP: the |
Self-hosted: the key isn't set in the server's environment. | |
Remote MCP server won't connect, or your client has no way to set a header | Your client may support only OAuth sign-in for remote servers or not support custom headers. Use the self-hosted option instead. |
Page content is cut off | Pages above the token limit are truncated when the server runs over HTTP, which includes Remote MCP. Request only the data you need with |
| Install |
| Add the hostname clients connect to in |
| Install Node.js 20.0.0 or higher and |
Agent Browser won't connect | Verify your credentials and make sure your firewall isn't interfering with WebSocket connections. |
Cursor menus look different | Edit |
Last updated
Was this helpful?