mcp-asterisk-socle
Provides secure supervision of an Asterisk PBX, with planned tools for ARI/AMI channel listing, analysis, listening, and call control actions.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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: Secure MCP-gRPC
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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Managed MCP gateway with OAuth, per-agent permissions, shared accounts and activity logs.
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.
Hosted remote MCP for protected account access, permissions, activity history and supported undo.
Related MCP Servers
- 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
- FlicenseNot gradedqualityBmaintenanceMCP server that exposes IPBX PABX data (branches, users, groups, trunks, queues) as typed tools via Streamable HTTP, with OAuth and static bearer authentication.-
- AlicenseAqualityBmaintenanceAn 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.12102 npm20MIT