|
| 1 | +# NCM MCP Servers |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +A suite of three focused MCP (Model Context Protocol) servers for the Ericsson Enterprise Wireless NCM API, split by domain responsibility for optimal LLM tool selection. |
| 6 | + |
| 7 | +## Architecture |
| 8 | + |
| 9 | +| Server | Port | Domain | Tools | |
| 10 | +|--------|------|--------|-------| |
| 11 | +| `ncm-fleet` | 3001 | Routers, groups, accounts, locations, configurations, firmware, products | 17 | |
| 12 | +| `ncm-monitoring` | 3002 | Net devices, alerts/logs, speed tests | 6 | |
| 13 | +| `ncm-cloud-services` | 3003 | Users, subscriptions, private cellular, exchange | 13 | |
| 14 | + |
| 15 | +All servers default to **Streamable HTTP transport** and run together in a single container. |
| 16 | + |
| 17 | +## Quick Start |
| 18 | + |
| 19 | +### 1. Install |
| 20 | + |
| 21 | +```bash |
| 22 | +cd ncm_mcp_servers |
| 23 | +pip install -e . |
| 24 | +``` |
| 25 | + |
| 26 | +### 2. Configure Credentials |
| 27 | + |
| 28 | +Copy the example and fill in your values: |
| 29 | + |
| 30 | +```bash |
| 31 | +cp credentials.example.json credentials.json |
| 32 | +``` |
| 33 | + |
| 34 | +```json |
| 35 | +{ |
| 36 | + "X_CP_API_ID": "your-cp-api-id", |
| 37 | + "X_CP_API_KEY": "your-cp-api-key", |
| 38 | + "X_ECM_API_ID": "your-ecm-api-id", |
| 39 | + "X_ECM_API_KEY": "your-ecm-api-key", |
| 40 | + "NCM_API_TOKEN": "your-v3-bearer-token" |
| 41 | +} |
| 42 | +``` |
| 43 | + |
| 44 | +Alternatively, set environment variables with the same names. |
| 45 | + |
| 46 | +### 3. Run (Docker — recommended) |
| 47 | + |
| 48 | +```bash |
| 49 | +docker compose up --build |
| 50 | +``` |
| 51 | + |
| 52 | +Or build and run manually: |
| 53 | + |
| 54 | +```bash |
| 55 | +docker build -t ncm-mcp-servers . |
| 56 | +docker run -p 3001:3001 -p 3002:3002 -p 3003:3003 \ |
| 57 | + -v ./credentials.json:/app/credentials.json:ro \ |
| 58 | + ncm-mcp-servers |
| 59 | +``` |
| 60 | + |
| 61 | +This starts a single container running all 3 servers: |
| 62 | +- `http://localhost:3001/mcp` — ncm-fleet |
| 63 | +- `http://localhost:3002/mcp` — ncm-monitoring |
| 64 | +- `http://localhost:3003/mcp` — ncm-cloud-services |
| 65 | + |
| 66 | +### 4. Run (Local, without Docker) |
| 67 | + |
| 68 | +```bash |
| 69 | +# Run all 3 servers in a single process (recommended for local dev) |
| 70 | +ncm-mcp-servers |
| 71 | + |
| 72 | +# Or via python module |
| 73 | +python -m ncm_mcp_servers |
| 74 | +``` |
| 75 | + |
| 76 | +Run servers individually if you only need a subset: |
| 77 | + |
| 78 | +```bash |
| 79 | +ncm-fleet # port 3001 |
| 80 | +ncm-monitoring # port 3002 |
| 81 | +ncm-cloud-services # port 3003 |
| 82 | +``` |
| 83 | + |
| 84 | +Override ports via environment variables: |
| 85 | +```bash |
| 86 | +NCM_FLEET_PORT=4001 ncm-fleet |
| 87 | +NCM_MONITORING_PORT=4002 ncm-monitoring |
| 88 | +NCM_CLOUD_SERVICES_PORT=4003 ncm-cloud-services |
| 89 | +``` |
| 90 | + |
| 91 | +### 5. Transport Options |
| 92 | + |
| 93 | +The default transport is **Streamable HTTP**. Supported transports: |
| 94 | + |
| 95 | +| Transport | Value | Use case | |
| 96 | +|-----------|-------|----------| |
| 97 | +| Streamable HTTP | `streamable-http` (default) | Recommended for all MCP clients | |
| 98 | +| SSE | `sse` | Legacy MCP clients using Server-Sent Events | |
| 99 | +| Stdio | `stdio` | Piped MCP clients (single server only) | |
| 100 | + |
| 101 | +```bash |
| 102 | +# Use SSE transport (legacy) |
| 103 | +MCP_TRANSPORT=sse ncm-mcp-servers |
| 104 | + |
| 105 | +# Use stdio (only works with individual servers, not the unified runner) |
| 106 | +MCP_TRANSPORT=stdio ncm-fleet |
| 107 | +``` |
| 108 | + |
| 109 | +## MCP Client Configuration |
| 110 | + |
| 111 | +Add to your MCP settings (e.g. `.kiro/settings/mcp.json`): |
| 112 | + |
| 113 | +```json |
| 114 | +{ |
| 115 | + "mcpServers": { |
| 116 | + "ncm-fleet": { |
| 117 | + "url": "http://localhost:3001/mcp" |
| 118 | + }, |
| 119 | + "ncm-monitoring": { |
| 120 | + "url": "http://localhost:3002/mcp" |
| 121 | + }, |
| 122 | + "ncm-cloud-services": { |
| 123 | + "url": "http://localhost:3003/mcp" |
| 124 | + } |
| 125 | + } |
| 126 | +} |
| 127 | +``` |
| 128 | + |
| 129 | +## Tool Consolidation Strategy |
| 130 | + |
| 131 | +CRUD operations are consolidated into `manage_*` tools with an `action` parameter: |
| 132 | + |
| 133 | +```python |
| 134 | +manage_router(action="rename", router_id=123, new_name="foo") |
| 135 | +manage_router(action="delete", router_id=123) |
| 136 | +manage_router(action="update", router_id=123, description="bar") |
| 137 | +``` |
| 138 | + |
| 139 | +Read-only metrics are consolidated by type: |
| 140 | + |
| 141 | +```python |
| 142 | +get_net_device_metrics(metric_type="signal", net_device=1) |
| 143 | +get_net_device_metrics(metric_type="usage", net_device=1) |
| 144 | +get_net_device_metrics(metric_type="wan", net_device=1) |
| 145 | +get_net_device_metrics(metric_type="modem", net_device=1) |
| 146 | +``` |
| 147 | + |
| 148 | +## Project Structure |
| 149 | + |
| 150 | +``` |
| 151 | +ncm_mcp_servers/ |
| 152 | +├── pyproject.toml |
| 153 | +├── Dockerfile |
| 154 | +├── docker-compose.yml |
| 155 | +├── entrypoint.sh |
| 156 | +├── credentials.example.json |
| 157 | +├── credentials.json # Your credentials (gitignored) |
| 158 | +├── ncm_mcp_servers/ |
| 159 | +│ ├── shared/ # Common utilities |
| 160 | +│ │ ├── ncm.py # NCM API client library |
| 161 | +│ │ ├── credentials.py # Credential loading |
| 162 | +│ │ ├── error_handler.py # Response/error formatting |
| 163 | +│ │ └── client.py # NCM client factory |
| 164 | +│ ├── ncm_fleet/ # Fleet management server (port 3001) |
| 165 | +│ │ ├── server.py |
| 166 | +│ │ └── tools/ |
| 167 | +│ │ ├── routers.py |
| 168 | +│ │ ├── groups.py |
| 169 | +│ │ ├── accounts.py |
| 170 | +│ │ ├── locations.py |
| 171 | +│ │ ├── configurations.py |
| 172 | +│ │ └── firmware.py |
| 173 | +│ ├── ncm_monitoring/ # Monitoring server (port 3002) |
| 174 | +│ │ ├── server.py |
| 175 | +│ │ └── tools/ |
| 176 | +│ │ ├── net_devices.py |
| 177 | +│ │ ├── alerts.py |
| 178 | +│ │ └── speed_tests.py |
| 179 | +│ └── ncm_cloud_services/ # Cloud services server (port 3003) |
| 180 | +│ ├── server.py |
| 181 | +│ └── tools/ |
| 182 | +│ ├── users.py |
| 183 | +│ ├── subscriptions.py |
| 184 | +│ ├── private_cellular.py |
| 185 | +│ └── exchange.py |
| 186 | +└── README.md |
| 187 | +``` |
| 188 | + |
| 189 | +## Tool Reference |
| 190 | + |
| 191 | +### ncm-fleet (17 tools) |
| 192 | + |
| 193 | +| Tool | Description | |
| 194 | +|------|-------------| |
| 195 | +| `get_routers` | Query routers by ID, name, account, or group | |
| 196 | +| `manage_router` | Rename, delete, update fields, assign to group/account, remove from group | |
| 197 | +| `reboot_router` | Reboot a single router | |
| 198 | +| `reboot_group` | Reboot all routers in a group | |
| 199 | +| `get_groups` | Query groups by ID, name, or account | |
| 200 | +| `manage_group` | Create, rename, delete, update groups | |
| 201 | +| `get_accounts` | Query accounts by ID or name | |
| 202 | +| `manage_subaccount` | Create, rename, delete subaccounts | |
| 203 | +| `get_locations` | Query current or historical locations | |
| 204 | +| `manage_location` | Create or delete router locations | |
| 205 | +| `get_configuration_managers` | Query config sync status | |
| 206 | +| `patch_config` | Partial config update (router or group) | |
| 207 | +| `put_router_config` | Full config replacement | |
| 208 | +| `copy_router_config` | Copy config between routers | |
| 209 | +| `resume_updates` | Resume suspended config sync | |
| 210 | +| `get_firmware` | Query firmware versions by product | |
| 211 | +| `get_products` | Query product catalog | |
| 212 | + |
| 213 | +### ncm-monitoring (6 tools) |
| 214 | + |
| 215 | +| Tool | Description | |
| 216 | +|------|-------------| |
| 217 | +| `get_net_devices` | Query net devices by router, mode, connection state | |
| 218 | +| `get_net_device_health` | Get cellular health scores | |
| 219 | +| `get_net_device_metrics` | Signal, usage, WAN, or modem metrics | |
| 220 | +| `get_logs` | Alerts, recent alerts, router logs, or activity logs | |
| 221 | +| `create_speed_test` | Run speed test on devices or all modems on a router | |
| 222 | +| `get_speed_test` | Get speed test status and results | |
| 223 | + |
| 224 | +### ncm-cloud-services (13 tools) |
| 225 | + |
| 226 | +| Tool | Description | |
| 227 | +|------|-------------| |
| 228 | +| `get_users` | Query NCM users | |
| 229 | +| `manage_user` | Create, update, delete users, change role | |
| 230 | +| `get_subscriptions` | Query subscriptions | |
| 231 | +| `manage_subscription` | Regrade or unlicense devices | |
| 232 | +| `get_networks` | Query private cellular networks | |
| 233 | +| `manage_network` | Create, update, delete networks | |
| 234 | +| `get_radios` | Query radios and operational status | |
| 235 | +| `manage_radio` | Update radio settings | |
| 236 | +| `manage_sim` | Query or update SIMs | |
| 237 | +| `get_exchange_sites` | Query exchange sites | |
| 238 | +| `manage_exchange_site` | Create, update, delete sites | |
| 239 | +| `get_exchange_resources` | Query exchange resources | |
| 240 | +| `manage_exchange_resource` | Create, update, delete resources | |
0 commit comments