mcp-asterisk-socle
Provides secure supervision of an Asterisk PBX, with planned tools for ARI/AMI channel listing, analysis, listening, and call control actions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-asterisk-socleliste les canaux actifs du PBX"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Module 1 — Socle Framework MCP & Sécurité
Serveur MCP sécurisé pour la supervision d'un PBX Asterisk.
Responsables : Khadim GUEYE, Gnilane NIANE Projet : Supervision Asterisk via Model Context Protocol
Ce module fournit le socle sur lequel se branchent :
Module 2 — Outils de supervision Asterisk (ARI/AMI)
Module 3 — Pipeline vocal Speech-to-Speech
Démarrage rapide
git clone https://github.com/Bamba4700/mcp-asterisk-socle.git
cd mcp-asterisk-socle
docker compose up -dTrois conteneurs démarrent :
Service | Port | Rôle |
| interne | Base PostgreSQL de Keycloak |
| 8080 | Serveur d'identité (realm importé automatiquement) |
| 8000 | Le serveur MCP |
Console Keycloak : http://localhost:8080 (admin / admin)
Endpoint MCP : http://localhost:8000/mcp
Related MCP server: enterprise-auth-mcp-server
Comptes de test
Utilisateur | Mot de passe | Rôle |
|
|
|
|
|
|
|
|
|
Obtenir un jeton JWT
source load_secret.sh # récupère le client_secret depuis Keycloak
curl -s -X POST http://localhost:8080/realms/mcp-asterisk/protocol/openid-connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=password" \
-d "client_id=mcp-server" \
-d "client_secret=$KC_CLIENT_SECRET" \
-d "username=admin_demo" \
-d "password=admin"Le jeton est valable 5 minutes.
Ajouter un outil (Modules 2 et 3)
Créez votre fichier dans src/tools/, puis importez-le dans src/server.py.
Outil de lecture (RBAC seul)
from fastmcp.server.dependencies import CurrentAccessToken
from src.server import mcp
from src.security.rbac import require_role
from src.hitl.sanitizer import sanitize
@mcp.tool()
def list_active_channels(token=CurrentAccessToken()) -> dict:
"""Liste les canaux actifs du PBX."""
require_role(token, "operateur")
resultat = ... # votre code ARI/AMI
return sanitize(resultat)Outil de pilotage (RBAC + confirmation humaine)
from fastmcp import Context
from src.hitl.confirmation import demander_confirmation
@mcp.tool()
async def hangup_channel(
channel_id: str,
ctx: Context,
token=CurrentAccessToken(),
) -> str:
"""Raccroche un canal Asterisk."""
require_role(token, "admin")
await demander_confirmation(
ctx, f"Confirmez le raccrochage du canal {channel_id} ?"
)
... # votre code ARI/AMI
return sanitize(f"Canal {channel_id} raccroche.")Règles à respecter
Tout outil appelle
require_role(token, "...")en première ligneTout outil de pilotage appelle
demander_confirmation(...)avant d'agirToute sortie passe par
sanitize(...)avant d'être retournée
Sécurité implémentée
Exigence (cahier des charges A.6) | Implémentation |
RBAC 3 rôles |
|
Jetons JWT via Keycloak (OIDC) |
|
Interdiction du token passthrough | Le jeton n'authentifie que la session MCP |
Consentement humain obligatoire |
|
Sorties = entrées non fiables |
|
Avertissement
Cette configuration est destinée au développement local.
Avant tout déploiement réel : changer les mots de passe (admin/admin,
POSTGRES_PASSWORD), activer HTTPS, et remplacer start-dev par start.
This server cannot be deployed
Maintenance
Related MCP Connectors
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
Hash passwords with bcrypt and issue/verify JWT session tokens over A2A + MCP.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Related MCP Servers
- AlicenseAqualityAmaintenanceSecurity-enforcing MCP proxy that sits between an AI agent and any number of downstream MCP servers, intercepting every tool call through a capability-token policy gateway that can allow, deny, or escalate to human approval before the call reaches any real tool. It also exposes built-in operator tools for approval workflows, audit trail queries, token management, voice/HUD output, and hierarchical2114Apache 2.0
- AlicenseAqualityDmaintenanceMCP server for enterprise authentication and authorization — JWT validation, OIDC token inspection, OAuth 2.0 introspection, and role-based access control for AI agents.8MIT
- AlicenseNot gradedqualityDmaintenanceProvides a secure gRPC transport layer for the Model Context Protocol (MCP) with mutual TLS, token-based authentication, and fine-grained authorization. Includes comprehensive telemetry and a real-time visualization dashboard for monitoring AI model interactions and security events.1Apache 2.0
- AlicenseAqualityAmaintenanceAn MCP server that lets AI assistants inspect and control Asterisk and FreeSWITCH PBX systems, enabling natural language queries about live switch status, channels, registrations, and call control.1037 npm16MIT