MCP

Outros clientes

Conecte qualquer cliente MCP compatível com Streamable HTTP.

Configuração genérica

CampoValor
URLhttps://livetp.app/mcp
TransporteStreamable HTTP
AutenticaçãoOAuth (DCR) ou Authorization: Bearer ltp_mcp_...

Clientes com OAuth descobrem a autenticação na primeira resposta 401 e abrem o login automaticamente. Em arquivos de configuração no formato comum mcpServers:

mcp.json
{
  "mcpServers": {
    "livetp": {
      "url": "https://livetp.app/mcp",
      "headers": { "Authorization": "Bearer ${LIVETP_MCP_KEY}" }
    }
  }
}

A sintaxe para variáveis de ambiente varia entre clientes. Consulte a documentação do seu.

Testando com cURL

Liste as ferramentas disponíveis para uma chave:

curl 'https://livetp.app/mcp' \
  -H "Authorization: Bearer $LIVETP_MCP_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2025-11-25' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Chame uma ferramenta:

curl 'https://livetp.app/mcp' \
  -H "Authorization: Bearer $LIVETP_MCP_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2025-11-25' \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": { "name": "list_scripts", "arguments": { "status": "ready" } }
  }'

Veja o protocolo completo em Endpoint MCP.

SDK oficial

Com o SDK TypeScript do MCP, use o transporte Streamable HTTP e envie a chave no header:

import { Client, StreamableHTTPClientTransport } from "@modelcontextprotocol/client";

const client = new Client({ name: "meu-app", version: "1.0.0" });
await client.connect(
  new StreamableHTTPClientTransport(new URL("https://livetp.app/mcp"), {
    requestInit: {
      headers: { Authorization: `Bearer ${process.env.LIVETP_MCP_KEY}` },
    },
  }),
);

const result = await client.callTool({
  name: "create_script",
  arguments: { title: "Teste", content: "Olá!", status: "draft" },
});