Skip to main content
Glama
ANTIGRAVITY_SETUP.md6.91 kB
# Instalação do MCP Server no Antigravity Este guia explica como configurar o MCP Server do Portainer para uso com o Antigravity IDE. ## Arquitetura ``` ┌──────────────────────────────────────────────────────────┐ │ Seu Computador Local │ │ ┌─────────────────────────────────────────────────────┐ │ │ │ Antigravity IDE ←──MCP──→ MCP Server (Node.js) │ │ │ └─────────────────────────────────────────────────────┘ │ └──────────────────────────────────────────────────────────┘ │ ▼ HTTPS (API) ┌──────────────────────────────────────────────────────────┐ │ VPS 65.109.14.53 │ │ ┌─────────────────────────────────────────────────────┐ │ │ │ Portainer (portainer.onlitec.com.br) │ │ │ │ │ │ │ │ │ └──────► Docker Engine │ │ │ └─────────────────────────────────────────────────────┘ │ └──────────────────────────────────────────────────────────┘ ``` ## Instalação Local ### 1. Clonar o Repositório Na sua máquina local: ```bash git clone https://github.com/onlitec/VPS-MCP-SERVER.git cd VPS-MCP-SERVER ``` ### 2. Instalar Dependências ```bash npm install ``` ### 3. Configurar Credenciais ```bash cp .env.example .env ``` Edite o arquivo `.env`: ```env PORTAINER_URL=https://portainer.onlitec.com.br PORTAINER_API_KEY=ptr_sua_chave_aqui PORTAINER_ENDPOINT_ID=1 ``` ### 4. Build ```bash npm run build ``` ### 5. Testar Conexão ```bash npm run test:connection ``` ## Configuração no Antigravity ### Passo 1: Abrir Configurações do MCP No Antigravity, vá para: - **Settings** (⚙️) → **MCP Servers** ### Passo 2: Configuração Manual (Bypass da UI) Se o painel do Antigravity não permitir adicionar servidores personalizados, você deve editar o arquivo de configuração manualmente. 1. **Localize o arquivo de configuração** do MCP no seu computador: - **Windows**: `%APPDATA%\Antigravity\config.json` (ou procure por `claude_desktop_config.json` se estiver usando Claude) - **macOS**: `~/Library/Application Support/Antigravity/config.json` - **Linux**: `~/.config/Antigravity/config.json` 2. **Edite o arquivo** e adicione o servidor `portainer` dentro do bloco `mcpServers`. **Exemplo de configuração (Mac/Linux):** ```json { "mcpServers": { "portainer": { "command": "node", "args": ["/home/seu-usuario/VPS-MCP-SERVER/dist/index.js"] } } } ``` **Exemplo de configuração (Windows):** ```json { "mcpServers": { "portainer": { "command": "node", "args": ["C:\\Users\\seu-usuario\\VPS-MCP-SERVER\\dist\\index.js"] } } } ``` > **Nota**: Não esqueça de ajustar o caminho para onde você clonou o repositório. ### Alternativa: Via SSH (se não quiser rodar node localmente) Se preferir que o MCP rode no servidor e o Antigravity apenas conecte via SSH: ```json { "mcpServers": { "portainer": { "command": "ssh", "args": [ "-o", "StrictHostKeyChecking=no", "alfreire@65.109.14.53", "alias node='/usr/bin/node'; cd /home/alfreire/MCP-SERVER && node dist/index.js" ] } } } ``` > **Nota**: Não é necessário configurar a API key aqui! O MCP irá solicitar quando você tentar usar. ### Passo 3: Reiniciar Antigravity Feche e abra o Antigravity para carregar o MCP Server. ### Passo 4: Configurar API Key via MCP No chat do Antigravity, use o comando: ``` Configure o Portainer com: - URL: https://portainer.onlitec.com.br - API Key: ptr_sua_chave_aqui - Endpoint ID: 1 ``` O MCP usará a ferramenta `set_portainer_config` automaticamente. **Alternativa**: Se preferir passar as credenciais diretamente no JSON: ```json { "mcpServers": { "portainer": { "command": "node", "args": ["/caminho/para/VPS-MCP-SERVER/dist/index.js"], "env": { "PORTAINER_URL": "https://portainer.onlitec.com.br", "PORTAINER_API_KEY": "ptr_sua_chave_aqui", "PORTAINER_ENDPOINT_ID": "1" } } } } Adicione a seguinte configuração (ajuste o caminho conforme onde você clonou): **Linux/macOS:** ```json { "mcpServers": { "portainer": { "command": "node", "args": ["/caminho/para/VPS-MCP-SERVER/dist/index.js"], "env": { "PORTAINER_URL": "https://portainer.onlitec.com.br", "PORTAINER_API_KEY": "ptr_sua_chave_aqui", "PORTAINER_ENDPOINT_ID": "1" } } } } ``` **Windows:** ```json { "mcpServers": { "portainer": { "command": "node", "args": ["C:\\caminho\\para\\VPS-MCP-SERVER\\dist\\index.js"], "env": { "PORTAINER_URL": "https://portainer.onlitec.com.br", "PORTAINER_API_KEY": "ptr_sua_chave_aqui", "PORTAINER_ENDPOINT_ID": "1" } } } } ``` ### Passo 3: Reiniciar Antigravity Feche e abra o Antigravity para carregar o MCP Server. ## Ferramentas Disponíveis (20 tools) ### Containers - `list_containers`, `get_container`, `start_container`, `stop_container` - `restart_container`, `remove_container`, `create_container` ### Imagens - `list_images`, `get_image`, `pull_image`, `remove_image` ### Networks - `list_networks`, `create_network`, `remove_network` ### Volumes - `list_volumes`, `create_volume`, `remove_volume` ### Configuração - `set_portainer_config`, `get_portainer_config`, `test_portainer_connection` ## Troubleshooting ### Erro de conexão HTTPS - Verifique se a URL `https://portainer.onlitec.com.br` está acessível - Confirme que o certificado SSL é válido ### Erro de autenticação (401) - Regenere a chave de API no Portainer - Atualize a chave no `.env` ou na configuração do Antigravity ### Node.js não encontrado - Instale Node.js 18+ na sua máquina local - Verifique: `node --version`

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/onlitec/VPS-MCP-SERVER'

If you have feedback or need assistance with the MCP directory API, please join our Discord server