Serveur MCP (Model Context Protocol) exposant les statistiques d'appels WCB et DID en lecture seule, en façade de l'API Voxolib v2.

⚙️ Prérequis
  • Un compte API Voxolib avec les droits report activés (WCB et/ou DID) : api_public_key + client_secret_key.
  • Un token Enhanced (persistant) calculé ainsi :
    access_token = api_public_key + "." + HMAC_SHA256(api_public_key + "cdr", client_secret_key)
  • Transport : HTTP streamable. Endpoint : https://mcp-dev.agent.voxolib.com/mcp
  • Auth : en-tête Authorization: Bearer <access_token>
Calculer le token (exemples)
# bash / openssl
PK=votre_api_public_key ; SECRET=votre_client_secret_key
HMAC=$(printf "%s" "${PK}cdr" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.* //')
echo "${PK}.${HMAC}"

# python
import hmac, hashlib
token = f"{pk}." + hmac.new(secret.encode(), (pk+"cdr").encode(), hashlib.sha256).hexdigest()
🛠️ Outils exposés
ToolDescription
voxolib_wcb_callsVolumes d'appels WCB par jour + répartition par statut (status_breakdown)
voxolib_did_callsVolumes d'appels entrants sur DIDs par jour + status_breakdown
voxolib_didsNombre de DIDs du compte (total + active/suspended/other)
voxolib_minutes_reportMinutes fixe/mobile/intl + billable par jour (product=wcb|did) — déploiement admin

Paramètres (tools d'appels) : start_date, end_date (YYYY-MM-DD, ≤90 j), tz (défaut Europe/Paris). voxolib_dids : sans paramètre.

Intégrations

🟣 Claude (Anthropic)

Claude Code (CLI) :

claude mcp add --transport http voxolib-stats https://mcp-dev.agent.voxolib.com/mcp \
  --header "Authorization: Bearer <access_token>"

Claude Desktop : Réglages → ConnectorsAdd custom connector → URL https://mcp-dev.agent.voxolib.com/mcp, en-tête Authorization: Bearer <access_token>.

🟢 OpenAI / ChatGPT

API (Responses / Agents) — déclarer un outil de type mcp :

{
  "type": "mcp",
  "server_label": "voxolib-stats",
  "server_url": "https://mcp-dev.agent.voxolib.com/mcp",
  "headers": { "Authorization": "Bearer <access_token>" },
  "require_approval": "never"
}

ChatGPT (Pro/Business, mode développeur) : Paramètres → Connectors → connecteur MCP personnalisé → même URL + en-tête.

🟠 Mistral

Le Chat : Paramètres → Connecteurs / MCP → ajouter un serveur MCP distant → URL https://mcp-dev.agent.voxolib.com/mcp + en-tête Authorization: Bearer <access_token>.

SDK (Agents API) : rattacher un serveur MCP distant via mcp_servers (transport HTTP streamable) avec le même endpoint et l'en-tête d'autorisation.

Le serveur ne stocke aucun secret : il relaie votre token à l'API Voxolib, qui reste seule autorité d'authentification (un token invalide renvoie 401). Données en lecture seule, agrégées.

Endpoint MCP : https://mcp-dev.agent.voxolib.com/mcp · santé : /healthz