Cisco Meraki MCP Server
A Model Context Protocol (MCP) server that provides tools to interact with the Cisco Meraki Dashboard API, enabling programmatic management and monitoring of Meraki networks at scale.
Overview
This MCP server allows AI assistants to manage and monitor Cisco Meraki cloud-managed networks through the Meraki Dashboard API. It provides tools for:
- Organization Management: List and access Meraki organizations
- Network Management: List and manage networks within organizations
- Device Management: Monitor and manage network devices (access points, switches, security appliances)
- Client Monitoring: Track connected clients and their usage
- Uplink Monitoring: Monitor WAN connections and uplink health
Features
- ✅ Read-Only Operations: Safe monitoring and reporting without modifying configurations
- ✅ Multiple Response Formats: Support for both Markdown (human-readable) and JSON (machine-readable)
- ✅ Comprehensive Error Handling: Clear, actionable error messages for troubleshooting
- ✅ Filtering Support: Filter devices by product type, network, tags, and status
- ✅ Pagination Ready: Handles large datasets with truncation and guidance
- ✅ Rate Limit Aware: Includes handling for Meraki's API rate limits (10 req/sec per org)
Prerequisites
- Python 3.10 or higher
- Cisco Meraki Dashboard account with API access
- Meraki API key
Installation
- Install the MCP Python SDK:```bash
pip install mcp httpx pydantic --break-system-packages
2. **Set your Meraki API key as an environment variable**:```bash
export MERAKI_API_KEY="your_api_key_here"
To get your Meraki API key:
1. Log into the Meraki Dashboard
2. Navigate to Organization → Configure → API & Webhooks
3. Click "Generate API Key" under the "API keys and access" tab
4. Copy the generated API key
⚠️ Security Note: Never commit your API key to version control. Always use environment variables.
Usage
Running the Server
Run the MCP server using the mcp command:```bash
mcp run meraki_mcp.py
Or execute it directly:```bash
python meraki_mcp.py
Available Tools
1. meraki_list_organizations
List all Meraki organizations accessible by your API key.
Use cases:
- Find your organization ID for other API calls
- List all organizations you manage
- Get organization details for reporting
Example:```
List all my Meraki organizations
#### 2. **meraki_list_networks**
List all networks within a specific organization.
**Parameters**:
- `organization_id`: The organization ID to query
- `response_format`: Output format (markdown or json)
**Use cases**:
- Find network IDs for device management
- List all networks in an organization
- Check which product types each network supports
**Example**:```
List all networks in organization 549236
3. meraki_get_network
Get detailed information about a specific network.
Parameters:
- network_id: The network ID to retrieve
- response_format: Output format (markdown or json)
Use cases:
- Get network configuration details
- Check enabled product types
- Verify network settings
Example:```
Get details for network N_24329156
#### 4. **meraki_list_devices**
List all devices in an organization with optional filtering.
**Parameters**:
- `organization_id`: The organization ID
- `product_types`: Optional filter by device types (wireless, switch, appliance, etc.)
- `network_ids`: Optional filter by network IDs
- `tags`: Optional filter by device tags
- `response_format`: Output format (markdown or json)
**Use cases**:
- List all wireless access points
- Find devices in a specific network
- Get device inventory for reporting
- Locate devices with specific tags
**Example**:```
List all wireless devices in organization 549236
Show me switches in network N_24329156
5. meraki_get_device_statuses
Get real-time status of devices in an organization.
Parameters:
- organization_id: The organization ID
- statuses: Optional filter by status (online, offline, alerting, dormant)
- product_types: Optional filter by product types
- network_ids: Optional filter by network IDs
- response_format: Output format (markdown or json)
Use cases:
- Monitor which devices are online or offline
- Check for alerting devices needing attention
- Get real-time network health overview
- Troubleshoot connectivity issues
Example:```
Show me all offline devices in organization 549236
Which devices are alerting?
#### 6. **meraki_get_device**
Get detailed information about a specific device.
**Parameters**:
- `serial`: The device serial number
- `response_format`: Output format (markdown or json)
**Use cases**:
- Get device configuration details
- Check device firmware version
- Verify device network assignment
- Get device location information
**Example**:```
Get details for device Q234-ABCD-5678
7. meraki_list_network_clients
List clients connected to a network within a specified timespan.
Parameters:
- network_id: The network ID
- timespan: Timespan in seconds (default 86400 = 1 day, max 2592000 = 30 days)
- response_format: Output format (markdown or json)
Use cases:
- Monitor connected devices
- Track client data usage
- Identify unauthorized devices
- Analyze network utilization
Example:```
Show me clients connected to network N_24329156 in the last 24 hours
List all clients from the past week
#### 8. **meraki_get_organization_uplinks_statuses**
Get uplink status of all devices in an organization.
**Parameters**:
- `organization_id`: The organization ID
- `network_ids`: Optional filter by network IDs
- `response_format`: Output format (markdown or json)
**Use cases**:
- Monitor WAN connectivity across organization
- Check uplink failover status
- Identify connectivity issues
- Track public IP assignments
**Example**:```
Show me uplink status for all devices in organization 549236
Check WAN connectivity for organization
Configuration
Environment Variables
MERAKI_API_KEY(required): Your Meraki Dashboard API key
API Rate Limits
The Meraki Dashboard API has a rate limit of 10 requests per second per organization. The server includes error handling for rate limit errors (HTTP 429) and will provide guidance when limits are exceeded.
Response Formats
Markdown Format (Default)
Human-readable format with:
- Headers and sections for easy scanning
- Bullet points for key information
- Formatted timestamps
- Grouped related data
JSON Format
Machine-readable format with:
- Complete structured data
- All available fields
- Consistent field names
- Suitable for programmatic processing
Error Handling
The server provides clear, actionable error messages for common issues:
- 400 Bad Request: Invalid parameters - check your input
- 401 Unauthorized: Invalid API key - verify MERAKI_API_KEY environment variable
- 403 Forbidden: No permission - check API key organization access
- 404 Not Found: Resource doesn't exist - verify IDs are correct
- 429 Rate Limit: Too many requests - wait before retrying (10 req/sec limit)
- Timeout: Request took too long - retry or check network connection
Architecture
Tool Organization
Tools are organized by resource type:
- Organization Tools: List and manage organizations
- Network Tools: Manage networks and configurations
- Device Tools: Monitor and manage devices
- Client Tools: Track connected clients
- Uplink Tools: Monitor WAN connectivity
Design Principles
- Read-Only First: All tools are read-only to ensure safety
- Consistent Naming: Tools follow
meraki_{action}_{resource}pattern - Flexible Filtering: Support for multiple filter parameters
- Response Format Options: Both human and machine-readable formats
- Error Clarity: Actionable error messages with remediation guidance
Development
Project Structure```
meraki_mcp/
├── meraki_mcp.py # Main server implementation
├── README.md # This file
└── requirements.txt # Python dependencies (optional)
### Adding New Tools
To add new tools:
1. Define a Pydantic input model with validation
2. Use the `@mcp.tool()` decorator with appropriate annotations
3. Implement the tool function with comprehensive docstring
4. Add error handling with `_handle_api_error()`
5. Support both response formats (markdown and json)
6. Include truncation for large responses
### Testing
Test the server with the MCP inspector:```bash
npx @modelcontextprotocol/inspector python meraki_mcp.py
Or test individual tools:```python
Set environment variable
export MERAKI_API_KEY="your_key"
Run server
python meraki_mcp.py
```
Meraki API Resources
- Meraki Developer Hub
- Dashboard API Documentation
- Getting Started Guide
- Postman Collection
- Python SDK
License
This MCP server is provided as-is for use with the Cisco Meraki Dashboard API. Please refer to Cisco's API terms of service and licensing agreements.
Support
For issues related to:
- MCP Server: Check error messages and this README
- Meraki API: Visit Meraki Developer Community
- API Keys: Contact your Meraki administrator or Cisco support
Changelog
Version 1.0.0
- Initial release with 8 core tools
- Organization, network, and device management
- Client monitoring and uplink status tracking
- Markdown and JSON response formats
- Comprehensive error handling
