wrangler-local-mcp
Provides read-only inspection and diagnostics of local Cloudflare Wrangler/Miniflare v3 development state, including D1 schemas and guarded SQL queries, KV entries, R2 object metadata, Durable Objects storage, local observability traces, and state snapshots/diffs.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
wrangler-local-mcp
Read-only dual-mode MCP server and diagnostic CLI for Cloudflare Wrangler / Miniflare v3 local development state.
Built for AI coding agents (Claude Code, Codex CLI, Cursor, Windsurf) and developers debugging local Workers, D1, KV, R2, Durable Objects, and Wrangler 4.118+ Observability traces — even when wrangler dev is stopped or crashed.
Zero native compilation dependencies: Uses Node.js
>=22.13.0built-innode:sqlite(DatabaseSync, unflagged since 22.13.0) andnode:v8(v8.deserialize) — nobetter-sqlite3ornode-gyp.Read-only by default: Every SQLite handle enforces
readOnly: true,PRAGMA query_only = ON, andPRAGMA busy_timeout = 1000, keeping.sqliteand-walfiles byte-for-byte untouched. D1 SQL queries block writes, multi-statement queries,ATTACH, andLOAD_EXTENSION.Secret-safe (best-effort):
.dev.varspreflight compares key names only (values are never read or returned). Outputs apply best-effort redaction for Bearer/Basic tokens, JWTs, common API key prefixes, PEM private keys, and sensitive field names.Offline + Live dual-mode: Reads
.wrangler/state/v3(including active WAL/SHM files) directly whenwrangler devis offline, and detects a live Local Explorer endpoint (/cdn-cgi/local/explorer/api) when running.
Capability Matrix
Capability |
| Official | Wrangler Local Explorer |
Local | Yes | No (cloud API only) | No (requires running |
D1 schema, migrations, read-only SQL with guardrails | Yes | Cloud D1 only | Browser / REST UI |
KV namespaces, exact 64-hex mapping, safe blob decode | Yes | Cloud KV only | Browser / REST UI |
R2 object listing & head metadata (no binary floods) | Yes | Cloud R2 only | Browser / REST UI |
Durable Objects SQLite tables + | Yes | No | SQLite tables only (no |
Local Observability traces/logs (SQLite JSONB + WAL) | Yes | Cloud logs only | Partial |
State snapshots ( | Yes | No | No |
Multi-project discovery & key-only | Yes | No | No |
Zero native addons ( | Yes | N/A | Bundled in Wrangler |
Related MCP server: RuntimeClue
Quick Start
1. Diagnostic CLI (zero config)
# Run a local state & preflight health report
npx wrangler-local-mcp doctor ./my-worker
# Machine-readable JSON output
npx wrangler-local-mcp doctor ./my-worker --json
# Inspect specific subsystems
npx wrangler-local-mcp inspect ./my-worker --do
npx wrangler-local-mcp inspect ./my-worker --traces --limit 20
# Snapshot and diff local state
npx wrangler-local-mcp snapshot ./my-worker --label before-migration
npx wrangler-local-mcp diff ./my-worker before-migration2. MCP Server Registration
Running wrangler-local-mcp with no subcommand (or serve) starts a stdio MCP server with zero stdout log pollution.
Claude Code:
claude mcp add wrangler-local -- npx -y wrangler-local-mcpCodex CLI (~/.codex/config.toml):
[mcp_servers.wrangler_local]
command = "npx"
args = ["-y", "wrangler-local-mcp"]Cursor / Windsurf (mcp.json):
{
"mcpServers": {
"wrangler-local": {
"command": "npx",
"args": ["-y", "wrangler-local-mcp"]
}
}
}Registered MCP Tools (11)
All tools declare readOnlyHint: true and never modify .sqlite or -wal data files inside .wrangler/state/v3:
Tool | Purpose |
| Discover Wrangler projects (single or monorepo), inventory local state + WAL sizes, probe live Local Explorer |
| Validate config, reconcile |
| Inspect D1 bindings (mapped, uninitialized, unmapped), tables, columns, row counts, indexes, and |
| Run guarded single-statement read-only SQL ( |
| List KV entries, expiration status, metadata, and blob sizes across mapped and unmapped namespaces |
| Read and safely decode a KV blob (JSON, text, or binary digest summary) with secret redaction |
| Inspect Durable Objects: reverse-lookup |
| List R2 objects or fetch single-object head metadata ( |
| Query Wrangler 4.118+ local observability |
| Copy |
| Diff two snapshots, or a baseline snapshot against live |
Safety Boundaries
SQLite read-only guarantees & WAL
-shmnote: Connections open withnew DatabaseSync(file, { readOnly: true }),PRAGMA query_only = ON, andPRAGMA busy_timeout = 1000, keeping.sqlitemain database files and-walwrite-ahead logs byte-for-byte unmodified. Note that when.wrangler/state/v3databases are in active WAL mode, SQLite's own reader protocol updates volatile read-mark metadata inside the companion-shmshared-memory index file (which holds no user data and is regenerated by Wrangler/SQLite on demand).SQL injection & mutation guardrails: Comments, string literals, and delimited identifiers (
"...",`...`,[...]) are parsed before token inspection; multi-statement queries,INSERT/UPDATE/DELETE/DROP/ALTER/CREATE/REPLACE,ATTACH/DETACH,VACUUM,LOAD_EXTENSION(unquoted or quoted), and writablePRAGMAs are rejected. Whitelisted read-onlyPRAGMAs (includingmain./temp.schema qualifiers) are allowed.No
.dev.varsvalue reads: Preflight only extracts key names before=and discards values immediately.Best-effort output redaction: Built-in redaction masks Bearer/Basic credentials, JWTs, common API key prefixes, PEM private keys, and sensitive keys (
*_secret,*_password,*_token,*_key,privateKey, etc. — with explicit allowlisting for structural keys likeprimary_key,r2_key,kv_key,public_key,key). Redaction is best-effort pattern/key matching and does not guarantee catching arbitrary unpatterned plaintext values stored under generic column names.Snapshot isolation & operational notes: Snapshots write only to
.wrangler-local-mcp/snapshots/<id>/with strict snapshot ID validation and root-containment checks. Ifwrangler devis actively writing, pause it before taking a snapshot to avoid torn file copies across.sqlite/-walfiles. Queries run synchronously vianode:sqlite'sDatabaseSyncand are bounded by row limits and cell/blob byte caps.
Links
Repository:
https://github.com/xudukongju/wrangler-local-mcpSecurity Policy: SECURITY.md
License
MIT Copyright (c) 2026 xudukongju
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only production context for AI agents: Docker/K8s health, deploys, logs, traffic, code graph
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Read-only access to your WizeLens application traces: errors, slow queries, N+1 queries, security findings, logs, metrics and alerts, so your agent can find the code that caused them. Sign in with OAuth; no API key.
Check project health and advisors, run read-only SQL, manage Edge Function secrets in Supabase.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude and MCP clients to introspect, generate, and execute d1-eloquent project operations (models, migrations, schema, seeders, factories, and CLI) against local D1 databases.248 npmMIT
- AlicenseAqualityBmaintenanceEnables MCP-compatible AI assistants to inspect projects, processes, ports, logs, HTTP endpoints, Git state, and development databases for local runtime diagnostics.7MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to locally inspect and debug trace data, sessions, exceptions, routing decisions, prompts, datasets, annotation queues, scores, and metrics, with compact output, selective tool loading, and read-only mode.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents and MCP clients to locally query traces, sessions, exceptions, route decisions, metrics, prompts, and datasets for debugging and observability. Supports selective tool-group loading, compact or file-dump output, and a read-only mode that disables all write operations.-