How a question becomes a tool call.
An AI agent can understand a customer's request. This gateway decides which telecom tools it may use, checks each action, and records what happened.
The agent picks a tool. The gateway checks account access and inputs before running it. A refund request goes to a human for approval.
A working MCP gateway with fictional accounts and temporary writes. You can inspect a £63 bill, track a router, open a ticket and request £4.50 compensation. No money moves. The hosted demo does not include an AI model; your MCP client supplies one.
“My broadband is down. Can I get compensation?”
The customer makes one request. A connected agent can use several tools to gather evidence before asking for approval. The evaluation suite runs this sequence as a reproducible script.
- 1. Identify the customerA short-lived access pass says “CX-1234, customer.” It does not grant access to anyone else's account.
-
2. Check the network
get_network_statusreturns the affected area and incident. The agent has evidence of the outage. -
3. Check the bill
get_invoice_summarysupplies an invoice reference. The next action uses that returned reference. -
4. Request £4.50 compensation
request_refund_approvalvalidates the amount and creates a pending request. A repeated request uses the same key. - 5. Explain the result honestly“Your request is awaiting supervisor approval. No money has been refunded.” Payment execution is not implemented in v1.
Your account → valid amount → approval request → audit evidence
Another account, forged pass or excessive amount → clear refusal → no business action
The gateway and the systems behind it.
The policy checks are real in both modes. The source of business data changes. The public portfolio uses the synthetic mode.
Temporary tickets and approval requests
Why the boundary matters
The model proposes actions. Server-side code decides whether to execute them. A persuasive prompt cannot grant a new role or another customer's account. Tool results remain untrusted data; the agent must not treat text inside a ticket as an instruction.
The choices behind the build
Compare the architecture choices
These are choices for this project's scope. Each one has a cost as well as a benefit.
| Choice | Why it fits | Alternative & cost |
|---|---|---|
| MCP for agent tools | A client can discover typed tools and call them through a common protocol. | Custom REST works well for fixed apps. MCP adds SDK/protocol compatibility work; the middleware still uses HTTP. |
| Server checks every call | Account ownership and money limits stay enforceable regardless of model output. | Prompt-only rules are easier to write, but cannot serve as authorization. |
| Gateway + middleware | Agent-facing policy and business state have distinct responsibilities. The middleware is the only persistent writer. | A single service is simpler to operate. Two services add network failures, authentication and tracing work. |
| Python, Pydantic & FastAPI | Typed schemas validate calls and generate contracts in the same ecosystem as the MCP SDK. | TypeScript is a strong full-stack alternative. Python adds a separate language alongside the React operations console. |
| MongoDB transactions + outbox | A ticket, its replay record and its event can commit together. Tenant-first indexes match the document model. | PostgreSQL offers strong relational constraints. MongoDB needs a replica set and deliberate indexes; it is not automatically simpler. |
| Container Apps for this demo | Managed HTTPS ingress and container revisions support deploy, probe and rollback with little cluster administration. | AKS offers more control but adds cluster operations. One warm replica reduces cold starts but has a running cost and no replica redundancy. |
| Synthetic public demo | Visitors can test policy and failure cases without exposing real customers or billing systems. | Real OSS/BSS integrations would prove operational fidelity, but need credentials, contracts, persistent state and reconciliation. |
| Human approval before execution | Refund intent is recorded without allowing an agent to transfer funds. | Autonomous payment is faster but needs financial controls. V1 does not execute payments even after approval. |
Where each piece of AI engineering belongs
Follow the engineering lifecycle
- Data ingestion
- The demo loads bundled JSON fixtures. The integration mode reads telecom state through the middleware API. There is no scraping or training-data pipeline here.
- Data cleaning
- Pydantic validates IDs, currencies, dates and bounded inputs. Money uses decimal values. Idempotency prevents duplicate writes; it is not a bulk data-cleaning service.
- Modeling
- An external agent chooses tools using their descriptions and schemas. This repository provides the tools and policy layer; it does not train a model or run a RAG knowledge base.
- Integration
- MCP exposes tools to agents. FastAPI exposes business operations. The browser demo uses the same authenticated MCP HTTP route.
- Monitoring
- Live calls, failures, replay counts, approval handoffs and latency are measured. CI checks contracts; a scheduled probe checks deployed health and authorization. CSAT and model cost require additional data.
- Ownership
- Versioned decisions explain tradeoffs. CI evidence, deployment verification, rollback and restore procedures show how the system is maintained.
What the evaluations measure
Run the evaluation dashboard → Each check includes an expected result, an actual result and a pass/fail decision. Tests use isolated synthetic data, separate from visitor counters.
Tool selection & arguments
Does a call use a valid schema and produce the expected telecom result? Model selection accuracy requires an actual model run against labeled customer prompts; scripted calls do not measure it.
Multi-step completion
Can outage evidence and invoice data lead to a pending compensation request? Can a router enquiry become one ticket despite a retry? These are scripted journeys.
Description clarity
A transparent rubric checks purpose, customer scope, write-key guidance and approval language. This detects missing guidance; it does not establish human comprehension.
Protocol & integration
Initialize, discover tools, call them and handle invalid requests through the real MCP SDK and HTTP stack. Public HTTPS is checked after deployment.
Security boundaries
Reject forged identities, another customer's account, excessive refunds and customer access to privileged metrics.
Production reliability
Check readiness and repeated-write safety. CI also covers cancellation, circuit breakers and transactions. Small synthetic runs cannot establish production availability or capacity.
How to read the KPIs and model scores
Pass rate = passing assertions ÷ executed assertions. Journey completion = journeys satisfying every final-state assertion ÷ journeys attempted. Duplicate prevention counts safe replays, not estimated money saved. p95 is the nearest-rank duration of timed synthetic scenarios on that run; it includes some multi-call journeys and is not a per-request latency SLO.
The dashboard also publishes a dated Azure OpenAI gpt-5.4-mini run on 12 authored prompts: 11/12 exact tool plans, 10/10 argument checks, 2/2 multi-step journeys and 12/12 requested outcomes. One extra invoice lookup lowers exact-plan accuracy while preserving completion. These small-sample scores are regression evidence, not a general accuracy claim. Customer satisfaction, first-contact resolution and financial savings need real outcomes and are not inferred from this demo.
Connect your first agent
New to MCP? The setup guide creates your configuration and walks through your first question.
Quick setup for developers
-
Request a temporary credential from
POST https://mcp.arshadify.online/demo/session. -
Configure streamable HTTP at
https://mcp.arshadify.online/mcp/withAuthorization: Bearer <access_token>. -
Initialize the MCP session and list tools. Use
customer
CX-1234. - Try “What is my outstanding balance?” and “Check my router order ORD-9001.”
The token expires after ten minutes. Obtain another when it expires. This is a demo credential endpoint, not an OAuth login flow; clients that require OAuth discovery need a manually configured Bearer token or a compatible bridge.
Command-line example (PowerShell)
$session = Invoke-RestMethod -Method Post -Uri https://mcp.arshadify.online/demo/session
$headers = @{
Authorization = "Bearer $($session.access_token)"
Accept = "application/json, text/event-stream"
}
$body = '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Invoke-RestMethod -Method Post -Uri https://mcp.arshadify.online/mcp/ `
-Headers $headers -ContentType application/json -Body $body
Never commit the credential or paste it into a public issue. The browser demo keeps its credential only in memory.
A repeatable path from source to service
Read the deployment and maintenance notes
GitHub Actions authenticates to Azure with a federated identity. The deployment uses an image digest, verifies the live service and can restore the previous protected demo revision. The scheduled probe checks the deployed application independently.
git clone https://github.com/arshad98333/telecom-ai-gateway.git cd telecom-ai-gateway/telecom-mcp uv sync --all-extras --frozen --python 3.12 uv run pytest uv run python -m telecom_mcp.evaluations --output ../artifacts/evaluation.json
Deployment runbook · Backup and restore · CI evidence
The hosted demo runs one replica. Its writes and counters reset on restart. Global demo rate limits can briefly affect all visitors. There is no real finance integration, production availability measurement or built-in LLM. Persistent, multi-replica operation requires the documented production dependencies.
A small glossary
Look up a term
- Agent
- Software that uses a model to decide which actions to take toward a goal.
- MCP
- A shared format for discovering and calling tools from an AI application.
- Tool
- A named operation with defined inputs and outputs, such as checking an invoice.
- Token / scope
- An access pass, and the list of actions that pass allows.
- Idempotency
- Repeating the same request returns the same outcome instead of creating another ticket.
- Outbox
- An event record saved in the same transaction as a business change, ready for later delivery.
- Evaluation
- A repeatable scenario that compares an actual outcome with an expected one.