MCP Server

Integre TestQubit com sua IDE ou agent favorito via Model Context Protocol

O servidor MCP do TestQubit expoe ferramentas de geracao de testes diretamente na sua IDE ou agent. Nao precisa sair do editor para escrever testes.

Iniciar o Servidor

# Iniciar o servidor MCP do TestQubit
testqubit mcp start

# Por padrão roda em stdio (para integração com IDEs)
# Porta customizada para modo HTTP:
testqubit mcp start --port 3001

Cursor

Adicione o TestQubit ao Cursor editando o arquivo de configuracao MCP:

~/.cursor/mcp.json
{
  "mcpServers": {
    "testqubit": {
      "command": "testqubit",
      "args": ["mcp", "start"]
    }
  }
}

VS Code

Instale a extensao MCP e configure no settings.json:

# Instalar a extensão MCP para VS Code
code --install-extension anthropic.mcp

# Adicionar ao settings.json (Ctrl+, > Open Settings JSON)
settings.json
{
  "mcp.servers": {
    "testqubit": {
      "command": "testqubit",
      "args": ["mcp", "start"]
    }
  }
}

Hermes Agent

O Hermes Agent tem suporte nativo a MCP. Adicione via CLI ou config.yaml:

# Adicionar via CLI do Hermes
hermes mcp add testqubit --command "testqubit mcp start"
~/.hermes/config.yaml
mcp:
  servers:
    testqubit:
      command: testqubit
      args: ["mcp", "start"]
      transport: stdio

Apos adicionar, reinicie o Hermes e verifique:

# Verificar se o servidor MCP está ativo
hermes mcp list

# Usar dentro de uma conversa
> "Gere testes para src/utils/calculator.ts usando testqubit"

Claude Desktop

Configure no arquivo de configuracao do Claude Desktop:

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) ou %APPDATA%/Claude/claude_desktop_config.json (Windows)
{
  "mcpServers": {
    "testqubit": {
      "command": "testqubit",
      "args": ["mcp", "start"]
    }
  }
}

Windsurf (Codeium)

Adicione nas configuracoes de MCP Servers do Windsurf:

Windsurf Settings > MCP Servers
{
  "testqubit": {
    "command": "testqubit",
    "args": ["mcp", "start"]
  }
}

Zed

~/.config/zed/settings.json
{
  "mcp_servers": {
    "testqubit": {
      "command": "testqubit",
      "args": ["mcp", "start"]
    }
  }
}

Neovim

init.lua (com nvim-mcp)
require('mcp').setup({
  servers = {
    testqubit = {
      cmd = { 'testqubit', 'mcp', 'start' },
    },
  },
})

Ferramentas Disponiveis

O servidor MCP expoe estas ferramentas para a IDE/agent:

testqubit_analyzeAnalisa codigo-fonte e retorna estrutura (funcoes, classes, imports)
testqubit_generateGera testes unitarios/integracao para um arquivo ou diretorio
testqubit_healCorrige testes quebrados automaticamente
testqubit_mutationExecuta mutation testing e reporta mutantes sobreviventes
testqubit_configLe/escre configuracao do TestQubit

Troubleshooting

Servidor MCP nao inicia

Verifique se testqubit esta instalado globalmente: npm i -g testqubit

Erros de autenticacao

Rode testqubit auth login para autenticar antes de iniciar o MCP

docs.mcp.tsDebugQ

TESTQUBIT_MCP_DEBUG=true testqubit mcp start