meraki-mcp

meraki-mcp

A read-only MCP server for Cisco Meraki Dashboard, enabling LLMs to discover devices, check health, troubleshoot, and generate reports via natural language.

Category
访问服务器

README

meraki-mcp

A read-only, production-shaped Model Context Protocol server for the Cisco Meraki Dashboard, built for infra/delivery teams (MR / MS / MX). It exposes a small, high-signal set of tools an LLM can select reliably — the tool design rationale lives in ../docs/; the code architecture is in ARCHITECTURE.md.

Built on the MCP Python SDK (FastMCP) and the official async meraki library.

What makes it enterprise-shaped

  • One response contract. Every tool returns ToolResult{summary, data, meta, error}. Nobody hand-rolls output; tools project Meraki payloads to declared fields (no raw blobs) and cap arrays. meta carries scope, count, truncated, elapsed_ms, partial/warnings (a partially-failed call declares what's missing), and note.
  • Response-size budget. The registrar runs enforce_budget on every result: if it serializes past MERAKI_MCP_MAX_RESPONSE_CHARS (~15k tokens) the largest arrays are shrunk to fit and the result is flagged (meta.truncated + meta.note) — so a response can never overflow the Copilot/agent context.
  • One lifecycle owner. register_tool wraps every tool with timeout, exception→ToolResult normalization, elapsed_ms, and structured logging. A raw exception never crosses the MCP boundary.
  • One SDK seam. All Meraki calls flow through MerakiGateway (concurrency limit, per-call timeout, error normalization, logging) — applied once, not per tool.
  • Names in, IDs never invented. Tools accept "Rome DC"; the cached Resolver turns it into an ID (ambiguity returns the candidate list for the model to pick).
  • Testable by construction. Tools depend on the gateway interface, so tests/fakes.FakeGateway exercises real tool logic offline, no API key.
  • Read-only by default. The sole non-GET tool (live_diagnostics) is behind a flag and annotated readOnlyHint=false.

Layout

src/meraki_mcp/
  server.py         FastMCP app + lifespan (builds gateway, resolver, settings once)
  config.py         env Settings (validated; timeouts, concurrency, feature flags)
  context.py        AppContext handed to every tool (gateway, resolver, settings)
  core/
    gateway.py      the ONE Meraki SDK seam: concurrency + timeout + error normalization
    response.py     ToolResult / Meta / Collector / Response  (the output contract)
    errors.py       ResolutionError + GatewayError hierarchies (each carries an ErrorKind)
    resolver.py     name/serial/MAC -> IDs, TTL-cached
    observability.py logging setup
    pagination.py   aggregate (all pages) vs firehose (capped)
    formatting.py   small trim helpers
  tools/
    _registry.py    register_tool: the single lifecycle wrapper (ctx->app, timeout, errors, logging)
    _shared.py      one-import toolkit for tool modules
    <domain>.py     pure handlers + one-line register() each
    optional/       reports.py (P2) + live.py (non-GET, flagged)
  prompts/playbooks.py   13 packaged playbooks (register_prompts)
tests/
  fakes.py          FakeGateway/FakeSection — the DIP payoff
  test_core.py test_gateway.py test_response.py test_selection.py

Implementation status

All 18 tools are implemented — 13 core (find, health_overview, list_problems, site_status, device_status, client_status, troubleshoot_client, triage_site, site_turnup_readiness, wireless_status, switch_status, security_events, config_review) plus 5 optional/off-by-default (change_audit, firmware_compliance, license_inventory_report, usage_summary, and live_diagnostics — the only non-GET tool, a create→poll job runner). Also 3 resources (meraki://organizations, meraki://networks, meraki://devices) and 13 prompts. Multi-org is supported: MERAKI_ORG_ID is an optional default, every tool takes an optional org, and find() lists orgs/networks for discovery.

Field-shape parsing is based on the Meraki OpenAPI spec and unit-tested with a FakeGateway, but not yet run against a live org — do one smoke test with a read-only key before production (see REVIEW.md B2).

Run

pip install -e ".[dev]"
cp .env.example .env      # set a READ-ONLY MERAKI_DASHBOARD_API_KEY (+ MERAKI_ORG_ID for single-org)
meraki-mcp               # transport from .env (streamable-http by default)

How to test it

  1. Unit tests (offline, no key): pytest -q — 36 tests (gateway, response/budget, resolver, all tools via FakeGateway). Lint: ruff check src tests scripts.
  2. Live smoke (needs a read-only key in .env): python scripts/smoke_test.py — runs find/health_overview/list_problems against your real org and prints each summary + any meta.warnings (field-shape/licensing issues). Add a site name to also exercise site_status/wireless_status: python scripts/smoke_test.py "Rome DC".
  3. In VS Code / Copilot (stdio): .vscode/mcp.json (in the workspace root) launches this server for VS Code's MCP client — open it and start the meraki server.
  4. Over HTTP (Copilot Studio / MCP Inspector):
    MERAKI_MCP_TRANSPORT=streamable-http meraki-mcp     # serves http://127.0.0.1:8000/mcp
    
    or containerised: docker build -t meraki-mcp . && docker run --rm -p 8000:8000 -e MERAKI_DASHBOARD_API_KEY=... -e MERAKI_ORG_ID=... meraki-mcp. Expose via a dev tunnel and register the https://…/mcp URL in Copilot Studio (No authentication for now — see CONNECT-COPILOT-STUDIO.md).

Never commit a real key. .env is git-ignored; .env.example holds a placeholder only.

meraki-mcp

meraki-mcp

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选