tomique34/cisco-meraki-mcp-server-tvi
If you are the rightful owner of cisco-meraki-mcp-server-tvi and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
An MCP server that integrates with Cisco Meraki's API, enabling AI assistants to manage Meraki network infrastructure.
list_organizations
List all available Meraki organizations.
get_organization_networks
Get networks in an organization.
get_network_devices
Get devices in a network.
get_device_details
Get detailed info about a specific device.
update_switch_port
Update switch port configuration.
Cisco Meraki MCP Server
An MCP (Model Context Protocol) server that integrates with Cisco Meraki's API, allowing AI assistants to interact with and manage Meraki network infrastructure.
Author Information
- Author: Tomas Vince
- Version: 1.0.0
- Date: May 01, 2025
- Contact: LinkedIn
Overview
This MCP server provides a bridge between AI assistants (like Claude) and Cisco Meraki dashboard API. It enables AI assistants to:
- Browse and access Meraki organizations, networks, and devices
- View network clients, wireless SSIDs, VLANs, and switch ports
- Monitor alerts and firmware upgrades
- Get detailed information about devices
- Access camera video links
- Update switch port configurations
Features
- Resource Access: Browse Meraki resources in a hierarchical structure
- Interactive Tools: Perform specific operations with friendly input/output formatting
- Modular Structure: Organized code for maintainability and extension
- Docker Support: Simple containerization for easy deployment
- Authentication: Secure access with Meraki API keys
Installation
Prerequisites
- Python 3.8 or higher
- Cisco Meraki API key
- uv package manager (recommended by MCP SDK)
- Docker (optional, for containerized deployment)
Environment Setup
-
Clone the repository:
git clone https://github.com/tomique34/cisco-meraki-mcp-server-tvi.git cd cisco-meraki-mcp-server-tvi
-
Install uv (if not already installed):
# Using pip pip install uv # Alternative: using curl (macOS/Linux) curl -LsSf https://astral.sh/uv/install.sh | sh
-
Create and activate a Python virtual environment using uv:
# Create a virtual environment uv venv # Activate on Windows .venv\Scripts\activate # Activate on macOS/Linux source .venv/bin/activate
-
Install dependencies using uv:
uv pip install -r requirements.txt
-
Copy the example environment file:
cp .env.example .env
-
Edit the
.env
file and add your Meraki API key:MERAKI_API_KEY=your-api-key-here
Standard Installation
-
Clone the repository:
git clone https://github.com/tomique34/cisco-meraki-mcp-server-tvi.git cd cisco-meraki-mcp-server-tvi
-
Install dependencies using uv:
uv pip install -r requirements.txt
-
Run the server using uv:
uv run meraki_server.py
Docker Installation Options
Option 1: Using Docker Run
-
Build the Docker image:
docker build -t meraki-mcp-server .
-
Run the container with environment variable:
docker run -e MERAKI_API_KEY="your-api-key-here" meraki-mcp-server
Or using the .env file:
docker run --env-file .env meraki-mcp-server
Option 2: Using Docker Compose
-
Make sure your
.env
file is configured properly with your Meraki API key. -
Start the service:
docker-compose up -d
-
View logs:
docker-compose logs -f
-
Stop the service:
docker-compose down
Kubernetes Deployment
The included Docker Compose file can be used as a reference when creating Kubernetes manifests. For a Kubernetes deployment:
- Create a ConfigMap or Secret for the environment variables
- Use the Docker image in your deployment specification
- Configure proper health checks and resource limits
Example of converting the environment variables to a Kubernetes Secret:
kubectl create secret generic meraki-secrets --from-env-file=.env
Usage with Claude Desktop
Easiest Method: Automated Installation Script
For the simplest setup with Claude Desktop, use the included installation script:
-
Run the installation script:
./install_in_claude.sh
-
The script will:
- Generate a properly formatted Claude Desktop configuration
- Automatically detect your project paths
- Extract your API key from the .env file (if available)
- Create a temporary configuration file you can copy and paste
-
Copy the generated configuration into Claude Desktop settings
This is the most user-friendly approach, requiring minimal manual steps.
Recommended Approach: Using the Shell Script
The reliable way to use this MCP server with Claude Desktop is via the included shell script, which automatically handles path resolution and environment setup:
-
Ensure the script is executable (only needed once):
chmod +x run_meraki_server.sh
-
Add this configuration to your Claude Desktop settings:
{ "mcpServers": { "meraki-mcp": { "command": "/bin/bash", "args": ["/absolute/path/to/run_meraki_server.sh"], "env": { "MERAKI_API_KEY": "your-api-key-here" } } } }
-
Replace
/absolute/path/to/run_meraki_server.sh
with the full path to the script on your system.
This approach has several advantages:
- Handles virtual environment activation automatically
- Works with both standard Python and uv installations
- Uses relative paths internally to avoid hardcoding
- Provides clear error messages if the environment isn't set up
Alternative: Direct uv Approach
If you prefer using uv directly (may require additional environment setup):
{
"mcpServers": {
"meraki": {
"command": "uv",
"args": ["run", "/absolute/path/to/meraki_server.py"],
"cwd": "/absolute/path/to/project",
"env": {
"MERAKI_API_KEY": "your-api-key-here"
}
}
}
}
Alternative: Direct Python Approach
For a simpler setup using the standard Python interpreter:
{
"mcpServers": {
"meraki": {
"command": "python3",
"args": ["/absolute/path/to/meraki_server.py"],
"cwd": "/absolute/path/to/project",
"env": {
"MERAKI_API_KEY": "your-api-key-here"
}
}
}
}
Note: In all cases, you'll need to replace placeholders with actual paths and your API key. The shell script approach is recommended as it requires the least amount of configuration.
Option 2: Running as Docker Container
-
Ensure your container is running and the port is exposed:
docker run -p 8000:8000 -e MERAKI_API_KEY="your-api-key-here" meraki-mcp-server
-
Run the MCP Inspector with the HTTP URL:
mcp-inspector --http http://localhost:8000
Option 3: Using Docker Socket
You can also configure Claude Desktop to start the Docker container on demand:
{
"mcpServers": {
"meraki": {
"docker": {
"image": "meraki-mcp-server:latest",
"env": {
"MERAKI_API_KEY": "your-api-key-here"
}
}
}
}
}
This approach requires Claude Desktop to have access to the Docker socket, which allows it to create and manage containers on your behalf. Make sure the Docker image is built on your system before using this option.
Architecture
The server is organized into the following modules:
server/main.py
: Core server setup and initializationserver/resources.py
: Resource handling functionsserver/tools_organizations.py
: Organization-related toolsserver/tools_networks.py
: Network-related toolsserver/tools_devices.py
: Device-related toolsserver/tools_wireless.py
: Wireless (SSIDs) related toolsserver/tools_switch.py
: Switch ports related toolsmeraki_client.py
: Client for interacting with the Meraki APIutils/helpers.py
: Utility functions for resource handling
Tools Overview
Organization Tools
list_organizations
: List all available Meraki organizationsget_organization_networks
: Get networks in an organizationget_organization_alerts
: Get alert settings for an organizationget_firmware_upgrades
: Get firmware upgrades for an organization
Network Tools
get_network_devices
: Get devices in a networkget_network_clients
: Get clients connected to a networkget_vlans
: Get VLANs configured in a network
Device Tools
get_device_details
: Get detailed info about a specific deviceget_camera_video_link
: Get a video link for a Meraki camera
Wireless Tools
get_ssids
: Get wireless SSIDs in a networkget_wireless_clients
: Get wireless clients connected to a network
Switch Tools
get_switch_ports
: Get ports on a Meraki switchupdate_switch_port
: Update switch port configuration
Environment Variables
Variable | Required | Description |
---|---|---|
MERAKI_API_KEY | Yes | Your Meraki Dashboard API key |
API_BASE_URL | No | Custom API base URL (default: https://api.meraki.com/api/v1) |
TIMEOUT | No | Request timeout in seconds (default: 30) |
Modernized Implementation (MCP SDK 1.6.0)
A modernized version of the server has been implemented following the latest MCP SDK 1.6.0 standards. This implementation uses the recommended FastMCP
class and decorator patterns for resources and tools.
Key Improvements
- Modern FastMCP Class: Replaced the older
mcp.Server
with the recommendedFastMCP
class - Decorator Pattern: Used decorators for resource and tool registration instead of explicit functions
- Parameterized Resource Paths: Implemented URI templates like
organizations://{org_id}
for cleaner resource addressing - Simplified Resource Handling: More direct mapping between URIs and resource handlers
- Enhanced Maintainability: Code is more concise and follows current best practices
- Using uv: Switched to uv as recommended by the MCP SDK team
Using the Modernized Server
To use the modernized implementation:
# Run the modernized server using uv
uv run meraki_server.py
This uses the updated implementation that follows the MCP SDK 1.6.0 patterns.
Architecture of Modernized Implementation
The modernized server is organized into the following modules:
server/modern_main.py
: Core server setup using FastMCPserver/modern_resources.py
: Resource handlers using decorator patternserver/modern_tools_organizations.py
: Organization tools using decorator patternserver/modern_tools_networks.py
: Network tools using decorator patternserver/modern_tools_devices.py
: Device tools using decorator patternserver/modern_tools_wireless.py
: Wireless tools using decorator patternserver/modern_tools_switch.py
: Switch tools using decorator pattern
Example of Modern Resource Pattern
@app.resource("organizations://{org_id}")
def get_organization(org_id):
"""Get details for a specific organization."""
return meraki_client.get_organization(org_id)
Example of Modern Tool Pattern
@app.tool(
name="list_organizations",
description="List all Meraki organizations the API key has access to"
)
def list_organizations():
"""List all Meraki organizations the API key has access to."""
return meraki_client.get_organizations()
Troubleshooting
Common Issues
- API Key Errors: Make sure your API key is valid and has the proper permissions
- Resource Not Found: Verify that the organization/network/device exists and is accessible with your API key
- Permission Denied: Check that your API key has the necessary permissions for the operation
- Docker Issues: Ensure your Docker environment has access to the environment variables
Logs
The server logs detailed information about errors. Check the logs when troubleshooting:
# When running directly
uv run meraki_server.py 2> meraki_server.log
# When running with Docker
docker logs meraki-mcp-server
# When running with Docker Compose
docker-compose logs meraki-mcp-server
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Cisco Meraki for providing the Dashboard API
- The Meraki Python SDK developers
- MCP specification contributors
Testing with MCP Inspector
The MCP Inspector is a valuable tool for testing and debugging MCP servers. It allows you to interact with the server directly to verify functionality before integrating with Claude or other AI assistants.
Installing MCP Inspector
-
Install the MCP Inspector tool:
pip install mcp-inspector
-
Verify the installation:
mcp-inspector --version
Testing the Local Server
To test a locally running instance of the Meraki MCP server:
-
Start the server in one terminal:
uv run meraki_server.py
-
In another terminal, run the MCP Inspector:
mcp-inspector --stdio "uv run meraki_server.py"
-
The interactive inspector will start, allowing you to:
- List available resources
- Read specific resources
- Execute tools
- View raw request/response communication
Testing a Dockerized Server
To test a server running in a Docker container:
-
Ensure your container is running and the port is exposed:
docker run -p 8000:8000 -e MERAKI_API_KEY="your-api-key-here" meraki-mcp-server
-
Run the MCP Inspector with the HTTP URL:
mcp-inspector --http http://localhost:8000
Common Test Commands
Once in the MCP Inspector interface, try these commands:
list_resources
: View all available resourcesread_resource meraki://organizations
: View all organizationsexecute list_organizations
: Run the list organizations toolexecute get_organization_networks [org_id]
: Get networks for a specific organizationinfo
: Get information about the serverhelp
: See available commands
Validation Tips
- Verify that all resources are correctly listed and accessible
- Check that tool execution returns properly formatted results
- Test error handling by providing invalid inputs
- Confirm that resource paths follow the expected format
- Test any write operations carefully in a non-production environment
Security Considerations
- The API key grants access to your Meraki infrastructure, so keep it secure
- Store your API key in the
.env
file which is excluded from version control - The server doesn't implement additional authentication beyond the API key
- Consider running the server in a secure environment or network
- Never expose the MCP server to the public internet
- When using Docker or Kubernetes, use secrets management for handling the API key