> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/help-center/data-for-llms/how-do-i-use-model-context-protocol-mcp-with-web-api.md).

# How do I use Model Context Protocol (MCP) with Web API?

Learn how to connect an MCP client to Web API.

MCP is optional. Your existing requests to [Web API](https://developers.oxylabs.io/products/web-api) keep working, and you can add the MCP server whenever you want an AI agent to call Web API directly.

### **Set up the MCP server**

1. In the dashboard, create a Web API instance and copy its API key.
2. Install the server with uv.

```
uv tool install git+https://github.com/oxylabs/web-api-mcp
```

3. Add your API key to the environment.

```
export OXYLABS_WEB_API_KEY=your_api_key_here
```

4. Add the server to your MCP client. In Claude Code, run the following command.

```
claude mcp add oxylabs-web-api -- oxylabs-web-api-mcp
```

For other MCP clients, such as Claude Desktop or Cursor, add `oxylabs-web-api-mcp` as the server command in the client's MCP configuration.

🧠 For configuration options and the full list of tools, see the [MCP server documentation](https://developers.oxylabs.io/ai-workflows/mcp) and [GitHub](https://github.com/oxylabs/web-api-mcp).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.oxylabs.io/help-center/data-for-llms/how-do-i-use-model-context-protocol-mcp-with-web-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
