> 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/es/datos-para-llms/how-do-i-use-model-context-protocol-mcp-with-web-api.md).

# ¿Cómo uso Model Context Protocol (MCP) con Web API?

Aprende a conectar un cliente MCP a Web API.

MCP es opcional. Tus solicitudes existentes a [Web API](https://developers.oxylabs.io/products/web-api) seguirán funcionando, y puedes conectar el servidor MCP cuando quieras que un agente de IA llame a Web API directamente.

### **Conéctate al servidor MCP de Oxylabs**

El servidor MCP remoto está alojado y mantenido por Oxylabs, así que no hay nada que instalar.

{% stepper %}
{% step %}
En el panel, crea una instancia de Web API y copia su clave de API.
{% endstep %}

{% step %}
Añade tu clave de API al entorno:

{% code overflow="wrap" expandable="true" %}

```bash
export OXYLABS_WEB_API_KEY="your_api_key_here"
```

{% endcode %}
{% endstep %}

{% step %}
Añade el servidor a tu cliente MCP.

{% tabs %}
{% tab title="Claude Code" icon="claude" %}

```bash
claude mcp add --transport http --scope user oxylabs-web-api \
  https://mcp.oxylabs.io/web-api-mcp \
  --header "Authorization: Bearer ${OXYLABS_WEB_API_KEY}"
```

{% endtab %}

{% tab title="ChatGPT/Codex" icon="openai" %}

```bash
codex mcp add oxylabs-web-api \
  --url https://mcp.oxylabs.io/web-api-mcp \
  --bearer-token-env-var OXYLABS_WEB_API_KEY
```

{% endtab %}

{% tab title="Cursor (+ otros)" icon="cursor" %}
Para cualquier cliente que admita servidores MCP remotos con encabezados personalizados, añade la URL del servidor y un `Authorization` encabezado a la configuración MCP del cliente. Para Cursor `mcp.json`:

```json
{
  "mcpServers": {
    "oxylabs-web-api": {
      "url": "https://mcp.oxylabs.io/web-api-mcp",
      "headers": {
        "Authorization": "Bearer ${env:OXYLABS_WEB_API_KEY}"
      }
    }
  }
}
```

Los nombres de los campos pueden diferir entre clientes: consulta la documentación de tu cliente para saber cómo añadir un servidor MCP remoto con encabezados.
{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**Nota:** Remote MCP funciona con clientes que admiten servidores MCP remotos con encabezados personalizados. Los clientes que solo admiten inicio de sesión OAuth, como los conectores personalizados en la interfaz web de claude.ai, no pueden conectarse a él. Si tu cliente pertenece a ese grupo, o prefieres ejecutar el servidor tú mismo, usa la [opción de autoalojamiento](https://developers.oxylabs.io/ai-workflows/mcp#option-2-self-hosted-mcp).
{% endhint %}

🧠 Para la configuración, el autoalojamiento y la lista completa de herramientas, consulta [documentación del servidor MCP](https://developers.oxylabs.io/ai-workflows/mcp) y [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/es/datos-para-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.
