RDF/XML serialization is deferred.
{
"@context": {
"schema": "https://schema.org/",
"wiki": "https://wazootech.github.io/wiki/",
"foaf": "http://xmlns.com/foaf/0.1/",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"owl": "http://www.w3.org/2002/07/owl#",
"dc": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"sh": "http://www.w3.org/ns/shacl#",
"wazoo": "https://schema.wazoo.dev/"
},
"@id": "wiki:wiki_mcp",
"@type": "schema:TechArticle",
"schema:articleBody": "# `wiki mcp`\n\nStart a local [Model Context Protocol](https://modelcontextprotocol.io/) server for the configured Wiki graph. The server is read-only and query-first by default: it exposes SPARQL execution, graph context, and page inspection for agents. Started with `--allow-write`, it also lists [page-edit tools](#page-edit-tools-allow-write) that wrap `wiki edit`; it never offers formatting, link repair, build, or generic filesystem tools.\n\n## Usage\n\n```bash\nwiki mcp\nwiki -c docs/wiki.yml mcp\nwiki --input docs/wiki mcp\nwiki mcp --mode stdio\nwiki mcp --cache\nwiki mcp --allow-write\n```\n\n`stdio` is the default and only transport in the first version.\n\n## Claude Code setup\n\nRegister the local server with Claude Code:\n\n```bash\nclaude mcp add wiki -- wiki -c docs/wiki.yml mcp\n```\n\nGeneric stdio MCP clients should run the same command shape:\n\n```bash\nwiki -c docs/wiki.yml mcp\n```\n\n## Options\n\n| Flag | Default | Description |\n| --------------- | ------- | ---------------------------------------------------------------------------------------- |\n| `--mode` | `stdio` | MCP transport mode. |\n| `--cache` | off | Persist graph artifacts under `.wiki/cache` across launches. |\n| `--allow-write` | off | List and serve the [page-edit tools](#page-edit-tools-allow-write). Off means read-only. |\n\n## Tools\n\n### `query_sparql`\n\nExecute SPARQL against the compiled wiki graph.\n\nParameters:\n\n```json\n{\n \"query\": \"SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10\",\n \"format\": \"json\",\n \"inference\": true,\n \"reload\": false\n}\n```\n\nAllowed query forms: `SELECT`, `ASK`, `CONSTRUCT`, and `DESCRIBE`. SPARQL Update and unsupported query forms are rejected before execution.\n\n`format` reuses [wiki query](wiki_query.md) names and aliases: `table`, `json`, `csv`, `tsv`, `turtle`, `n3`, and `markdown`. The MCP default is `json`.\n\nThe tool returns a structured object:\n\n```json\n{\n \"format\": \"json\",\n \"query_form\": \"SELECT\",\n \"result\": \"...\"\n}\n```\n\n### `describe_wiki`\n\nReturn factual context for writing grounded SPARQL:\n\n- Wiki CLI version\n- Config path and inputs\n- Namespace bindings from the built graph\n- Graph stats for the default inferred graph\n- Observed vocabulary from the graph\n\nThe vocabulary summary is intentionally load-bearing for agent use. It lists real classes and predicates so agents can avoid inventing predicates, getting empty results, and treating a bad query as missing data.\n\nExample shape:\n\n```json\n{\n \"version\": \"0.7.0\",\n \"config\": \"docs/wiki.yml\",\n \"inputs\": [\"docs/wiki\"],\n \"namespaces\": {\n \"schema\": \"https://schema.org/\",\n \"wiki\": \"https://wiki.example.org/\"\n },\n \"graph\": {\n \"triples\": 1234,\n \"subjects\": 120,\n \"predicates\": 45,\n \"objects\": 900,\n \"inference\": true\n },\n \"vocabulary\": {\n \"classes\": [\n {\n \"iri\": \"https://schema.org/Person\",\n \"curie\": \"schema:Person\",\n \"count\": 12\n }\n ],\n \"predicates\": [\n { \"iri\": \"https://schema.org/name\", \"curie\": \"schema:name\", \"count\": 42 }\n ]\n }\n}\n```\n\nVocabulary limits are intentionally compact: top 25 classes by `rdf:type` usage and top 50 predicates by triple count.\n\n## Page tools\n\nAlways available, read-only. Paths are relative to the config root, as in `wiki edit`.\n\n| Tool | Wraps | Returns |\n| ---------------- | ----------- | ------------------------------------------------------------------------------------- |\n| `wiki_page_show` | `wiki show` | Frontmatter, headings, outbound links, and the `hash` to pass as `expect` in an edit. |\n| `wiki_page_refs` | `wiki refs` | The pages that link to, and are linked from, the page. |\n\n## Page-edit tools (`--allow-write`)\n\nListed only when the server starts with `wiki mcp --allow-write`. Every tool is a thin wrapper that builds a `WikiEdit` and calls `Wiki.edit()`, so validation, `expect` preconditions, and all-or-nothing writes are the same as `wiki edit`.\n\n| Tool | Single operation |\n| --------------------- | ------------------------------------------------------------------------------------ |\n| `wiki_edit_apply` | A batch of ops (`create`, `replace`, `set`, `patch`, `move`, `delete`). Prefer this. |\n| `wiki_page_create` | `create`, from `content` or a typed scaffold (`type`, `frontmatter`, `body`). |\n| `wiki_page_set_field` | `set` one frontmatter field (`value`, or `yaml` to keep its spelling). |\n| `wiki_page_patch` | `patch` the body, a heading's section, or the frontmatter. |\n| `wiki_page_move` | `move` a page and repoint its links. |\n| `wiki_page_delete` | `delete` a page; `prune_links` turns inbound links into plain text. |\n\nSafety:\n\n- **Dry run by default.** Each tool takes `dry_run` (default `true`). The report is the one `wiki edit --json` returns; nothing is written until `dry_run: false`.\n- **Failures are results, not errors.** A rejection (`status: \"rejected\"`) or a stale `expect` (`status: \"conflict\"`) comes back with `isError: true` and the full report in `structuredContent`, so the agent can repair and retry. A malformed edit is also an `isError` result. Nothing is thrown as a JSON-RPC error.\n- **Scoped paths.** Edits are confined to the wiki's documents; `.wiki/` (installed sources and the cache) stays read-only.\n- **No force.** The MCP tools do not expose `wiki edit --force`.\n- **Graph stays current.** After an applied edit, the next query or resource read rebuilds the in-memory graph.\n\nLoop: `wiki_page_show` for the `hash`, then a dry run with `expect`, then the same call with `dry_run: false`.\n\n## Resources\n\n| Resource | MIME type | Purpose |\n| ------------------- | ------------------ | -------------------------------------------------------------- |\n| `wiki://info` | `application/json` | Version, config, inputs, graph settings, stats, and vocabulary |\n| `wiki://namespaces` | `application/json` | Prefix map for SPARQL authoring |\n| `wiki://graph.ttl` | `text/turtle` | Current inferred graph serialized as Turtle |\n\n## Safety model\n\n`wiki mcp` is read-only by default, and `--allow-write` is the only way to change that:\n\n- No wiki source mutation (without `--allow-write`; see [Page-edit tools](#page-edit-tools-allow-write) for what it adds)\n- No build output writes\n- No formatting changes\n- No link repair\n- No generic file read/write tools\n- No Obsidian automation\n- No SPARQL Update\n\nThe command reuses the same graph cache behavior as other Wiki CLI operations: in-process caching is always used within one running MCP server, and `--cache` enables filesystem persistence under `.wiki/cache` for faster reuse across MCP launches. `reload=true` on `query_sparql` rebuilds the in-memory graph before executing the query; with `--cache`, the rebuilt graph is also written back to the filesystem cache.\n\n## Related\n\n- [wiki query](wiki_query.md)\n- [wiki serve](wiki_serve.md#sparql-endpoint)\n- [Graph Cache](Graph_Cache.md)\n- [SPARQL](SPARQL.md)",
"schema:dateCreated": {
"@type": "xsd:dateTime",
"@value": "2026-10-31T23:19:03Z"
},
"schema:dateModified": {
"@type": "xsd:dateTime",
"@value": "2026-10-31T23:19:03Z"
},
"schema:description": "Run an MCP server for querying the wiki graph, with opt-in page-edit tools.",
"schema:headline": "wiki mcp"
}
@prefix schema: <https://schema.org/>.
@prefix wiki: <https://wazootech.github.io/wiki/>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix sh: <http://www.w3.org/ns/shacl#>.
@prefix wazoo: <https://schema.wazoo.dev/>.
wiki:wiki_mcp a schema:TechArticle;
schema:description "Run an MCP server for querying the wiki graph, with opt-in page-edit tools.";
schema:articleBody "# `wiki mcp`\n\nStart a local [Model Context Protocol](https://modelcontextprotocol.io/) server for the configured Wiki graph. The server is read-only and query-first by default: it exposes SPARQL execution, graph context, and page inspection for agents. Started with `--allow-write`, it also lists [page-edit tools](#page-edit-tools-allow-write) that wrap `wiki edit`; it never offers formatting, link repair, build, or generic filesystem tools.\n\n## Usage\n\n```bash\nwiki mcp\nwiki -c docs/wiki.yml mcp\nwiki --input docs/wiki mcp\nwiki mcp --mode stdio\nwiki mcp --cache\nwiki mcp --allow-write\n```\n\n`stdio` is the default and only transport in the first version.\n\n## Claude Code setup\n\nRegister the local server with Claude Code:\n\n```bash\nclaude mcp add wiki -- wiki -c docs/wiki.yml mcp\n```\n\nGeneric stdio MCP clients should run the same command shape:\n\n```bash\nwiki -c docs/wiki.yml mcp\n```\n\n## Options\n\n| Flag | Default | Description |\n| --------------- | ------- | ---------------------------------------------------------------------------------------- |\n| `--mode` | `stdio` | MCP transport mode. |\n| `--cache` | off | Persist graph artifacts under `.wiki/cache` across launches. |\n| `--allow-write` | off | List and serve the [page-edit tools](#page-edit-tools-allow-write). Off means read-only. |\n\n## Tools\n\n### `query_sparql`\n\nExecute SPARQL against the compiled wiki graph.\n\nParameters:\n\n```json\n{\n \"query\": \"SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10\",\n \"format\": \"json\",\n \"inference\": true,\n \"reload\": false\n}\n```\n\nAllowed query forms: `SELECT`, `ASK`, `CONSTRUCT`, and `DESCRIBE`. SPARQL Update and unsupported query forms are rejected before execution.\n\n`format` reuses [wiki query](wiki_query.md) names and aliases: `table`, `json`, `csv`, `tsv`, `turtle`, `n3`, and `markdown`. The MCP default is `json`.\n\nThe tool returns a structured object:\n\n```json\n{\n \"format\": \"json\",\n \"query_form\": \"SELECT\",\n \"result\": \"...\"\n}\n```\n\n### `describe_wiki`\n\nReturn factual context for writing grounded SPARQL:\n\n- Wiki CLI version\n- Config path and inputs\n- Namespace bindings from the built graph\n- Graph stats for the default inferred graph\n- Observed vocabulary from the graph\n\nThe vocabulary summary is intentionally load-bearing for agent use. It lists real classes and predicates so agents can avoid inventing predicates, getting empty results, and treating a bad query as missing data.\n\nExample shape:\n\n```json\n{\n \"version\": \"0.7.0\",\n \"config\": \"docs/wiki.yml\",\n \"inputs\": [\"docs/wiki\"],\n \"namespaces\": {\n \"schema\": \"https://schema.org/\",\n \"wiki\": \"https://wiki.example.org/\"\n },\n \"graph\": {\n \"triples\": 1234,\n \"subjects\": 120,\n \"predicates\": 45,\n \"objects\": 900,\n \"inference\": true\n },\n \"vocabulary\": {\n \"classes\": [\n {\n \"iri\": \"https://schema.org/Person\",\n \"curie\": \"schema:Person\",\n \"count\": 12\n }\n ],\n \"predicates\": [\n { \"iri\": \"https://schema.org/name\", \"curie\": \"schema:name\", \"count\": 42 }\n ]\n }\n}\n```\n\nVocabulary limits are intentionally compact: top 25 classes by `rdf:type` usage and top 50 predicates by triple count.\n\n## Page tools\n\nAlways available, read-only. Paths are relative to the config root, as in `wiki edit`.\n\n| Tool | Wraps | Returns |\n| ---------------- | ----------- | ------------------------------------------------------------------------------------- |\n| `wiki_page_show` | `wiki show` | Frontmatter, headings, outbound links, and the `hash` to pass as `expect` in an edit. |\n| `wiki_page_refs` | `wiki refs` | The pages that link to, and are linked from, the page. |\n\n## Page-edit tools (`--allow-write`)\n\nListed only when the server starts with `wiki mcp --allow-write`. Every tool is a thin wrapper that builds a `WikiEdit` and calls `Wiki.edit()`, so validation, `expect` preconditions, and all-or-nothing writes are the same as `wiki edit`.\n\n| Tool | Single operation |\n| --------------------- | ------------------------------------------------------------------------------------ |\n| `wiki_edit_apply` | A batch of ops (`create`, `replace`, `set`, `patch`, `move`, `delete`). Prefer this. |\n| `wiki_page_create` | `create`, from `content` or a typed scaffold (`type`, `frontmatter`, `body`). |\n| `wiki_page_set_field` | `set` one frontmatter field (`value`, or `yaml` to keep its spelling). |\n| `wiki_page_patch` | `patch` the body, a heading's section, or the frontmatter. |\n| `wiki_page_move` | `move` a page and repoint its links. |\n| `wiki_page_delete` | `delete` a page; `prune_links` turns inbound links into plain text. |\n\nSafety:\n\n- **Dry run by default.** Each tool takes `dry_run` (default `true`). The report is the one `wiki edit --json` returns; nothing is written until `dry_run: false`.\n- **Failures are results, not errors.** A rejection (`status: \"rejected\"`) or a stale `expect` (`status: \"conflict\"`) comes back with `isError: true` and the full report in `structuredContent`, so the agent can repair and retry. A malformed edit is also an `isError` result. Nothing is thrown as a JSON-RPC error.\n- **Scoped paths.** Edits are confined to the wiki's documents; `.wiki/` (installed sources and the cache) stays read-only.\n- **No force.** The MCP tools do not expose `wiki edit --force`.\n- **Graph stays current.** After an applied edit, the next query or resource read rebuilds the in-memory graph.\n\nLoop: `wiki_page_show` for the `hash`, then a dry run with `expect`, then the same call with `dry_run: false`.\n\n## Resources\n\n| Resource | MIME type | Purpose |\n| ------------------- | ------------------ | -------------------------------------------------------------- |\n| `wiki://info` | `application/json` | Version, config, inputs, graph settings, stats, and vocabulary |\n| `wiki://namespaces` | `application/json` | Prefix map for SPARQL authoring |\n| `wiki://graph.ttl` | `text/turtle` | Current inferred graph serialized as Turtle |\n\n## Safety model\n\n`wiki mcp` is read-only by default, and `--allow-write` is the only way to change that:\n\n- No wiki source mutation (without `--allow-write`; see [Page-edit tools](#page-edit-tools-allow-write) for what it adds)\n- No build output writes\n- No formatting changes\n- No link repair\n- No generic file read/write tools\n- No Obsidian automation\n- No SPARQL Update\n\nThe command reuses the same graph cache behavior as other Wiki CLI operations: in-process caching is always used within one running MCP server, and `--cache` enables filesystem persistence under `.wiki/cache` for faster reuse across MCP launches. `reload=true` on `query_sparql` rebuilds the in-memory graph before executing the query; with `--cache`, the rebuilt graph is also written back to the filesystem cache.\n\n## Related\n\n- [wiki query](wiki_query.md)\n- [wiki serve](wiki_serve.md#sparql-endpoint)\n- [Graph Cache](Graph_Cache.md)\n- [SPARQL](SPARQL.md)";
schema:headline "wiki mcp";
schema:dateCreated "2026-10-31T23:19:03Z"^^xsd:dateTime;
schema:dateModified "2026-10-31T23:19:03Z"^^xsd:dateTime.
@prefix schema: <https://schema.org/>.
@prefix wiki: <https://wazootech.github.io/wiki/>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix sh: <http://www.w3.org/ns/shacl#>.
@prefix wazoo: <https://schema.wazoo.dev/>.
wiki:wiki_mcp a schema:TechArticle;
schema:description "Run an MCP server for querying the wiki graph, with opt-in page-edit tools.";
schema:articleBody "# `wiki mcp`\n\nStart a local [Model Context Protocol](https://modelcontextprotocol.io/) server for the configured Wiki graph. The server is read-only and query-first by default: it exposes SPARQL execution, graph context, and page inspection for agents. Started with `--allow-write`, it also lists [page-edit tools](#page-edit-tools-allow-write) that wrap `wiki edit`; it never offers formatting, link repair, build, or generic filesystem tools.\n\n## Usage\n\n```bash\nwiki mcp\nwiki -c docs/wiki.yml mcp\nwiki --input docs/wiki mcp\nwiki mcp --mode stdio\nwiki mcp --cache\nwiki mcp --allow-write\n```\n\n`stdio` is the default and only transport in the first version.\n\n## Claude Code setup\n\nRegister the local server with Claude Code:\n\n```bash\nclaude mcp add wiki -- wiki -c docs/wiki.yml mcp\n```\n\nGeneric stdio MCP clients should run the same command shape:\n\n```bash\nwiki -c docs/wiki.yml mcp\n```\n\n## Options\n\n| Flag | Default | Description |\n| --------------- | ------- | ---------------------------------------------------------------------------------------- |\n| `--mode` | `stdio` | MCP transport mode. |\n| `--cache` | off | Persist graph artifacts under `.wiki/cache` across launches. |\n| `--allow-write` | off | List and serve the [page-edit tools](#page-edit-tools-allow-write). Off means read-only. |\n\n## Tools\n\n### `query_sparql`\n\nExecute SPARQL against the compiled wiki graph.\n\nParameters:\n\n```json\n{\n \"query\": \"SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10\",\n \"format\": \"json\",\n \"inference\": true,\n \"reload\": false\n}\n```\n\nAllowed query forms: `SELECT`, `ASK`, `CONSTRUCT`, and `DESCRIBE`. SPARQL Update and unsupported query forms are rejected before execution.\n\n`format` reuses [wiki query](wiki_query.md) names and aliases: `table`, `json`, `csv`, `tsv`, `turtle`, `n3`, and `markdown`. The MCP default is `json`.\n\nThe tool returns a structured object:\n\n```json\n{\n \"format\": \"json\",\n \"query_form\": \"SELECT\",\n \"result\": \"...\"\n}\n```\n\n### `describe_wiki`\n\nReturn factual context for writing grounded SPARQL:\n\n- Wiki CLI version\n- Config path and inputs\n- Namespace bindings from the built graph\n- Graph stats for the default inferred graph\n- Observed vocabulary from the graph\n\nThe vocabulary summary is intentionally load-bearing for agent use. It lists real classes and predicates so agents can avoid inventing predicates, getting empty results, and treating a bad query as missing data.\n\nExample shape:\n\n```json\n{\n \"version\": \"0.7.0\",\n \"config\": \"docs/wiki.yml\",\n \"inputs\": [\"docs/wiki\"],\n \"namespaces\": {\n \"schema\": \"https://schema.org/\",\n \"wiki\": \"https://wiki.example.org/\"\n },\n \"graph\": {\n \"triples\": 1234,\n \"subjects\": 120,\n \"predicates\": 45,\n \"objects\": 900,\n \"inference\": true\n },\n \"vocabulary\": {\n \"classes\": [\n {\n \"iri\": \"https://schema.org/Person\",\n \"curie\": \"schema:Person\",\n \"count\": 12\n }\n ],\n \"predicates\": [\n { \"iri\": \"https://schema.org/name\", \"curie\": \"schema:name\", \"count\": 42 }\n ]\n }\n}\n```\n\nVocabulary limits are intentionally compact: top 25 classes by `rdf:type` usage and top 50 predicates by triple count.\n\n## Page tools\n\nAlways available, read-only. Paths are relative to the config root, as in `wiki edit`.\n\n| Tool | Wraps | Returns |\n| ---------------- | ----------- | ------------------------------------------------------------------------------------- |\n| `wiki_page_show` | `wiki show` | Frontmatter, headings, outbound links, and the `hash` to pass as `expect` in an edit. |\n| `wiki_page_refs` | `wiki refs` | The pages that link to, and are linked from, the page. |\n\n## Page-edit tools (`--allow-write`)\n\nListed only when the server starts with `wiki mcp --allow-write`. Every tool is a thin wrapper that builds a `WikiEdit` and calls `Wiki.edit()`, so validation, `expect` preconditions, and all-or-nothing writes are the same as `wiki edit`.\n\n| Tool | Single operation |\n| --------------------- | ------------------------------------------------------------------------------------ |\n| `wiki_edit_apply` | A batch of ops (`create`, `replace`, `set`, `patch`, `move`, `delete`). Prefer this. |\n| `wiki_page_create` | `create`, from `content` or a typed scaffold (`type`, `frontmatter`, `body`). |\n| `wiki_page_set_field` | `set` one frontmatter field (`value`, or `yaml` to keep its spelling). |\n| `wiki_page_patch` | `patch` the body, a heading's section, or the frontmatter. |\n| `wiki_page_move` | `move` a page and repoint its links. |\n| `wiki_page_delete` | `delete` a page; `prune_links` turns inbound links into plain text. |\n\nSafety:\n\n- **Dry run by default.** Each tool takes `dry_run` (default `true`). The report is the one `wiki edit --json` returns; nothing is written until `dry_run: false`.\n- **Failures are results, not errors.** A rejection (`status: \"rejected\"`) or a stale `expect` (`status: \"conflict\"`) comes back with `isError: true` and the full report in `structuredContent`, so the agent can repair and retry. A malformed edit is also an `isError` result. Nothing is thrown as a JSON-RPC error.\n- **Scoped paths.** Edits are confined to the wiki's documents; `.wiki/` (installed sources and the cache) stays read-only.\n- **No force.** The MCP tools do not expose `wiki edit --force`.\n- **Graph stays current.** After an applied edit, the next query or resource read rebuilds the in-memory graph.\n\nLoop: `wiki_page_show` for the `hash`, then a dry run with `expect`, then the same call with `dry_run: false`.\n\n## Resources\n\n| Resource | MIME type | Purpose |\n| ------------------- | ------------------ | -------------------------------------------------------------- |\n| `wiki://info` | `application/json` | Version, config, inputs, graph settings, stats, and vocabulary |\n| `wiki://namespaces` | `application/json` | Prefix map for SPARQL authoring |\n| `wiki://graph.ttl` | `text/turtle` | Current inferred graph serialized as Turtle |\n\n## Safety model\n\n`wiki mcp` is read-only by default, and `--allow-write` is the only way to change that:\n\n- No wiki source mutation (without `--allow-write`; see [Page-edit tools](#page-edit-tools-allow-write) for what it adds)\n- No build output writes\n- No formatting changes\n- No link repair\n- No generic file read/write tools\n- No Obsidian automation\n- No SPARQL Update\n\nThe command reuses the same graph cache behavior as other Wiki CLI operations: in-process caching is always used within one running MCP server, and `--cache` enables filesystem persistence under `.wiki/cache` for faster reuse across MCP launches. `reload=true` on `query_sparql` rebuilds the in-memory graph before executing the query; with `--cache`, the rebuilt graph is also written back to the filesystem cache.\n\n## Related\n\n- [wiki query](wiki_query.md)\n- [wiki serve](wiki_serve.md#sparql-endpoint)\n- [Graph Cache](Graph_Cache.md)\n- [SPARQL](SPARQL.md)";
schema:headline "wiki mcp";
schema:dateCreated "2026-10-31T23:19:03Z"^^xsd:dateTime;
schema:dateModified "2026-10-31T23:19:03Z"^^xsd:dateTime.
<https://wazootech.github.io/wiki/wiki_mcp> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://schema.org/TechArticle> .
<https://wazootech.github.io/wiki/wiki_mcp> <https://schema.org/description> "Run an MCP server for querying the wiki graph, with opt-in page-edit tools." .
<https://wazootech.github.io/wiki/wiki_mcp> <https://schema.org/articleBody> "# `wiki mcp`\n\nStart a local [Model Context Protocol](https://modelcontextprotocol.io/) server for the configured Wiki graph. The server is read-only and query-first by default: it exposes SPARQL execution, graph context, and page inspection for agents. Started with `--allow-write`, it also lists [page-edit tools](#page-edit-tools-allow-write) that wrap `wiki edit`; it never offers formatting, link repair, build, or generic filesystem tools.\n\n## Usage\n\n```bash\nwiki mcp\nwiki -c docs/wiki.yml mcp\nwiki --input docs/wiki mcp\nwiki mcp --mode stdio\nwiki mcp --cache\nwiki mcp --allow-write\n```\n\n`stdio` is the default and only transport in the first version.\n\n## Claude Code setup\n\nRegister the local server with Claude Code:\n\n```bash\nclaude mcp add wiki -- wiki -c docs/wiki.yml mcp\n```\n\nGeneric stdio MCP clients should run the same command shape:\n\n```bash\nwiki -c docs/wiki.yml mcp\n```\n\n## Options\n\n| Flag | Default | Description |\n| --------------- | ------- | ---------------------------------------------------------------------------------------- |\n| `--mode` | `stdio` | MCP transport mode. |\n| `--cache` | off | Persist graph artifacts under `.wiki/cache` across launches. |\n| `--allow-write` | off | List and serve the [page-edit tools](#page-edit-tools-allow-write). Off means read-only. |\n\n## Tools\n\n### `query_sparql`\n\nExecute SPARQL against the compiled wiki graph.\n\nParameters:\n\n```json\n{\n \"query\": \"SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10\",\n \"format\": \"json\",\n \"inference\": true,\n \"reload\": false\n}\n```\n\nAllowed query forms: `SELECT`, `ASK`, `CONSTRUCT`, and `DESCRIBE`. SPARQL Update and unsupported query forms are rejected before execution.\n\n`format` reuses [wiki query](wiki_query.md) names and aliases: `table`, `json`, `csv`, `tsv`, `turtle`, `n3`, and `markdown`. The MCP default is `json`.\n\nThe tool returns a structured object:\n\n```json\n{\n \"format\": \"json\",\n \"query_form\": \"SELECT\",\n \"result\": \"...\"\n}\n```\n\n### `describe_wiki`\n\nReturn factual context for writing grounded SPARQL:\n\n- Wiki CLI version\n- Config path and inputs\n- Namespace bindings from the built graph\n- Graph stats for the default inferred graph\n- Observed vocabulary from the graph\n\nThe vocabulary summary is intentionally load-bearing for agent use. It lists real classes and predicates so agents can avoid inventing predicates, getting empty results, and treating a bad query as missing data.\n\nExample shape:\n\n```json\n{\n \"version\": \"0.7.0\",\n \"config\": \"docs/wiki.yml\",\n \"inputs\": [\"docs/wiki\"],\n \"namespaces\": {\n \"schema\": \"https://schema.org/\",\n \"wiki\": \"https://wiki.example.org/\"\n },\n \"graph\": {\n \"triples\": 1234,\n \"subjects\": 120,\n \"predicates\": 45,\n \"objects\": 900,\n \"inference\": true\n },\n \"vocabulary\": {\n \"classes\": [\n {\n \"iri\": \"https://schema.org/Person\",\n \"curie\": \"schema:Person\",\n \"count\": 12\n }\n ],\n \"predicates\": [\n { \"iri\": \"https://schema.org/name\", \"curie\": \"schema:name\", \"count\": 42 }\n ]\n }\n}\n```\n\nVocabulary limits are intentionally compact: top 25 classes by `rdf:type` usage and top 50 predicates by triple count.\n\n## Page tools\n\nAlways available, read-only. Paths are relative to the config root, as in `wiki edit`.\n\n| Tool | Wraps | Returns |\n| ---------------- | ----------- | ------------------------------------------------------------------------------------- |\n| `wiki_page_show` | `wiki show` | Frontmatter, headings, outbound links, and the `hash` to pass as `expect` in an edit. |\n| `wiki_page_refs` | `wiki refs` | The pages that link to, and are linked from, the page. |\n\n## Page-edit tools (`--allow-write`)\n\nListed only when the server starts with `wiki mcp --allow-write`. Every tool is a thin wrapper that builds a `WikiEdit` and calls `Wiki.edit()`, so validation, `expect` preconditions, and all-or-nothing writes are the same as `wiki edit`.\n\n| Tool | Single operation |\n| --------------------- | ------------------------------------------------------------------------------------ |\n| `wiki_edit_apply` | A batch of ops (`create`, `replace`, `set`, `patch`, `move`, `delete`). Prefer this. |\n| `wiki_page_create` | `create`, from `content` or a typed scaffold (`type`, `frontmatter`, `body`). |\n| `wiki_page_set_field` | `set` one frontmatter field (`value`, or `yaml` to keep its spelling). |\n| `wiki_page_patch` | `patch` the body, a heading's section, or the frontmatter. |\n| `wiki_page_move` | `move` a page and repoint its links. |\n| `wiki_page_delete` | `delete` a page; `prune_links` turns inbound links into plain text. |\n\nSafety:\n\n- **Dry run by default.** Each tool takes `dry_run` (default `true`). The report is the one `wiki edit --json` returns; nothing is written until `dry_run: false`.\n- **Failures are results, not errors.** A rejection (`status: \"rejected\"`) or a stale `expect` (`status: \"conflict\"`) comes back with `isError: true` and the full report in `structuredContent`, so the agent can repair and retry. A malformed edit is also an `isError` result. Nothing is thrown as a JSON-RPC error.\n- **Scoped paths.** Edits are confined to the wiki's documents; `.wiki/` (installed sources and the cache) stays read-only.\n- **No force.** The MCP tools do not expose `wiki edit --force`.\n- **Graph stays current.** After an applied edit, the next query or resource read rebuilds the in-memory graph.\n\nLoop: `wiki_page_show` for the `hash`, then a dry run with `expect`, then the same call with `dry_run: false`.\n\n## Resources\n\n| Resource | MIME type | Purpose |\n| ------------------- | ------------------ | -------------------------------------------------------------- |\n| `wiki://info` | `application/json` | Version, config, inputs, graph settings, stats, and vocabulary |\n| `wiki://namespaces` | `application/json` | Prefix map for SPARQL authoring |\n| `wiki://graph.ttl` | `text/turtle` | Current inferred graph serialized as Turtle |\n\n## Safety model\n\n`wiki mcp` is read-only by default, and `--allow-write` is the only way to change that:\n\n- No wiki source mutation (without `--allow-write`; see [Page-edit tools](#page-edit-tools-allow-write) for what it adds)\n- No build output writes\n- No formatting changes\n- No link repair\n- No generic file read/write tools\n- No Obsidian automation\n- No SPARQL Update\n\nThe command reuses the same graph cache behavior as other Wiki CLI operations: in-process caching is always used within one running MCP server, and `--cache` enables filesystem persistence under `.wiki/cache` for faster reuse across MCP launches. `reload=true` on `query_sparql` rebuilds the in-memory graph before executing the query; with `--cache`, the rebuilt graph is also written back to the filesystem cache.\n\n## Related\n\n- [wiki query](wiki_query.md)\n- [wiki serve](wiki_serve.md#sparql-endpoint)\n- [Graph Cache](Graph_Cache.md)\n- [SPARQL](SPARQL.md)" .
<https://wazootech.github.io/wiki/wiki_mcp> <https://schema.org/headline> "wiki mcp" .
<https://wazootech.github.io/wiki/wiki_mcp> <https://schema.org/dateCreated> "2026-10-31T23:19:03Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
<https://wazootech.github.io/wiki/wiki_mcp> <https://schema.org/dateModified> "2026-10-31T23:19:03Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
@prefix schema: <https://schema.org/>.
@prefix wiki: <https://wazootech.github.io/wiki/>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix sh: <http://www.w3.org/ns/shacl#>.
@prefix wazoo: <https://schema.wazoo.dev/>.
wiki:wiki_mcp a schema:TechArticle;
schema:description "Run an MCP server for querying the wiki graph, with opt-in page-edit tools.";
schema:articleBody "# `wiki mcp`\n\nStart a local [Model Context Protocol](https://modelcontextprotocol.io/) server for the configured Wiki graph. The server is read-only and query-first by default: it exposes SPARQL execution, graph context, and page inspection for agents. Started with `--allow-write`, it also lists [page-edit tools](#page-edit-tools-allow-write) that wrap `wiki edit`; it never offers formatting, link repair, build, or generic filesystem tools.\n\n## Usage\n\n```bash\nwiki mcp\nwiki -c docs/wiki.yml mcp\nwiki --input docs/wiki mcp\nwiki mcp --mode stdio\nwiki mcp --cache\nwiki mcp --allow-write\n```\n\n`stdio` is the default and only transport in the first version.\n\n## Claude Code setup\n\nRegister the local server with Claude Code:\n\n```bash\nclaude mcp add wiki -- wiki -c docs/wiki.yml mcp\n```\n\nGeneric stdio MCP clients should run the same command shape:\n\n```bash\nwiki -c docs/wiki.yml mcp\n```\n\n## Options\n\n| Flag | Default | Description |\n| --------------- | ------- | ---------------------------------------------------------------------------------------- |\n| `--mode` | `stdio` | MCP transport mode. |\n| `--cache` | off | Persist graph artifacts under `.wiki/cache` across launches. |\n| `--allow-write` | off | List and serve the [page-edit tools](#page-edit-tools-allow-write). Off means read-only. |\n\n## Tools\n\n### `query_sparql`\n\nExecute SPARQL against the compiled wiki graph.\n\nParameters:\n\n```json\n{\n \"query\": \"SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10\",\n \"format\": \"json\",\n \"inference\": true,\n \"reload\": false\n}\n```\n\nAllowed query forms: `SELECT`, `ASK`, `CONSTRUCT`, and `DESCRIBE`. SPARQL Update and unsupported query forms are rejected before execution.\n\n`format` reuses [wiki query](wiki_query.md) names and aliases: `table`, `json`, `csv`, `tsv`, `turtle`, `n3`, and `markdown`. The MCP default is `json`.\n\nThe tool returns a structured object:\n\n```json\n{\n \"format\": \"json\",\n \"query_form\": \"SELECT\",\n \"result\": \"...\"\n}\n```\n\n### `describe_wiki`\n\nReturn factual context for writing grounded SPARQL:\n\n- Wiki CLI version\n- Config path and inputs\n- Namespace bindings from the built graph\n- Graph stats for the default inferred graph\n- Observed vocabulary from the graph\n\nThe vocabulary summary is intentionally load-bearing for agent use. It lists real classes and predicates so agents can avoid inventing predicates, getting empty results, and treating a bad query as missing data.\n\nExample shape:\n\n```json\n{\n \"version\": \"0.7.0\",\n \"config\": \"docs/wiki.yml\",\n \"inputs\": [\"docs/wiki\"],\n \"namespaces\": {\n \"schema\": \"https://schema.org/\",\n \"wiki\": \"https://wiki.example.org/\"\n },\n \"graph\": {\n \"triples\": 1234,\n \"subjects\": 120,\n \"predicates\": 45,\n \"objects\": 900,\n \"inference\": true\n },\n \"vocabulary\": {\n \"classes\": [\n {\n \"iri\": \"https://schema.org/Person\",\n \"curie\": \"schema:Person\",\n \"count\": 12\n }\n ],\n \"predicates\": [\n { \"iri\": \"https://schema.org/name\", \"curie\": \"schema:name\", \"count\": 42 }\n ]\n }\n}\n```\n\nVocabulary limits are intentionally compact: top 25 classes by `rdf:type` usage and top 50 predicates by triple count.\n\n## Page tools\n\nAlways available, read-only. Paths are relative to the config root, as in `wiki edit`.\n\n| Tool | Wraps | Returns |\n| ---------------- | ----------- | ------------------------------------------------------------------------------------- |\n| `wiki_page_show` | `wiki show` | Frontmatter, headings, outbound links, and the `hash` to pass as `expect` in an edit. |\n| `wiki_page_refs` | `wiki refs` | The pages that link to, and are linked from, the page. |\n\n## Page-edit tools (`--allow-write`)\n\nListed only when the server starts with `wiki mcp --allow-write`. Every tool is a thin wrapper that builds a `WikiEdit` and calls `Wiki.edit()`, so validation, `expect` preconditions, and all-or-nothing writes are the same as `wiki edit`.\n\n| Tool | Single operation |\n| --------------------- | ------------------------------------------------------------------------------------ |\n| `wiki_edit_apply` | A batch of ops (`create`, `replace`, `set`, `patch`, `move`, `delete`). Prefer this. |\n| `wiki_page_create` | `create`, from `content` or a typed scaffold (`type`, `frontmatter`, `body`). |\n| `wiki_page_set_field` | `set` one frontmatter field (`value`, or `yaml` to keep its spelling). |\n| `wiki_page_patch` | `patch` the body, a heading's section, or the frontmatter. |\n| `wiki_page_move` | `move` a page and repoint its links. |\n| `wiki_page_delete` | `delete` a page; `prune_links` turns inbound links into plain text. |\n\nSafety:\n\n- **Dry run by default.** Each tool takes `dry_run` (default `true`). The report is the one `wiki edit --json` returns; nothing is written until `dry_run: false`.\n- **Failures are results, not errors.** A rejection (`status: \"rejected\"`) or a stale `expect` (`status: \"conflict\"`) comes back with `isError: true` and the full report in `structuredContent`, so the agent can repair and retry. A malformed edit is also an `isError` result. Nothing is thrown as a JSON-RPC error.\n- **Scoped paths.** Edits are confined to the wiki's documents; `.wiki/` (installed sources and the cache) stays read-only.\n- **No force.** The MCP tools do not expose `wiki edit --force`.\n- **Graph stays current.** After an applied edit, the next query or resource read rebuilds the in-memory graph.\n\nLoop: `wiki_page_show` for the `hash`, then a dry run with `expect`, then the same call with `dry_run: false`.\n\n## Resources\n\n| Resource | MIME type | Purpose |\n| ------------------- | ------------------ | -------------------------------------------------------------- |\n| `wiki://info` | `application/json` | Version, config, inputs, graph settings, stats, and vocabulary |\n| `wiki://namespaces` | `application/json` | Prefix map for SPARQL authoring |\n| `wiki://graph.ttl` | `text/turtle` | Current inferred graph serialized as Turtle |\n\n## Safety model\n\n`wiki mcp` is read-only by default, and `--allow-write` is the only way to change that:\n\n- No wiki source mutation (without `--allow-write`; see [Page-edit tools](#page-edit-tools-allow-write) for what it adds)\n- No build output writes\n- No formatting changes\n- No link repair\n- No generic file read/write tools\n- No Obsidian automation\n- No SPARQL Update\n\nThe command reuses the same graph cache behavior as other Wiki CLI operations: in-process caching is always used within one running MCP server, and `--cache` enables filesystem persistence under `.wiki/cache` for faster reuse across MCP launches. `reload=true` on `query_sparql` rebuilds the in-memory graph before executing the query; with `--cache`, the rebuilt graph is also written back to the filesystem cache.\n\n## Related\n\n- [wiki query](wiki_query.md)\n- [wiki serve](wiki_serve.md#sparql-endpoint)\n- [Graph Cache](Graph_Cache.md)\n- [SPARQL](SPARQL.md)";
schema:headline "wiki mcp";
schema:dateCreated "2026-10-31T23:19:03Z"^^xsd:dateTime;
schema:dateModified "2026-10-31T23:19:03Z"^^xsd:dateTime.
<https://wazootech.github.io/wiki/wiki_mcp> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://schema.org/TechArticle> .
<https://wazootech.github.io/wiki/wiki_mcp> <https://schema.org/description> "Run an MCP server for querying the wiki graph, with opt-in page-edit tools." .
<https://wazootech.github.io/wiki/wiki_mcp> <https://schema.org/articleBody> """# `wiki mcp`
Start a local [Model Context Protocol](https://modelcontextprotocol.io/) server for the configured Wiki graph. The server is read-only and query-first by default: it exposes SPARQL execution, graph context, and page inspection for agents. Started with `--allow-write`, it also lists [page-edit tools](#page-edit-tools-allow-write) that wrap `wiki edit`; it never offers formatting, link repair, build, or generic filesystem tools.
## Usage
```bash
wiki mcp
wiki -c docs/wiki.yml mcp
wiki --input docs/wiki mcp
wiki mcp --mode stdio
wiki mcp --cache
wiki mcp --allow-write
```
`stdio` is the default and only transport in the first version.
## Claude Code setup
Register the local server with Claude Code:
```bash
claude mcp add wiki -- wiki -c docs/wiki.yml mcp
```
Generic stdio MCP clients should run the same command shape:
```bash
wiki -c docs/wiki.yml mcp
```
## Options
| Flag | Default | Description |
| --------------- | ------- | ---------------------------------------------------------------------------------------- |
| `--mode` | `stdio` | MCP transport mode. |
| `--cache` | off | Persist graph artifacts under `.wiki/cache` across launches. |
| `--allow-write` | off | List and serve the [page-edit tools](#page-edit-tools-allow-write). Off means read-only. |
## Tools
### `query_sparql`
Execute SPARQL against the compiled wiki graph.
Parameters:
```json
{
"query": "SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10",
"format": "json",
"inference": true,
"reload": false
}
```
Allowed query forms: `SELECT`, `ASK`, `CONSTRUCT`, and `DESCRIBE`. SPARQL Update and unsupported query forms are rejected before execution.
`format` reuses [wiki query](wiki_query.md) names and aliases: `table`, `json`, `csv`, `tsv`, `turtle`, `n3`, and `markdown`. The MCP default is `json`.
The tool returns a structured object:
```json
{
"format": "json",
"query_form": "SELECT",
"result": "..."
}
```
### `describe_wiki`
Return factual context for writing grounded SPARQL:
- Wiki CLI version
- Config path and inputs
- Namespace bindings from the built graph
- Graph stats for the default inferred graph
- Observed vocabulary from the graph
The vocabulary summary is intentionally load-bearing for agent use. It lists real classes and predicates so agents can avoid inventing predicates, getting empty results, and treating a bad query as missing data.
Example shape:
```json
{
"version": "0.7.0",
"config": "docs/wiki.yml",
"inputs": ["docs/wiki"],
"namespaces": {
"schema": "https://schema.org/",
"wiki": "https://wiki.example.org/"
},
"graph": {
"triples": 1234,
"subjects": 120,
"predicates": 45,
"objects": 900,
"inference": true
},
"vocabulary": {
"classes": [
{
"iri": "https://schema.org/Person",
"curie": "schema:Person",
"count": 12
}
],
"predicates": [
{ "iri": "https://schema.org/name", "curie": "schema:name", "count": 42 }
]
}
}
```
Vocabulary limits are intentionally compact: top 25 classes by `rdf:type` usage and top 50 predicates by triple count.
## Page tools
Always available, read-only. Paths are relative to the config root, as in `wiki edit`.
| Tool | Wraps | Returns |
| ---------------- | ----------- | ------------------------------------------------------------------------------------- |
| `wiki_page_show` | `wiki show` | Frontmatter, headings, outbound links, and the `hash` to pass as `expect` in an edit. |
| `wiki_page_refs` | `wiki refs` | The pages that link to, and are linked from, the page. |
## Page-edit tools (`--allow-write`)
Listed only when the server starts with `wiki mcp --allow-write`. Every tool is a thin wrapper that builds a `WikiEdit` and calls `Wiki.edit()`, so validation, `expect` preconditions, and all-or-nothing writes are the same as `wiki edit`.
| Tool | Single operation |
| --------------------- | ------------------------------------------------------------------------------------ |
| `wiki_edit_apply` | A batch of ops (`create`, `replace`, `set`, `patch`, `move`, `delete`). Prefer this. |
| `wiki_page_create` | `create`, from `content` or a typed scaffold (`type`, `frontmatter`, `body`). |
| `wiki_page_set_field` | `set` one frontmatter field (`value`, or `yaml` to keep its spelling). |
| `wiki_page_patch` | `patch` the body, a heading's section, or the frontmatter. |
| `wiki_page_move` | `move` a page and repoint its links. |
| `wiki_page_delete` | `delete` a page; `prune_links` turns inbound links into plain text. |
Safety:
- **Dry run by default.** Each tool takes `dry_run` (default `true`). The report is the one `wiki edit --json` returns; nothing is written until `dry_run: false`.
- **Failures are results, not errors.** A rejection (`status: "rejected"`) or a stale `expect` (`status: "conflict"`) comes back with `isError: true` and the full report in `structuredContent`, so the agent can repair and retry. A malformed edit is also an `isError` result. Nothing is thrown as a JSON-RPC error.
- **Scoped paths.** Edits are confined to the wiki's documents; `.wiki/` (installed sources and the cache) stays read-only.
- **No force.** The MCP tools do not expose `wiki edit --force`.
- **Graph stays current.** After an applied edit, the next query or resource read rebuilds the in-memory graph.
Loop: `wiki_page_show` for the `hash`, then a dry run with `expect`, then the same call with `dry_run: false`.
## Resources
| Resource | MIME type | Purpose |
| ------------------- | ------------------ | -------------------------------------------------------------- |
| `wiki://info` | `application/json` | Version, config, inputs, graph settings, stats, and vocabulary |
| `wiki://namespaces` | `application/json` | Prefix map for SPARQL authoring |
| `wiki://graph.ttl` | `text/turtle` | Current inferred graph serialized as Turtle |
## Safety model
`wiki mcp` is read-only by default, and `--allow-write` is the only way to change that:
- No wiki source mutation (without `--allow-write`; see [Page-edit tools](#page-edit-tools-allow-write) for what it adds)
- No build output writes
- No formatting changes
- No link repair
- No generic file read/write tools
- No Obsidian automation
- No SPARQL Update
The command reuses the same graph cache behavior as other Wiki CLI operations: in-process caching is always used within one running MCP server, and `--cache` enables filesystem persistence under `.wiki/cache` for faster reuse across MCP launches. `reload=true` on `query_sparql` rebuilds the in-memory graph before executing the query; with `--cache`, the rebuilt graph is also written back to the filesystem cache.
## Related
- [wiki query](wiki_query.md)
- [wiki serve](wiki_serve.md#sparql-endpoint)
- [Graph Cache](Graph_Cache.md)
- [SPARQL](SPARQL.md)""" .
<https://wazootech.github.io/wiki/wiki_mcp> <https://schema.org/headline> "wiki mcp" .
<https://wazootech.github.io/wiki/wiki_mcp> <https://schema.org/dateCreated> "2026-10-31T23:19:03Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
<https://wazootech.github.io/wiki/wiki_mcp> <https://schema.org/dateModified> "2026-10-31T23:19:03Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .