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

# Como uso o Model Context Protocol (MCP) com a Web API?

Aprenda a conectar um cliente MCP à Web API.

MCP é opcional. Suas solicitações existentes para [API da Web](https://developers.oxylabs.io/products/web-api) continuam funcionando, e você pode conectar o servidor MCP sempre que quiser que um agente de IA chame a Web API diretamente.

### **Conecte-se ao servidor MCP da Oxylabs**

O servidor MCP remoto é hospedado e mantido pela Oxylabs, então não há nada para instalar.

{% stepper %}
{% step %}
No painel, crie uma instância da Web API e copie a chave de API.
{% endstep %}

{% step %}
Adicione sua chave de API ao ambiente:

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

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

{% endcode %}
{% endstep %}

{% step %}
Adicione o servidor ao seu 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 (+ outros)" icon="cursor" %}
Para qualquer cliente que suporte servidores MCP remotos com cabeçalhos personalizados, adicione a URL do servidor e um `Authorization` cabeçalho à configuração MCP do 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}"
      }
    }
  }
}
```

Os nomes dos campos podem variar entre clientes – confira a documentação do seu cliente para saber como adicionar um servidor MCP remoto com cabeçalhos.
{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**Observação:** O MCP remoto funciona com clientes que suportam servidores MCP remotos com cabeçalhos personalizados. Clientes que suportam apenas login OAuth, como conectores personalizados na interface web do claude.ai, não conseguem se conectar a ele. Se o seu cliente se encaixa nesse grupo, ou se você preferir executar o servidor você mesmo, use a [opção de auto-hospedagem](https://developers.oxylabs.io/ai-workflows/mcp#option-2-self-hosted-mcp).
{% endhint %}

🧠 Para configuração, auto-hospedagem e a lista completa de ferramentas, veja [documentação do servidor MCP](https://developers.oxylabs.io/ai-workflows/mcp) e [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/pt-br/dados-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.
