Skip to content

Latest commit

 

History

History
executable file
·
286 lines (214 loc) · 6.93 KB

File metadata and controls

executable file
·
286 lines (214 loc) · 6.93 KB
name cisco-meraki
description Manage Cisco Meraki cloud networking - organizations, networks, devices, wireless, switches, firewall, and clients

Cisco Meraki Skill

Complete REST API access to Cisco Meraki cloud networking platform for managing networks, devices, SSIDs, switches, and security policies.

Status:Fully Functional - All core APIs operational

Features

Organization Management ✅

  • List organizations
  • Get organization details
  • Access control per organization

Network Management ✅

  • List networks in organization
  • Get network details
  • Network configuration
  • Multi-site management

Device Management ✅

  • List devices by network
  • Get device details (model, firmware, status)
  • Device online/offline status monitoring
  • Device inventory tracking

Wireless (SSID) Management ✅

  • List SSIDs in network
  • Get SSID configuration
  • Security settings (WPA2/WPA3)
  • Access point management

Switch Management ✅

  • List switch ports
  • Get port status and configuration
  • VLAN management
  • PoE status

Firewall Management ✅

  • List firewall rules
  • Get firewall settings
  • Access control lists
  • Intrusion detection

Client Management ✅

  • List connected clients
  • Get client details
  • Client usage and history
  • Device type detection

Setup

1. API Key (.env)

# Get API key from Meraki Dashboard
# Meraki Dashboard → Organization → Administrators → My profile → API access
MERAKI_API_KEY=your_meraki_api_key_here

2. Dependencies

Python (Claude/Copilot):

pip install requests python-dotenv

Node.js (Gemini):

npm install axios dotenv

3. Basic Usage

List Organizations (Python):

from copilot.cisco_meraki import MerakiClient

client = MerakiClient()
orgs = client.list_organizations()

for org in orgs:
    print(f"{org['name']} (ID: {org['id']})")

List Networks (Python):

from copilot.cisco_meraki import MerakiClient

client = MerakiClient()
org_id = "your_org_id"

networks = client.list_networks(org_id)
for net in networks:
    print(f"{net['name']} - Type: {net['type']}")

List Devices (Python):

from copilot.cisco_meraki import MerakiClient

client = MerakiClient()
network_id = "your_network_id"

devices = client.list_devices(network_id)
for device in devices:
    print(f"{device['model']} ({device['serial']}) - {device['name']}")

JavaScript (Gemini):

const { MerakiClient } = require('./gemini/cisco_meraki');

const client = new MerakiClient();

// List organizations
const orgs = await client.listOrganizations();
orgs.forEach(org => {
  console.log(`${org.name} (${org.id})`);
});

API Reference

Organization API

Method Description
list_organizations() List all accessible organizations
get_organization(org_id) Get organization details

Networks API

Method Description
list_networks(org_id) List networks in organization
get_network(network_id) Get network configuration

Devices API

Method Description
list_devices(network_id) List all devices in network
get_device(network_id, serial) Get device details
get_device_status(network_id, serial) Get device status

Wireless API

Method Description
list_ssids(network_id) List SSIDs in network
get_ssid(network_id, number) Get SSID configuration

Switch API

Method Description
list_switch_ports(network_id, serial) List switch ports
get_switch_port(network_id, serial, port_id) Get port details

Firewall API

Method Description
list_firewall_rules(network_id) List firewall rules
get_firewall_settings(network_id) Get firewall configuration

Clients API

Method Description
list_network_clients(network_id, params) List connected clients (paginated)
get_client(network_id, client_id) Get client details

Pagination

The Meraki API uses cursor-based pagination for large result sets. Results are paginated by default with 10 items per page.

Important: Always Handle Pagination

When querying endpoints that return many results (devices, clients, ports, rules), you must fetch all pages to get complete data.

Default (incomplete):

# ❌ Only gets first 10 clients
clients = client.list_network_clients(network_id)

Correct (complete):

# ✅ Gets ALL clients across all pages
import requests

api_key = "your_api_key"
headers = {'X-Cisco-Meraki-API-Key': api_key}

all_clients = []
url = f"https://api.meraki.com/api/v1/networks/{network_id}/clients"

while url:
    resp = requests.get(url, headers=headers, params={'perPage': 100})
    all_clients.extend(resp.json())
    
    # Check Link header for next page
    link_header = resp.headers.get('Link', '')
    url = None
    if 'rel=next' in link_header:
        for part in link_header.split(', '):
            if 'rel=next' in part:
                url = part.split(';')[0].strip('<>')
                break

Key Points

  • perPage parameter: Use perPage=100 to reduce pagination calls (default: 10)
  • Link header: API returns pagination info in the Link response header
  • rel=next: Indicates there are more pages available
  • Large networks: Networks with 50+ devices/clients always require pagination
  • Incomplete data risk: Querying only first page will miss results silently

Affected Endpoints

These endpoints return paginated results:

  • list_network_clients() - Often 50-100+ clients
  • list_devices() - May return multiple pages in large networks
  • list_switch_ports() - Depends on switch port count
  • list_firewall_rules() - May paginate in complex policies

Device Types

  • MR - Wireless access points (WiFi)
  • MS - Managed switches (wired)
  • MX - Security appliances (firewall/gateway)
  • Z - Teleworker gateways
  • MV - Security cameras
  • MT - Environmental sensors

Supported Networks

  • Wireless networks (WiFi)
  • Switched networks (wired)
  • Security appliance networks
  • Hybrid networks (wired + wireless)

Response Format

All APIs return JSON with consistent structure:

{
  "id": "unique-identifier",
  "name": "Resource Name",
  "type": "ResourceType",
  "status": "active|offline",
  "url": "https://..."
}

Error Codes

Code Meaning
401 Unauthorized (invalid API key)
403 Forbidden (insufficient permissions)
404 Not found (resource doesn't exist)
429 Rate limited (too many requests)
500 Server error

Security

✅ API key stored in .env (git-ignored) ✅ HTTPS only ✅ OAuth 2.0 Bearer token ✅ No credentials in logs ✅ Per-organization isolation

Support