macharpe/meraki-mcp-cloudflare
If you are the rightful owner of meraki-mcp-cloudflare 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.
The Cisco Meraki MCP Server is a Model Context Protocol server that integrates AI assistants with Cisco Meraki network management capabilities, running on Cloudflare Workers.
š Cisco Meraki MCP Server
A Model Context Protocol (MCP) server that provides AI assistants with direct access to Cisco Meraki network management capabilities. This server runs on Cloudflare Workers and enables seamless integration between AI tools like Claude Desktop and your Meraki infrastructure.
Inspiration: This implementation was inspired by Censini/mcp-server-meraki - credits to the original work for additional API method ideas.
⨠Features
š ļø Available Tools
The server provides 18 comprehensive Meraki management tools:
š¢ Organization & Network Management
get_organizations
- List all organizations in your Meraki accountget_organization
- Get detailed information about a specific organizationget_networks
- List all networks within an organizationget_network
- Get detailed information about a specific network
š± Device Management
get_devices
- List all devices within a networkget_device
- Get detailed information about a specific deviceget_device_statuses
- Get device statuses for an organizationget_management_interface
- Get management interface settings for a device
š Network Operations
get_clients
- Get clients connected to a networkget_network_traffic
- Get network traffic statisticsget_network_events
- Get recent network events
š Switch Management
get_switch_ports
- Get switch ports for a deviceget_switch_port_statuses
- Get switch port statuses for a deviceget_switch_routing_interfaces
- Get routing interfaces for a switchget_switch_static_routes
- Get static routes for a switch
š” Wireless Management
get_wireless_radio_settings
- Get wireless radio settings for an access pointget_wireless_status
- Get wireless status of an access pointget_wireless_latency_stats
- Get wireless latency statistics for an access point
šÆ Key Benefits
- š Serverless: Runs on Cloudflare Workers with automatic scaling
- š Secure: API key management through Cloudflare Workers secrets
- š Remote Access: Connect from any MCP client using SSE transport
- š± Real-time: Live access to your Meraki dashboard data
- š° Cost-effective: Pay-per-use with Cloudflare Workers free tier
šļø Architecture
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā Claude ā ā MCP Server ā ā Meraki API ā
ā Desktop āāāāāŗā (Cloudflare āāāāāŗā Dashboard ā
ā ā ā Workers) ā ā ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
mcp-remote SSE/HTTP HTTPS/REST
š Project Structure
meraki-mcp-cloudflare/
āāā src/
ā āāā index.ts # Main MCP server implementation
ā āāā services/
ā ā āāā merakiapi.ts # Meraki API service layer
ā āāā types/
ā ā āāā meraki.ts # TypeScript type definitions
ā āāā errors.ts # Custom error classes
āāā wrangler.jsonc # Cloudflare Workers configuration
āāā package.json # Dependencies and scripts
āāā README.md # This file
š Prerequisites
Before deploying the server, ensure you have:
- Cloudflare Account: Free account at cloudflare.com
- Cisco Meraki Account: With API access enabled
- Meraki API Key: Generated from your Meraki Dashboard
- Node.js: Version 18 or higher
- Git: For cloning the repository
š Getting Your Meraki API Key
- Log into your Meraki Dashboard
- Navigate to Organization > Settings > Dashboard API access
- Enable API access if not already enabled
- Generate a new API key and copy it securely
š Installation & Deployment
1. Clone the Repository
git clone https://github.com/macharpe/meraki-mcp-cloudflare.git
cd meraki-mcp-cloudflare
2. Install Dependencies
npm install
3. Configure Environment
Create a .dev.vars
file for local development:
echo "MERAKI_API_KEY=your_meraki_api_key_here" > .dev.vars
4. Local Development
Test the server locally:
npm run dev
The server will start at http://localhost:8787
Test the health endpoint:
curl http://localhost:8787/health
5. Deploy to Cloudflare Workers
First, authenticate with Cloudflare:
npx wrangler login
Set your API key as a secret:
npx wrangler secret put MERAKI_API_KEY
# Enter your Meraki API key when prompted
Deploy the server:
npx wrangler deploy
Your server will be available at: https://meraki-mcp-cloudflare.<your-account>.workers.dev
The health endpoint will show:
{
"status": "healthy",
"hasApiKey": true,
"tools": 18,
"endpoints": ["/sse", "/health", "/"]
}
āļø Configuration
š» Claude Desktop Integration
Add the following to your Claude Desktop configuration file:
Location: ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS)
{
"mcpServers": {
"meraki": {
"command": "npx",
"args": [
"mcp-remote",
"https://meraki-mcp-cloudflare.<your-account>.workers.dev/sse"
]
}
}
}
Replace <your-account>
with your actual Cloudflare account subdomain.
š Authentication (Optional)
To secure your MCP server with authentication:
- Set up AUTH_TOKEN secret:
wrangler secret put AUTH_TOKEN
# Enter your desired authentication token when prompted
- Update Claude Desktop configuration to include the auth header:
{
"mcpServers": {
"meraki": {
"command": "npx",
"args": [
"mcp-remote",
"https://meraki-mcp-cloudflare.<your-account>.workers.dev/sse",
"--header", "Authorization=Bearer your-auth-token-here"
]
}
}
}
- Verify authentication by checking the health endpoint:
curl https://meraki-mcp-cloudflare.<your-account>.workers.dev/health
The response will show "authEnabled": true
when authentication is configured.
š Environment Variables
The server uses these environment variables:
MERAKI_API_KEY
(required): Your Cisco Meraki API keyMERAKI_BASE_URL
(optional): Base URL for Meraki API (defaults tohttps://api.meraki.com/api/v1
)AUTH_TOKEN
(optional): Authentication token for securing the MCP server
š” Usage Examples
Once connected to Claude Desktop, you can use natural language to interact with your Meraki infrastructure:
š¢ Get Organizations
"Show me all my Meraki organizations"
š List Networks
"Get all networks in organization 123456"
š± View Devices
"List all devices in the main office network"
š Device Details
"Get details for device with serial ABC123DEF456"
š” Wireless Management
"Show me the wireless status of access point with serial XYZ789"
"Get wireless latency statistics for the office AP"
š Switch Operations
"List all switch ports for device ABC123"
"Show me the routing interfaces for the core switch"
š Network Analytics
"Get network traffic statistics for the main office"
"Show recent security events for organization 123456"
š API Endpoints
The server exposes these HTTP endpoints:
GET /sse
- Server-Sent Events endpoint for MCP communicationPOST /sse
- HTTP endpoint for MCP messagesGET /health
- Health check endpointOPTIONS /*
- CORS preflight handler
š ļø Development
š Available Scripts
npm run dev # Start local development server
npm run build # Build TypeScript to JavaScript
npm run deploy # Deploy to Cloudflare Workers
npm run lint # Run ESLint
npm run format # Format code with Prettier
ā Adding New Tools
To add new Meraki API endpoints:
- Add the method to
src/services/merakiapi.ts
- Define types in
src/types/meraki.ts
- Add the tool definition in
src/index.ts
- Add the tool handler in the switch statement
Example:
// Add to tools array
{
name: "get_clients",
description: "Get clients connected to a network",
inputSchema: {
type: "object",
properties: {
networkId: { type: "string", description: "Network ID" }
},
required: ["networkId"]
}
}
// Add to switch statement
case "get_clients":
const clients = await merakiService.getClients(args.networkId);
return { content: [{ type: "text", text: JSON.stringify(clients, null, 2) }] };
š Security Considerations
- API keys are stored as Cloudflare Workers secrets (encrypted at rest)
- No authentication required for the MCP server (suitable for personal use)
- All communication uses HTTPS
- CORS headers allow cross-origin requests
š Troubleshooting
ā ļø Common Issues
"MERAKI_API_KEY not configured"
- Ensure you've set the secret:
npx wrangler secret put MERAKI_API_KEY
"Server disconnected" in Claude Desktop
- Check your Claude Desktop config file syntax
- Verify the server URL is correct
- Restart Claude Desktop after config changes
"Rate limit exceeded"
- Meraki API has rate limits; reduce request frequency
- Check your API key permissions
š Debugging
Check Cloudflare Workers logs:
npx wrangler tail
View Claude Desktop MCP logs:
tail -f ~/Library/Logs/Claude/mcp-server-meraki.log
š¤ Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-tool
- Make your changes and test locally
- Commit your changes:
git commit -am 'Add new tool'
- Push to the branch:
git push origin feature/new-tool
- Submit a pull request
š License
This project is licensed under the GNU General Public License v3.0 - see the file for details.
š Code Statistics
Project Metrics
š Total Files: 20
š Source Files: 4 TypeScript files
š ļø Available Tools: 18 Meraki API methods
š§ API Service Methods: 20+ methods
š¦ Dependencies: 3 main packages (@modelcontextprotocol/sdk, agents, zod)
ā” Build Output: ~523 KiB (83 KiB gzipped)
File Breakdown
src/
āāā index.ts # 542 lines - Main MCP server & HTTP handlers
āāā services/
ā āāā merakiapi.ts # 190 lines - Meraki API service layer
āāā types/
ā āāā meraki.ts # 308 lines - Type definitions for Meraki objects
āāā errors.ts # 19 lines - Custom error classes
API Coverage
- Organizations: 2 methods (list, get details)
- Networks: 4 methods (list, details, traffic, events)
- Devices: 4 methods (list, details, status, management)
- Wireless: 3 methods (radio settings, status, latency stats)
- Switch: 4 methods (ports, port status, routing, static routes)
- Clients: 1 method (network clients)
Performance
- Cold Start: ~30ms on Cloudflare Workers
- Response Time: <100ms for most API calls
- Rate Limits: Respects Meraki API limits (5 requests/second)
- Caching: Browser/CDN caching for static responses
š Related Resources
- Model Context Protocol (MCP)
- Cisco Meraki API Documentation
- Cloudflare Workers Documentation
- Claude Desktop MCP Setup
š¬ Support
For issues and questions:
- Create an issue in this repository
- Check the MCP documentation
- Review Cloudflare Workers error handling
Last updated: July 2025