DataBolsa docs
Servidor MCP

Servidor remoto

Endpoint MCP hospedado (Streamable HTTP) com OAuth e chave de API.

https://mcp.databolsa.com/mcp

Transporte Streamable HTTP (spec MCP), stateless. Métodos POST/GET/DELETE.

Autenticação

Dois formatos no header Authorization, no mesmo endpoint:

  1. OAuth 2.0 — para clientes com suporte (claude.ai, ChatGPT, Claude Code). Descoberta padrão:
    • https://mcp.databolsa.com/.well-known/oauth-protected-resource
    • authorization server em https://databolsa.com (authorize/token/registration via /.well-known/oauth-authorization-server), com PKCE (S256) e dynamic client registration.
  2. Chave de APIAuthorization: Bearer db_live_… (crie aqui).

Sem credencial válida o servidor responde 401 com o desafio WWW-Authenticate apontando o resource metadata — clientes MCP iniciam o fluxo OAuth sozinhos a partir daí.

Teste rápido com curl

curl -s https://mcp.databolsa.com/mcp \
  -H "Authorization: Bearer db_live_SUACHAVE" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"getStock","arguments":{"ticker":"PETR4"}}}'

Boas práticas

  • Prefira OAuth em apps de usuário final: a credencial é revogável por conexão e o usuário nunca copia chave.
  • Em servidores/CI, use a chave de API via variável de ambiente ou secret store.
  • Respostas de erro seguem application/problem+json (RFC 9457), inclusive o 429 de limite diário (com Retry-After).