Model Context Protocol (MCP) Server
Connect your AI tools and agents to Network as Code using the Model Context Protocol (MCP). Once connected, your AI assistants can interact with Network as Code APIs, query your applications, and help you build programmable mobile network features.
What is MCP?
The Model Context Protocol (MCP) is an open standard that enables Large Language Models (LLMs) to securely connect to external platforms and APIs. With the Network as Code MCP server, you can use AI agents in editors like Cursor, VS Code, and Claude to access network capabilities, manage applications, and interact with our APIs through agents.
Installation
To install the Network as Code MCP server:
- Navigate to the API playground
- Click the MCP Playground button on the left sidebar
- Copy the configuration snippet and add it according to the installation instructions of your AI tool (Cursor, VS Code, Windsurf, Claude Desktop, etc.)
Available tools
Once connected, the Network as Code MCP server provides AI agents with direct access to network capabilities through MCP tools. These tools map directly to the Network as Code APIs, allowing your AI assistant to directly interact with mobile network features.
The MCP server exposes tools that enable AI agents to:
Network Quality Management
- Create and manage Quality on Demand (QoD) sessions to prioritize network traffic
- Extend session durations and retrieve session information
- Query and monitor QoD sessions for specific devices
Device Status & Connectivity
- Check device roaming status and country information
- Monitor device reachability and connectivity (data, SMS, or disconnected)
- Subscribe to device status change events with webhooks
- Retrieve connectivity status information
Location Services
- Verify if a device is within a specified geographic area
- Retrieve the current location of a device
- Create geofencing subscriptions for area entry/exit notifications
Security & Verification
- Detect SIM swap events within a specified time period
- Verify phone numbers with silent authentication
- Check device swap history
- Detect call forwarding status
Network Slicing
- Create, activate, and deactivate network slices
- Attach and detach devices from network slices
- Manage slice configurations and query slice information
- Handle network slice subscriptions
Know Your Customer (KYC)
- Match customer identity attributes against verified data
- Verify customer age against specified thresholds
- Check customer tenure (subscription length)
- Retrieve customer information for form filling
Congestion Insights
- Query historical and predicted network congestion levels
- Subscribe to congestion status notifications
- Monitor network performance for specific devices
Using the MCP server
Getting started
After installation, verify the connection by asking your AI agent to interact with Network as Code APIs. For example:
Check if device with phone number +1234567890 is currently roaming
The AI agent will use the appropriate MCP tools to query the device status and provide you with the information.
Example prompts
Here are some useful prompts to try with your AI agent:
Quality on Demand:
Create a Quality on Demand session for my device to ensure low latency
for the next 30 minutes
Device verification:
Verify the location of device with phone number +1234567890
using Network as Code APIs
SIM Swap detection:
Check if there was a SIM swap for phone number +1234567890
in the last 7 days
Network Slicing:
Show me all available network slices and their current status
Geofencing:
Create a geofencing subscription to notify me when device +1234567890
enters or exits the area around latitude 40.7128, longitude -74.0060
with a radius of 1km
Best practices
When using the Network as Code MCP server:
- Review tool calls: Always review what the AI agent plans to do before approving tool calls
- Use development environments: Test with development applications before using production credentials
- Scope appropriately: Limit the MCP server to specific applications when possible
- Monitor usage: Keep track of API calls made through the MCP server in your Console
Security considerations
Protecting your data
- Never use with production data: Use the MCP server with development or test environments only
- Enable manual approval: Configure your MCP client to require manual approval for each tool call
- Review all actions: Carefully review tool calls before execution, especially those that modify resources
- Use read-only mode: If available in your MCP client, enable read-only mode to prevent accidental modifications
Prompt injection risks
AI agents can be vulnerable to prompt injection attacks. To mitigate risks:
- Don't expose the MCP server to end users or customers
- Always review AI-generated API calls before execution
- Use the MCP server as an internal developer tool only
- Keep your MCP client and AI tools updated with the latest security patches
Troubleshooting
Connection issues
If your MCP client can't connect to the Network as Code server:
- Verify your internet connection
- Check that your API key is correctly configured in the MCP settings
- Restart your editor or MCP client
- Check your MCP client logs for error messages
Authentication failures
If authentication fails:
- Verify your API key is valid and active in the Console
- Check that you've copied the API key correctly (no extra spaces)
- Try generating a new API key from your application dashboard
- Ensure you have the necessary permissions on your account
Last updated January 22, 2026