> ## Documentation Index
> Fetch the complete documentation index at: https://docs.migraflow.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Instalar e conectar o MCP

> Instalação local, variáveis de ambiente e configuração do cliente MCP.

Requer Python 3.10 ou superior e acesso autorizado ao repositório privado.

## Instale o servidor

<Tabs>
  <Tab title="Windows (PowerShell)">
    ```powershell theme={null}
    git clone https://github.com/Migraflow/mcp-server.git
    cd mcp-server
    py -m venv .venv
    .\.venv\Scripts\Activate.ps1
    python -m pip install --upgrade pip
    python -m pip install .
    ```
  </Tab>

  <Tab title="macOS/Linux">
    ```bash theme={null}
    git clone https://github.com/Migraflow/mcp-server.git
    cd mcp-server
    python3 -m venv .venv
    source .venv/bin/activate
    python -m pip install --upgrade pip
    python -m pip install .
    ```
  </Tab>
</Tabs>

## Configure o cliente

Use o caminho absoluto do executável `migraflow-mcp` criado no ambiente virtual. Clientes como Cursor usam um objeto raiz `mcpServers` no `mcp.json`.

```json theme={null}
{
  "mcpServers": {
    "migraflow": {
      "command": "CAMINHO_ABSOLUTO/migraflow-mcp",
      "env": {
        "MIGRAFLOW_API_KEY": "<consultant-key>",
        "MIGRAFLOW_API_URL": "https://api.migraflow.com.br/api/v1"
      }
    }
  }
}
```

No Windows, o executável normalmente termina em `.venv\\Scripts\\migraflow-mcp.exe`. Em macOS/Linux, normalmente está em `.venv/bin/migraflow-mcp`.

<Note>
  A interface exata de cadastro depende do cliente e da política da organização. No Claude Desktop atual, extensões locais também podem ser administradas em **Settings → Extensions**; ambientes corporativos podem desabilitar servidores locais.
</Note>

## Verifique a conexão

Reinicie ou recarregue o cliente e confirme que as ferramentas `validate_schema` e `get_docs_url` aparecem. Execute `get_docs_url` antes de enviar DDL para testar somente o registro do servidor.

## Segurança da credencial

* use uma chave individual de consultor;
* restrinja o arquivo de configuração ao usuário local;
* não inclua a chave no prompt;
* rotacione imediatamente uma chave exposta;
* não use um endpoint diferente sem aprovação.
