Skip to main content
Glama
Wikimedia MCP

Wikimedia MCP

by 20Youssef10

Wikimedia MCP

A TypeScript implementation of the frozen Phase 1 contract (research/09-implementation-contract.md, v1.0.1), the frozen Phase 2 Group B contract (research/10-phase2-contract.md, v2.0.0) and the frozen Phase 3 Group C/F contract (research/11-phase3-contract.md, v3.0.0), targeting MCP 2026-07-28 (stateless, server/discover, per-request _meta, routing headers, resultType/ttlMs/cacheScope).

Server version: 3.0.0 (SERVER_VERSION in src/protocol/result.ts, advertised as io.modelcontextprotocol/serverInfo.version and in the wikimedia://server/info resource, and mirrored by the package version). The major bump from 1.0.0 marks the merge of all three phases into one server, whose tool surface grew from 9 (Phase 1) to 20 (Phases 1+2+3), then to 22 with the two Phase 5 (Group G) read-only tools, then to 23 with the Group D read-only get_recent_changes tool, and finally to 28 when the five write tools were enabled by explicit Product Owner risk acceptance on 2026-11-21. The frozen per-contract versions (v1.0.1 / v2.0.0 / v3.0.0 / v5.0.0 for the Phase 5 subset) and the protocol revision 2026-07-28 are independent and unchanged.

Twenty-eight tools — 23 read-only + 5 gated writes: the nine Phase 1 Group A tools (search, get_summary, get_page, get_sections, get_related_pages, get_media, get_languages, get_random_page, get_feed), the six Phase 2 Group B (Wikidata) tools, the five Phase 3 tools (three Group C metrics, two Group F media), the two Phase 5 tools (geo_search, get_tables) and the Group D tool (get_recent_changes) listed below. Both stdio and Streamable HTTP transports are supported. No Enterprise APIs, no EventStreams/SSE consumer, no change notifications (subscriptions/listen returns -32601).

SDK note: the 2026-07-28 implementation is the v2 SDK, which ships as two packages (@modelcontextprotocol/server and @modelcontextprotocol/client), not the legacy single @modelcontextprotocol/sdk package. See SDK-VERIFICATION.md for the gate evidence.


Quick start

Requires Node.js 22+ and npm 11 (see Requirements). From the repository root:

npm ci                          # install from the committed lockfile
npm run build                   # compile TypeScript to dist/
READ_ONLY_PROFILE=1 npm test    # fixture-only suite; no live network calls

Run over stdio (the default transport):

USER_AGENT='WikiMCP/1.0 (https://example.org/bot; ops@example.org)' npm start

Or over Streamable HTTP on loopback:

MCP_TRANSPORT=streamable-http MCP_HTTP_HOST=127.0.0.1 MCP_HTTP_PORT=3000 \
MCP_HTTP_PATH=/mcp MCP_ALLOWED_HOSTS=127.0.0.1,localhost \
USER_AGENT='WikiMCP/1.0 (https://example.org/bot; ops@example.org)' npm start

USER_AGENT is required in all cases. See Install and run for the full configuration and Host configuration examples for host snippets.

Related MCP server: MediaWiki MCP Server

Status

  • 28 tools in the default catalogue: 23 read-only + 5 write tools.

  • MCP 2026-07-28 only (stateless, server/discover, per-request _meta).

  • Verification green: 498 passed / 5 skipped (npm test), plus independent QA smoke checks 16/16, 10/10 and 9/9.

  • The five write tools are registered but fail closed — with no OAuth/CIMD configuration they return authentication_required/invalid_issuer and G8 blocks real uploads (licence_not_signed_off). Named human sign-off for G1/G8 is still pending, and no real wiki write is performed in any test or harness.

Repository layout

Path

Contents

src/

TypeScript server implementation: protocol, tool registry, transports, write controls and observability.

tests/

Fixture-backed Vitest suites (contract, wikidata, phase3, phase5, groupd, write, security, unit and live).

scripts/

CLI helpers: wmcp, gate-status, rollback-harness, catalogue assertions, tool-reference generator and smoke script.

research/

The numbered research/contract reports (01–19), the research README.md index and the JSON test corpus.

handoff/

Operational docs: deployment runbook, nightly scheduler, sign-off templates, rollback and security runbooks.

write-security/

Write-tool risk sign-off, rollback/approval runbooks, evidence and recorded decisions.

TOOLS.md

Generated tool reference; regenerate with npm run docs:tools.

SDK-VERIFICATION.md

Evidence for the v2 SDK / MCP 2026-07-28 gate.

reports/

Generated nightly, gate and demand evidence; gitignored, never committed.

Documentation index

Research and contracts

Operations

Reference

Community and policy

Community

Requirements

  • Node.js 22 LTS or newer (developed on v24.22.2)

  • npm 11 (committed package-lock.json; install with npm ci)

  • Network egress to Wikimedia hosts for live use (the merge gate uses fixtures)

Install and run

npm ci
cp .env.example .env
# edit .env — USER_AGENT is REQUIRED

stdio (default):

USER_AGENT='WikiMCP/1.0 (https://example.org/bot; ops@example.org)' npm start
# or with an env file:
node --env-file=.env --import tsx src/index.ts

Streamable HTTP:

MCP_TRANSPORT=streamable-http \
MCP_HTTP_HOST=127.0.0.1 MCP_HTTP_PORT=3000 MCP_HTTP_PATH=/mcp \
MCP_ALLOWED_HOSTS=127.0.0.1,localhost \
USER_AGENT='WikiMCP/1.0 (https://example.org/bot; ops@example.org)' \
npm start

The HTTP endpoint is POST-only: GET returns 405 with Allow: POST. Wrong Content-Type → 415; bad Origin/Host → 403; header/body mismatch → -32020 with HTTP 400. Public binds require both MCP_ALLOWED_ORIGINS and MCP_ALLOWED_HOSTS to be set.

Deployment: TLS termination, Origin and CSRF

The server speaks plain HTTP only and binds to loopback (127.0.0.1) by default. It does not implement TLS itself. For any network-facing deployment, terminate TLS at a reverse proxy (for example nginx, Caddy, Envoy or a cloud load balancer) in front of it:

  • Keep the server on loopback (or a private interface); let the proxy own the certificate, HTTP/2 and public exposure. Do not expose the raw HTTP port.

  • The proxy must forward the Origin and Host headers unchanged and must not rewrite or strip Mcp-* headers — the server validates them against the JSON-RPC body on every request (the v2 SDK's createMcpHandler).

  • Configure MCP_ALLOWED_ORIGINS and MCP_ALLOWED_HOSTS as explicit, exact values (scheme + host + port for origins). Never use a wildcard (*) origin, and never combine a wildcard CORS policy with credentials. There is no CORS credential configuration in this server: it accepts only the listed origins and rejects every other Origin with HTTP 403.

  • Re-resolve / pin the public hostname at the proxy to defeat DNS rebinding; do not let a rebinding attacker reach the loopback listener.

Two optional hardening flags (both off by default so existing CLI and non-browser hosts keep working) are provided for the HTTP transport:

Flag

Default

Effect when true

MCP_REQUIRE_ORIGIN

false

A request with a missing Origin is rejected with HTTP 403 (a present but unlisted Origin is always rejected).

MCP_REQUIRE_CSRF

false

A state-changing call (a tools/call to a deny-listed write tool) requires a valid Mcp-Csrf-Token request header; a fresh signed token is returned in MCP-CSRF-Token on each response (double-submit pattern). Boot fails unless MCP_CSRF_SECRET is at least 16 characters.

Mandatory for write enablement: both flags MUST be true for any future write-enabled deployment, alongside the remaining report 08 gates (G1–G12). Today they are off because this server is read-only — no write tool and no write credential exists. The CSRF mechanism is shipped and tested with a test-only harness (never registered in production); it does not itself enable writing. See research/14-read-only-signoff.md.

Configuration

All keys from contract §2.6 are Zod-validated at boot; invalid values terminate startup. See .env.example for the full list and defaults. Notable limits: CONCURRENCY_LIMIT ≤ 3, HTTP_TIMEOUT_MS, RETRY_MAX_ATTEMPTS, RETRY_AFTER_FALLBACK_MS (≥5 s when upstream omits Retry-After), MAX_RESULT_BYTES. WDQS (WIKIDATA_SPARQL_*) and Attribution (ATTRIBUTION_*) keys are wired from day 1; Phase 2 reuses the same eight WDQS keys and adds no new configuration key.

Wikidata host notes (Phase 2):

  • Wikibase REST v1.6 is fixed at https://www.wikidata.org/w/rest.php/wikibase/v1; item search, get_entity, get_statements and get_sitelinks use it.

  • WDQS endpoints come only from WIKIDATA_SPARQL_ENDPOINT (default https://query.wikidata.org/sparql), _V2, _FALLBACKS and _PREFER_V2. Every endpoint must be https: — startup fails otherwise. Do not use HEAD as a WDQS health check (it times out while GET succeeds).

  • WIKIDATA_SPARQL_TIMEOUT_MS ≤ 60000; WIKIDATA_SPARQL_MAX_ROWS and _MAX_QUERY_LENGTH must be positive. The advertised wikidata_sparql_query schema is regenerated from these caps at boot so schema and guard cannot drift.

  • Label-service deadlines: SERVICE wikibase:label is the one known slow WDQS path (it resolves labels after the main pattern). A live query at timeout_ms=30000 otherwise fails with query_timeout even though the contract permits up to 60000 ms. wikidata_sparql_query therefore uses the full 60000 ms hard cap for guarded label-service queries whose timeout_ms is below it, reports effective_timeout_ms, and adds a non-fatal warning (label-service query: timeout_ms raised …). Non-label queries keep the requested deadline. The global 60 s cap is never raised, and if a label query still times out the query_timeout error names wikibase:label as the likely cause instead of suggesting a deadline above the cap. Detection is token-based, so a SERVICE wikibase:label string inside a comment or literal does not trigger the bump.

  • WDQS concurrency is a dedicated semaphore of min(2, CONCURRENCY_LIMIT) nested inside the global p-limit(3). Identical effective queries are cached for min(300000, METADATA_CACHE_TTL_MS) ms.

  • WIKIDATA_SPARQL_FALLBACKS is an ordered comma-separated list. On 401/403/ 404/other-5xx/timeout the next endpoint is tried; 429/503 stay on the same endpoint and honour Retry-After (≥ RETRY_AFTER_FALLBACK_MS when absent).

Phase 3 adds zero configuration keys. The three existing Attribution keys are reused as-is: ATTRIBUTION_API_VERSION (default v0-beta, pattern ^v[0-9]+(?:-[a-z0-9]+)?$; v1 is accepted but still falls back because the live v1 path returns 404 rest-no-match), ATTRIBUTION_FALLBACKS (allowed tokens exactly rest-bare,action-rightsinfo,action-imageinfo) and ATTRIBUTION_DISCLAIMER (injected verbatim into every media result). An empty/malformed version or an unknown fallback token terminates boot. Date caps (MIN_DATE, MAX_SPAN), project aliases, the licence URL map and Class M/T/I pacing are version-controlled code constants, not environment variables.


Host configuration examples

Adapted from report 06 §7 (see §7.1 for verified host results). For a local deployment use the stdio command or http://127.0.0.1:3000/mcp in place of the hosted URL shown there. Leave OAuth fields empty — no credentials are needed.

For a reproducible snippet, run npm run wmcp -- config <host> — it emits the documented key and transport for every matrix host and adds OpenCode's mandatory protocol key (see "Host & developer-experience CLIs" below).

Compatibility: this server speaks MCP 2026-07-28 only. Classic initialize/2024–2025 hosts are unsupported. Verified working: Grok Build and OpenCode (OpenCode requires the protocol key below). Verified incompatible: Cursor CLI (legacy SSE GET probe → 405) and Codex CLI (classic 2025-06-18 initialize → -32022). Cline was config-checked but not connection-tested.

Host

Config location

Key / transport field

Snippet

Claude Code

.mcp.json / ~/.claude.json

mcpServers, "type":"http"

claude mcp add --transport http wikimedia http://127.0.0.1:3000/mcp

Claude.ai / Desktop

Connectors UI or claude_desktop_config.json

mcpServers; URL for remote, command/args for stdio

{"mcpServers":{"wikimedia":{"url":"http://127.0.0.1:3000/mcp"}}}

Cursor

.cursor/mcp.json

mcpServers, URL infers remote

{"mcpServers":{"wikimedia":{"url":"http://127.0.0.1:3000/mcp"}}} — set transport explicitly if it defaults to legacy SSE

VS Code (Copilot native)

~/.copilot/mcp-config.json

mcpServers, "type":"http"

{"mcpServers":{"wikimedia":{"type":"http","url":"http://127.0.0.1:3000/mcp","tools":["*"]}}}

VS Code (editor-managed, deprecated)

.vscode/mcp.json

servers, "type":"http"

{"servers":{"wikimedia":{"type":"http","url":"http://127.0.0.1:3000/mcp"}}}

Codex CLI

~/.codex/config.toml

TOML [mcp_servers.<name>], URL implies HTTP

codex mcp add wikimedia --url http://127.0.0.1:3000/mcp

Gemini CLI

~/.gemini/settings.json

httpUrl (its url means SSE)

{"mcpServers":{"wikimedia":{"httpUrl":"http://127.0.0.1:3000/mcp"}}}

Grok Build

~/.grok/config.toml

--transport http

grok mcp add --transport http wikimedia http://127.0.0.1:3000/mcp — verified PASS (handshake 2026-07-28; 9 tools at verification, 15 after Phase 2)

OpenCode

opencode.json (mcp.servers.wikimedia)

type:"remote", protocol

{"mcp":{"servers":{"wikimedia":{"type":"remote","url":"http://127.0.0.1:3000/mcp","protocol":"2026-07-28"}}}} — verified PASS only with protocol; default legacy fails

Cline

~/.cline/data/settings/cline_mcp_settings.json

"type":"streamableHttp"

{"mcpServers":{"wikimedia":{"type":"streamableHttp","url":"http://127.0.0.1:3000/mcp"}}}

Windsurf

~/.codeium/windsurf/mcp_config.json

UI flow preferred

Customize → MCPs → add server → paste the URL

ChatGPT

UI only

remote HTTPS

Plugins → Add custom MCP server → paste URL

Integration risks: the POST-only endpoint (clients that probe with GET fail), transport-key differences (httpUrl, streamableHttp, type:"http"), and VS Code's documented config migration (editor-managed form removed Feb 2027).


Tools

Tool

Required

Purpose

search

q

Full-text search (titles, snippets, page IDs). Empty results are success.

get_summary

title

Lead summary + thumbnail.

get_page

title

Whole page as plaintext / wikitext / html, truncated at max_chars.

get_sections

title

List sections (omit section) or fetch one (section, content_format).

get_related_pages

title

Related pages.

get_media

title

Media files with per-file licence/attribution from extmetadata.

get_languages

title

Interlanguage links.

get_random_page

—

Random page summary (non-deterministic).

get_feed

kind

featured or on_this_day (event_type, date).

Phase 2 — Wikidata (Group B):

Tool

Required

Purpose

wikidata_search_entities

query

Label/alias search → QIDs, labels, descriptions (language, limit, offset).

wikidata_get_entity

qid

Projected labels/descriptions/aliases/claims/sitelinks with statement caps.

wikidata_get_statements

qid, property

Rank-ordered statements with paging, qualifiers and opt-in bounded resolve_labels.

wikidata_get_sitelinks

qid

Sitelinks filtered by allowlisted site codes (sites, include_badges, limit).

wikidata_resolve_external_id

exactly one of scheme+id or site+title

DOI/PMID/ORCID/OpenAlex/IMDb or sitelink → QID via bounded WDQS.

wikidata_sparql_query

query

Portable SPARQL 1.1 SELECT; local guard + mandatory LIMIT + endpoint fallback.

Phase 3 — Metrics (Group C):

Tool

Required

Purpose

get_pageviews

article, start, end

Daily/hourly/weekly/monthly page views for one article over a bounded, completed UTC range. Supports dotted Analytics codes and Phase 1 aliases (enwiki → en.wikipedia, commonswiki → commons.wikimedia). Empty data is results: [] with count: 0.

get_most_read

date

Most-read articles of one completed UTC day (YYYY-MM-DD), rank-ordered, with allowlisted article URLs. limit 1–100.

get_unique_devices

start, end

Project-wide cookie-based device reach estimate (devices, offset, underestimate + a meaning string). NOT per-article and NOT pageviews. daily/monthly only; all-sites/desktop-site/mobile-site.

All three metrics tools enforce local, zero-request date guards: explicit completed dates only (no today/future), end ≤ yesterday UTC, earliest date 20150101 (20160101 for most-read), granularity-aligned timestamps (weekly Mondays, monthly the 1st) and bounded spans (hourly 24 h, daily 366 d, weekly 730 d, monthly 3650 d). Breaches return invalid_date_range with details.limits. Metrics are CC0 1.0 data with attribution.required: false and an endpoint reproducing the exact request; linked article titles and content keep their own licences.

Phase 3 — Commons media (Group F):

Tool

Required

Purpose

get_file_metadata

filename

Full, compliance-oriented view: author, credit, brand_marks, wiki, restrictions, per-file licence and technical metadata. include_brand_marks (default true).

get_image_info

filename

Compact machine-readable projection: url, thumb_url, mime, dimensions, size, per-file licence short/URL and attribution.

Both tools accept optional project (default commonswiki) and thumb_width (40–1200, default 320), require a File:-prefixed title, and share one resolve pipeline: Attribution API v0-beta essential.* signals (primary) → Action API imageinfo/extmetadata enrichment → media-filtered fallbacks. The site-wide CC BY-SA 4.0 licence is never substituted for a per-file licence: an unmapped licence URL is null plus a warning (resolved via a small static deed map where possible), action-rightsinfo is always skipped with a recorded warning, HTML in extmetadata is stripped/entity-decoded and returned as untrusted data, and remote media (imagerepository != local) skips the beta call entirely. Every media result carries license, author (possibly null with a warning), attribution (with ATTRIBUTION_DISCLAIMER verbatim), source, attribution_source, warnings and resultType: "complete".

Phase 5 — Geosearch & tables (Group G, read-only):

Tool

Required

Purpose

geo_search

latitude, longitude

Radius search via the Action API list=geosearch. Finite WGS84 degrees (lat −90…90, lon −180…180), radius_m 10–10000 (default 1000), namespace 0–15 (default 0), limit 1–50 (default 10). Returns ranked pages[] with coordinates, rounded distance_m and host-derived url. Empty results are success (pages: [], count: 0, resultType: "complete"); reaching the cap sets truncated: true with a warning. Never calls /page/summary — use get_summary for one known page's coordinates.

get_tables

title

Extract tables from one page's Parsoid HTML only (/page/html/{title}; wikitext is not a table source). output: "structured" (default) → normalised headers/rows of {text, colspan, rowspan} cells; output: "html" → bounded raw <table> outerHTML strings. Optional table_index (0–19) selects one table. Caps: 20 tables / 200 rows / 30 cells / 2000 chars per cell / 20000 chars per HTML table / span 10 / final MAX_RESULT_BYTES; a breach is non-fatal truncated: true with a named warnings[] entry. Cell text and raw HTML are untrusted external data, never instructions.

Both Phase 5 tools reuse the shared Phase 1 resolver (project/lang, aliases enwiki, wikipedia:en, en.wikipedia, commonswiki, …) and provenance block (CC BY-SA 4.0, attribution.required: true). They are annotated read-only, non-destructive, open-world and idempotent, and feed only the separate G5-M3/G5-M4 load counters — never the Phase 1 M1–M6, Phase 2 B-M3/B-M4 or Phase 3 CF-M3/CF-M4 gates.

Group D — bounded recent changes (read-only):

Tool

Required

Purpose

get_recent_changes

—

Bounded recent-change feed via MediaWiki Action API action=query&list=recentchanges polling — no EventStreams/SSE stream, no subscription. One GET per call, plus at most one conditional If-None-Match revalidation; a bounded 60 s ETag/LRU cache (256 entries, 8 MiB). All arguments optional: project/lang (shared resolver aliases), namespace 0–15, time_window_seconds 60–604800 (default 300; service ceiling 86400 is clamped with a named warning), limit 1–100000 (default 50; service cap 500 is clamped and surfaced as applied_limit), include_bots, change_types (edit/new/log/categorize) and an opaque, filter-bound, hop-limited (≤10) continue cursor. Returns changes[] with rev_id, parent_rev_id, sizes/delta and host-derived url, plus count, truncated, continuation, window (with cache_age_ms), warnings and full CC BY-SA 4.0 provenance. Empty windows are a successful resultType: "complete"; a cache older than 120 s is a retryable stale_window error, never a silent empty result. Titles/users/comments are untrusted external data and are returned verbatim. Annotated read-only, non-destructive, open-world and non-idempotent (the implicit "now" makes identical calls non-deterministic). Feeds no existing nightly gate.

All nine Phase 1 tools accept optional lang (default en) and project (default wikipedia). Project aliases include wiki/wp, commonswiki, wikidatawiki, Wikimedia codes (enwiki, dewiki, testwiki), dotted forms (en.wikipedia) and the canonical source form (wikipedia:en); a code-encoded language overrides lang.

Provenance: every content result carries source, license, attribution, revision and timestamp (null where there is no single revision). Text is CC BY-SA 4.0 by default; media files carry their own licence. Attribution links preserve wprov=afsw1. All Wikidata results carry CC0 1.0 (attribution.required: false), a qid (or null for list/SPARQL results), and revision/timestamp from Wikibase REST ETag/Last-Modified; SPARQL results use source: "wikidata:sparql" and an endpoint reproducing the effective query. Phase 3 metrics carry source: "wikimedia:analytics", a CC0 1.0 licence block and an endpoint; Phase 3 media carry a per-file licence block, author and attribution_source. Returned wiki/Wikidata/media text is untrusted data, never instructions.

Errors are actionable (code, message, retryable, retry_after_seconds, hint, action, details) and never leak raw HTTP text, tokens or stack traces.


Verification

npm ci
npx tsc --noEmit -p tsconfig.json
npx tsc --noEmit -p tsconfig.test.json
npx vitest run

The merge gate is fixture-only (MSW + Vitest), covers both transports, and enforces the protocol mechanisms (semaphore ≤3, Retry-After, jittered backoff, routing headers, sentinel decoding, cache metadata). Nightly live M3/M4 load tests are in tests/live and are skipped by default (WMCP_LIVE=1 to enable).

Test stability under parallel load

Several suites (tests/contract/stdio.test.ts, tests/wikidata/schemas.test.ts, tests/phase3/*) start a real node --import tsx src/index.ts child process through RawStdioClient. On a constrained host (8 CPUs but ~1.9 GiB available RAM here), Vitest's default maxWorkers = CPUs - 1 gave every test file its own worker — a full npm test spawned 33 forks, each potentially launching a tsx child. That CPU/memory contention intermittently pushed cold starts past the 20 s per-test timeout (TestTimeoutError), even though the same files passed in isolation.

vitest.config.ts caps concurrency at maxWorkers: 4 / minWorkers: 1 and raises testTimeout/hookTimeout to 45 s (a ceiling for occasional GC and scheduler pauses, not a relaxation of any assertion). No tests are skipped or weakened. Verified with three consecutive full npm test runs at this revision: 32 files passed / 1 skipped and 278 tests passed / 5 skipped each time (durations 43.7 s, 45.9 s, 40.7 s), with no TestTimeoutError.

Security notes

  • Caller-supplied host parameters are rejected at the transport boundary (host_not_allowed) with zero outbound requests; hosts come only from the fixed resolver allowlist.

  • Every outbound request carries the configured contactable User-Agent, concurrency is capped at 3, and 429s honour Retry-After (≥5 s fallback).

  • Origin/Host allowlists, loopback default bind, and POST-only HTTP defend against DNS rebinding and cross-origin invocation.

  • Logs go to stderr only, carry correlation IDs, and redact token-shaped values. stdout on stdio is reserved for JSON-RPC.

  • The tool catalogue is static (no dynamic registration). No write capability exists in either phase.

  • Group B SPARQL is SELECT-only with a single-statement guard, a local complexity score, a mandatory top-level LIMIT (clamped to WIKIDATA_SPARQL_MAX_ROWS), a ≤60 s abort deadline, row/byte caps and a restricted SERVICE wikibase:label only. Remote SERVICE <iri>, update verbs and non-HTTPS endpoints are rejected before any request.

  • Site codes and external-ID schemes are allowlisted; QIDs/PIDs are validated before URL interpolation. Wikidata labels/descriptions are returned as data (prompt-injection canaries are not promoted to instructions).

Write tools — enabled by requester risk acceptance

The five write tools (edit_page, protect_page, move_page, delete_page, upload_file) are registered in the default 28-tool catalogue following the explicit Product Owner instruction "enable all tools" on 2026-11-21. This is recorded honestly in write-security/signoff.md: independent named signatures from Security Architect, Backend Lead and Product Owner were NOT obtained, and G8 Legal/Compliance sign-off remains pending. Every technical control remains active — OAuth issuer/scope validation, signed single-use MRTR confirmation, scoped capability tokens, blast-radius limits, kill switch with jti deny-list, HMAC hash-chain audit, dry-run diff, two-person approval, CSRF/Origin enforcement and token redaction. No control was disabled or auto-confirmed to achieve registration.

With no OAuth/CIMD configuration supplied, write calls fail closed (authentication_required/invalid_issuer) and G8 leaves real uploads blocked (licence_not_signed_off). READ_ONLY_PROFILE=1 restores the 23-tool read-only catalogue. Verification uses the fixture harness only; no real wiki write is performed.

See write-security/{signoff,rollback-runbooks,two-person-approval-runbook,upload-tou-checklist,incident-revocation-drill}.md and research/17-threat-model-rereview.md.

Gate-first spine CLI (WP1–WP5)

These commands are informational/recording only. They register no MCP tool, keep the default catalogue at 28, and never sign or fabricate a human decision.

npm run build
npm run gate:status                       # prints G1–G12, evidence paths, residual risks
npm run gate:status -- --require-signed   # informational default; non-zero while gates unsigned
npm run wmcp -- gate record --role "Security Architect" \
  --decision APPROVE_WITH_CONDITIONS --evidence sha256:<64hex> --gate G6
npm run rollback:harness -- --project testwiki --tool edit_page --dry-run
  • gate:status prints one row per gate and writes the frozen baseline to reports/gate-status.json (pretty, newline-terminated JSON). G1 and G8 are shown as UNSIGNED; a gate with a recorded decision is shown as RECORDED (not signed), never SIGNED.

  • gate record appends a tamper-evident decision chain under write-security/records/. It records decisions; it does not sign. No personal name, signature or legal approval is produced, and recorded decisions never satisfy the boot-time MCP_WRITE_GATES_SIGNED rule.

  • The WORM adapter (src/write/audit-sink.ts) defaults to the in-process local-noop sink; external sinks are opt-in and inject a transport (no paid dependency, no endpoint contacted by default). Chain verification is automatic on anchor and export; retention is sink-enforced.

  • The rollback harness is testwiki-only and human-executed. It records the sequence and writes an evidence skeleton; it performs no real wiki write. See handoff/REAL-WIKI-ROLLBACK-PLAN.md.

Host & developer-experience CLIs (WP9, WP11)

Two additive, offline commands turn documented configuration and shipped schemas into copy-pasteable artefacts. Neither registers an MCP tool, changes serverInfo.version, nor contacts the network.

npm run build
npm run wmcp -- config --list                   # 12 documented host slugs
npm run wmcp -- config opencode                 # JSON snippet on stdout; notes on stderr
npm run wmcp -- config gemini-cli --out gemini.json
npm run docs:tools                              # regenerate TOOLS.md from shipped schemas
npm run docs:tools -- --check                   # CI: non-zero if TOOLS.md is stale
  • wmcp config <host> covers all 11 hosts in report 06 §7 plus OpenCode from §7.1. It emits the documented mcpServers/servers/mcp_servers JSON, TOML or UI steps, with no secret, token or wildcard host/origin. The default URL is the local http://127.0.0.1:3000/mcp from the deployment runbook; override it with --url. Credential-bearing and wildcard URLs are rejected.

  • OpenCode's snippet always contains "protocol":"2026-07-28" — the key its legacy initialize default omits, which is the known misconfiguration this generator exists to prevent.

  • TOOLS.md is generated from the advertised JSON Schema of every shipped Zod input schema (the same object served in tools/list) and the registry's description maps. tests/unit/tool-reference.test.ts regenerates in memory and fails CI on any drift, so additive fields from later work packages must be followed by npm run docs:tools.

Demand telemetry and validation gate (WP6)

src/observability/demand-telemetry.ts records counts, not requests: tool name, call/success/failure counts, and (only when an opaque session surrogate is supplied) single-call resolution. It never reads a title, query string, snippet, token, raw subject or credential, and it never persists a session surrogate. Deliberate demand signals (revision_diff_requested, category_traversal_requested, and search-session diff intent) are explicit counters; search text is not mined to infer demand. The nightly report carries an additive demand_signals block (schema_version stays 1), and the separate reports/demand.json / reports/demand-decision.json outputs use the same pretty, newline-terminated JSON convention as reports/nightly-live.json. All three paths are gitignored; override with WMCP_DEMAND_REPORT_PATH and WMCP_DEMAND_DECISION_PATH for isolated runs. Archive the two demand files by timestamped copy using the NIGHTLY-SCHEDULER.md §5 procedure before each new evaluation overwrites them.

Decision rules (report 18 §6 / plan WP6), evaluated by evaluateDemandDecision():

  • compare_revisions → BUILD iff ≥3 downstream revision-diff requests OR (≥2% of instrumented search sessions request a diff on each of ≥7 consecutive UTC days). Otherwise DROP.

  • get_category_members → BUILD iff measured category traversal demand OR a named user request with requester and date. Only a one-way requester reference and the date are written to the decision JSON; no raw name is stored.

Evaluated 2026-11-22: both decisions are DROP / defer. This is a fresh local deployment with no external users and no observed demand signals; the nightly gate's own calls are self-tests and are deliberately excluded. No compare_revisions or get_category_members tool was built, and the default catalogue remains 28 tools. A genuine trigger must be re-measured before WP7 or WP8 may start.

Known limitations / deviations

  • WP6 session-level signals (single-call resolution and the search-session diff rate) require an opaque session surrogate to be supplied to DemandTelemetry. The tool-handler layer has no session concept, so the default server records tool-level counts only; session-level counters stay at zero rather than being guessed from arguments. The downstream-request and named-request triggers are therefore the observable paths in this deployment. No query text is inspected to manufacture a session or a demand signal.

  • The contract names @modelcontextprotocol/sdk; the registry's v1 line (@modelcontextprotocol/sdk@1.32.2) implements only up to 2025-11-25. The 2026-07-28 surface is provided by the v2 packages at 2.4.0 (see SDK-VERIFICATION.md).

  • TypeScript is pinned to 6.0.3 (not 7.x) because typescript-eslint@8.73.0 caps the peer at <6.1.0; the SDK's "≥6.0" requirement is still met.

  • The real nightly live gate (330 calls, M1–M4) is skipped by default; run npm run build && WMCP_LIVE=1 npx vitest run tests/live/live.test.ts off-peak. Metric computation is enforced fixture-backed in CI. TC-A-014 (429 → retry) runs in the merge gate. Every nightly run (pass, fail, or startup failure) writes reports/nightly-live.json (gitignored) with the timestamp, call counts, per-tool success/p95, M1–M6 pass flags, the M4 429 count, peak concurrency, overallPass and failure details; the human-readable [nightly] console diagnostics are unchanged. Set WMCP_NIGHTLY_REPORT_PATH to override the output path.

  • Group E corpus cases and the un-evidenced Group G capabilities (compare_revisions, get_category_members, liftwing_predict, all writes) remain out of scope. The two requested Group G tools (geo_search, get_tables) are implemented in Phase 5; the Group D bounded get_recent_changes tool is implemented per contract 15 v6.0.0 (Action API polling only — the internal EventStreams consumer was dropped by the 2026-11-21 spike report 12). Group B fixtures and AC-33…AC-59, Group C/F fixtures and AC-60…AC-94 (except nightly live AC-71/72/92), the Phase 5 fixtures AC-95…AC-119 (TC-G-009…019) and the Group D fixtures AC-120…AC-129 (TC-D-001…008; corpus 95 → 101) run in the merge gate with zero live network calls. The live cases (AC-42/45/59, TC-B-001/003/005/008/030, TC-C-001/002, TC-F-001) run nightly with WMCP_LIVE=1.

  • The independent /tmp/opencode/qa-mcp-smoke.mjs and qa-mcp-http.mjs scripts assert exactly twenty-two tools (the Phase 1–5 invariant). With Group D and the five write tools registered they report 28: only the tool-count check differs. They are intentionally left unmodified; use npm run verify:catalogue for the default profile and READ_ONLY_PROFILE=1 npm run verify:read-only for the explicit read-only profile.

  • Group C/F keep a separate nightly load profile (CF-M3 p95 budgets and CF-M4 429-count == 0). Phase 3 tools do not feed the Phase 1 M3/M4 or Phase 2 B-M3/B-M4 gates. Phase 5 tools (geo_search, get_tables) feed only their own G5-M3 (per-tool p95 < 2 s, ≥150 samples, excluding network-bound HTML fetches) and G5-M4 (429 count == 0) counters, never the M1–M6, B-M3/B-M4 or CF-M3/CF-M4 gates. The Group D tool feeds no existing nightly gate (optional D-M3/D-M4 counters would be nightly-only and opt-in; none is registered). No live Analytics/Attribution/imageinfo call runs in the fixture-only merge gate (AC-71, AC-72, AC-92 are nightly live).

  • Language variants without their own wiki (zh-hans, pt-br, ...) are routed to their real base-language host; the full requested code is retained in lang/source. Codes with real wikis (be-tarask, zh-min-nan, zh-tw) keep their exact host. Network/DNS failures map to upstream_unavailable with the failed host in the hint, never a generic TypeError fault.

  • get_related_pages also emits a pages alias and feed items carry per-item licence/attribution for test-corpus compatibility; these are additive.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables LLM clients to read, search, create, edit, move, protect, and delete wiki pages, upload files, inspect revision history and recent changes, and query extension data through packs for Semantic MediaWiki, Wikibase, Cargo, Bucket, and NeoWiki. Supports multiple wikis as MCP resources with per-wiki configuration, optional OAuth-authenticated writes, stdio or HTTP transports, and paginated, size-capped responses.
      8 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables LLM clients to search, read, compare, and edit pages on any MediaWiki wiki, including multi-wiki setups with OAuth-authenticated writes. It also queries extension data such as Wikibase entities, Semantic MediaWiki and Cargo results, and Bucket Lua queries.
      8 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables LLM clients to read, search, create, edit, move, protect, and delete pages, upload and update files, inspect revision history and recent changes, and query structured data across any MediaWiki-powered wiki. Supports multiple wikis with optional OAuth authentication and extension-gated tools for Wikibase, Semantic MediaWiki, Cargo, Bucket, and NeoWiki.
      8 npm
      MIT