Skip to main content
Glama
DPC MCP Server

DPC MCP Server

Official
by Dans-Plugins

DPC MCP Server

An MCP server for the DPC Zettelkasten — the knowledge base describing how the Dan's Plugins Community Minecraft plugins work.

It gives a model two things it does not otherwise have: structural queries over the collection, and the citation behind every claim. Ask it how faction power works and the answer comes back with a GitHub permalink pinned to a commit SHA, so the claim can be checked rather than trusted.

A real MCP session over stdio: the server's startup line, initialize, tools/list showing six tools, then get_citations for faction-power returning two citations with commit-pinned GitHub permalinks

A real session against the vendored snapshot: the six tools, then the two citations behind the faction-power note, each pinned to a commit.

Install

Requires Node 18 or later. No runtime dependencies.

git clone https://github.com/Dans-Plugins/dpc-mcp-server.git
cd dpc-mcp-server
npm run sync      # optional — a snapshot is already committed

There is nothing to build. node src/server.js is the whole thing.

Claude Code

claude mcp add dpc --  node /absolute/path/to/dpc-mcp-server/src/server.js

Claude Desktop, or any client using mcpServers

{
  "mcpServers": {
    "dpc": {
      "command": "node",
      "args": ["/absolute/path/to/dpc-mcp-server/src/server.js"]
    }
  }
}

Over HTTP

The same server also speaks MCP's Streamable HTTP transport, for the cases where a subprocess is not an option — a container, or a client on another machine:

node src/server.js --http --port 8080     # POST /mcp, health at /healthz

It binds 127.0.0.1 unless --host says otherwise, and it has no authentication of its own, so it is a local and private-network transport until it grows one. stdio remains the default and the right choice for a local client.

claude mcp add --transport http dpc http://127.0.0.1:8080/mcp

In a container

The Dockerfile builds the HTTP transport into an image. There is no npm install in it and no node_modules in the result — copying package.json, src/, and vendor/ is the whole build, which is what having no runtime dependencies buys. It runs as the base image's node user, binds 0.0.0.0 inside the container because nothing outside the network namespace could otherwise reach it, and carries a HEALTHCHECK that probes /healthz with node rather than assuming a slim image ships curl.

docker build -t dpc-mcp-server .
docker run -d -p 8080:8080 --name dpc dpc-mcp-server
curl -s http://127.0.0.1:8080/healthz
docker stop dpc

docker stop returns as soon as the server exits, because the server handles SIGTERM: it stops accepting, finishes what is in flight, and leaves — rather than ignoring the signal and being killed ten seconds later.

The image binds a public interface inside the container and still has no authentication of its own, so publish it behind something that does — the gateway, or anything else that terminates auth in front of it.

A container does not refresh itself. The image bakes in vendor/dataset.json, so it serves whatever commit of the collection was vendored when the image was built — deliberately, since that is how the server already works and it keeps the container from depending on the network at boot. Updating the served collection is npm run sync, a commit, and a redeploy. The pinned commit comes back from /healthz and from list_maps, so a stale deployment is visible rather than silent.

Related MCP server: loci-mcp

Tools

Tool

For

search_notes

Full-text search. Start here when you have a topic, not an id.

get_note

One note in full — Markdown, links, backlinks, and every citation.

list_maps

The hierarchy: each Map of Content and the concepts under it.

get_citations

Sources of truth, filterable by note, repository, or path.

graphql

Structural questions the other tools cannot answer.

get_schema

The GraphQL schema as SDL.

Full reference: TOOLS.md.

The collection is also exposed as resources at dpc-zettelkasten://note/<id>, one per note, so a client can attach a note to a conversation without spending a tool call.

The GraphQL tool

{
  notes(orderBy: degree, first: 5) {
    title
    degree
    moc { title }
  }
}

The schema travels in the tool's own description, so a model can write a correct query without a round trip — and a failed query gets the schema back in the error, which is usually enough to fix it on the next attempt. Read-only by construction: mutations, fragments, and variables are refused with an explanation rather than a parse error.

Screenshots

Each image is a real session: the official MCP SDK client drives node src/server.js over stdio against the vendored snapshot, and the page is the server's own output. A long response is cut at a fixed number of lines, and the cut is marked.

search_notes called with the query 'faction power' and limit 3: 50 notes matched, and the Faction Power note comes back first with its summary, tags, counts and links

search_notes: 50 notes match "faction power", and the note about it comes back first.

The graphql tool answering a query for the five most connected notes, with each note's degree and its Map of Content

The graphql tool answers structural questions, here the five most connected notes.

Regenerating screenshots: npm install, then darkroom shoot docs/screenshots/media.json --force with darkroom; the session itself is recorded by node docs/screenshots/session.js.

How it fits together

flowchart LR
    local["MCP client<br/>(Claude Code, Claude Desktop)"] -- "JSON-RPC over stdio" --> server["src/server.js"]
    remote["HTTP client<br/>or container"] -- "POST /mcp" --> http["src/http.js"]
    http --> protocol
    server --> protocol["src/protocol.js<br/>initialize · tools/* · resources/*"]
    protocol --> tools["src/tools.js<br/>six tools"]
    protocol --> resources["note resources<br/>dpc-zettelkasten://note/&lt;id&gt;"]
    tools --> engine["vendor/zk-graphql.js<br/>GraphQL engine"]
    resources --> engine
    engine --> data[("vendor/dataset.json<br/>or $DPC_ZK_PATH / $DPC_ZK_DATASET")]
    sync["npm run sync<br/>tools/sync.js"] -- "fetch at a commit SHA" --> upstream[("dpc-zettelkasten<br/>on GitHub")]
    sync -- "writes" --> data
    server -. "tool names only" .-> trace["usage reporting<br/>src/usage.js"]

Both transports hand messages to the same protocol layer, so a session over HTTP is answered exactly as one over stdio. Nothing is fetched at request time: the collection is read once at startup, and only npm run sync touches the network for data.

Where the data comes from

The graph and the query engine are vendored — committed into vendor/ — so the server starts with no network and always serves a known snapshot. The cost is that it goes stale, which is what npm run sync is for.

npm run sync                                  # latest commit on the collection's main
npm run sync -- --ref <sha>                   # a specific commit
npm run sync -- --from ../dpc-zettelkasten    # a local checkout
npm run sync -- --check                       # is the snapshot behind main?

Syncing resolves the branch to a commit SHA and fetches at that SHA, recording it in vendor/SOURCE.json. The server then reports which commit it is serving, both in its startup line and in list_maps, so a stale snapshot is visible rather than silent.

That pinning is not decoration. raw.githubusercontent.com caches branch paths, and an early version of this script fetched main and vendored a copy that was a commit behind — while --check cheerfully reported it current. Paths under a commit SHA are immutable and cache correctly. It is the same rule the collection applies to its own citations, for the same reason: a branch is not a version.

A sync that produces a broken snapshot is refused rather than written. The script loads the fetched engine against the fetched data, runs a query, and checks they agree before touching vendor/.

Override the source at runtime if you would rather point at a checkout:

Variable

Effect

DPC_ZK_PATH

Path to a dpc-zettelkasten checkout; uses its site/dataset.json and lib/zk-graphql.js

DPC_ZK_DATASET

Path to a specific dataset.json

DPC_ZK_ENGINE

Path to a specific zk-graphql.js, used with DPC_ZK_DATASET; ignored without it

See CONFIG.md.

One schema, not two

vendor/zk-graphql.js is not a reimplementation. It is the same file the zettelkasten's offline explorer inlines into its own page — the schema and engine live in lib/zk-graphql.js over there, and both consumers load it.

That is deliberate. A schema maintained in two places drifts, and a model given a stale schema writes queries that fail for reasons it cannot see.

No dependencies

The server implements MCP's transports — JSON-RPC 2.0 over newline-delimited stdio, and Streamable HTTP over node:http — directly, rather than through the SDK. The official SDK is a dev dependency, used by the test suite to drive this server as a real client would.

That is the claim worth testing, so the tests make it: over a hundred assertions across the vendored data, the raw wire protocol, usage reporting, and live sessions on both transports with @modelcontextprotocol/sdk.

npm install   # dev dependencies, for the tests
npm test

Usage reporting

Usage reporting is on by default: the server sends its name, its version, the transport it started on (startup), and the name of each tool called (tool-call) to trace. Tool arguments, notes, queries, and anything about the client or the person using it are never sent — only names from the server's own tool list, so a name a client made up is not sent either. The server says which way it is set on stderr every time it starts.

Every event also carries a random installation ID (the tag install), so trace can count installations rather than events. It is a UUID made on first run, derived from nothing about the machine or you, and kept in <user data dir>/dpc-mcp-server/trace-install-id — $XDG_DATA_HOME (or ~/.local/share) on Linux, ~/Library/Application Support on macOS, %APPDATA% on Windows. Delete the file to reset it, or set TRACE_INSTALL_ID to pin your own value (useful in a container, whose filesystem does not outlive it). On Node 18 (anything before 20.16 or 22.3) the file cannot be used and the ID lasts for one run only. Every opt-out below also stops the ID: with reporting off the file is never read or created.

To turn it off, any one of these:

  • TRACE_USAGE_REPORTING=off in the server's environment (the env block of your MCP client's config); any value but empty, true, on, yes or 1 turns it off

  • DO_NOT_TRACK=1 in the server's environment; any value but empty, 0, false, off or no turns it off

  • "enabled": false in src/usage-reporting.json; any value but true (or "true", "on", "yes", "1") turns it off, and so does a file that does not parse

Details: https://danielstephenson.dev/usage-reporting

Support

Contributing

See CONTRIBUTING.md.

License

MIT.

Available Tools

6 tools
get_citationsA

Every source of truth behind a note, or across the whole collection — repository, file path, line range, the specific claim it supports, and a permalink pinned at a commit SHA. Use this to check whether a claim is actually supported, or to find which notes cite a given repository.

Inputs: id, path, repo.

get_noteA

Fetch one note in full: its Markdown body, its links and backlinks, and every citation with a commit-pinned GitHub permalink. Use this once search_notes or list_maps has given you an id. Every claim in this collection is grounded in a file in a Dans-Plugins repository, pinned at a commit SHA. When you use a note, cite its sources rather than presenting the claim as your own knowledge — the permalinks are what make the answer checkable.

Inputs: id (required).

get_schemaA

The GraphQL schema for the collection, as SDL. Call this before writing a non-trivial query with the graphql tool.

Inputs: no named parameters.

graphqlA

Run a GraphQL query against the collection's structure. Use this for questions the other tools cannot answer — which notes are most connected, what a cluster contains, which repositories ground the most claims, how two notes relate.

Read-only: no mutations, fragments, or variables. Inline argument values.

Examples: { notes(orderBy: degree, first: 5) { title degree moc { title } } } { notes(moc: "moc-faction-domain-model") { title summary } } { note(id: "demesne-limit") { title links { title } sources { claim url } } } { repositories { name citationCount noteCount } }

SCHEMA:

The zettelkasten as a graph. Read-only — queries only.

enum NoteType { concept moc } enum NoteOrder { title degree citations }

type Query { notes(type: NoteType, moc: ID, tag: String, repo: String, search: String, linkedTo: ID, orderBy: NoteOrder, first: Int): [Note!]! note(id: ID!): Note mocs: [Note!]! concepts(first: Int): [Note!]! tags: [Tag!]! repositories: [Repository!]! stats: Stats }

type Note { id: ID title: String type: NoteType summary: String tags: [String!]! updated: String path: String url: String moc: Note links(first: Int): [Note!]! backlinks(first: Int): [Note!]! neighbors(first: Int): [Note!]! linkCount: Int backlinkCount: Int degree: Int sources: [Source!]! sourceCount: Int repositories: [String!]! }

type Source { repo: String path: String ref: String shortRef: String lines: String claim: String url: String }

type Tag { name: String count: Int notes: [Note!]! }

type Repository { name: String url: String citationCount: Int noteCount: Int pinnedRefs: [String!]! notes: [Note!]! }

type Stats { noteCount: Int mocCount: Int conceptCount: Int citationCount: Int linkCount: Int repositoryCount: Int repositories: [String!]! updated: String }

Inputs: query (required).

list_mapsA

The structure of the collection: every Map of Content and the concept notes that call it home. Use this to orient before searching, or to answer 'what does this collection cover?'. Each concept note belongs to exactly one map.

Inputs: no named parameters.

search_notesA

Full-text search across the DPC Zettelkasten — a knowledge base describing how the Dan's Plugins Community Minecraft plugins work (Medieval Factions and the repositories around it). Start here when you have a topic rather than a note id. Returns matching notes with summaries; follow up with get_note for the full text and its citations. Every claim in this collection is grounded in a file in a Dans-Plugins repository, pinned at a commit SHA. When you use a note, cite its sources rather than presenting the claim as your own knowledge — the permalinks are what make the answer checkable.

Inputs: query (required), type, limit.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool serves a distinct purpose: searching, fetching by ID, listing maps, retrieving citations, running raw queries, and getting the schema. The overlap between graphql and the other tools is explicitly framed as a fallback for advanced questions, preventing confusion.

    Naming Consistency4/5

    Most tools follow the verb_noun pattern: search_notes, get_note, list_maps, get_citations, get_schema. The sole exception is 'graphql', which is a single noun rather than verb_noun, but it's an accepted name for a query tool and doesn't break the overall consistency.

    Tool Count5/5

    Six tools is well-scoped for a knowledge-base server. Each tool covers a distinct access pattern, and there are no redundant or missing utilities that would bloat or thin the interface.

    Completeness4/5

    The server covers the core workflows: searching, retrieving, browsing structure, verifying citations, and advanced graph queries. The graphql tool fills most gaps (e.g., listing all notes, aggregations), though a dedicated 'list all notes' tool would be a minor convenience.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables natural-language retrieval from a self-hosted documentation index, returning cited answers with deep links, and supports private corpora inaccessible on the public internet.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents and MCP hosts to query a local index of scattered notes and documents through hybrid vector and BM25 retrieval, returning section-level citations and exposing tools, resources, and prompts.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents and MCP hosts to query a local hybrid index of scattered notes and documents, returning answers with section-level citations and exposing search, resources, and prompts.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents and MCP hosts to query a local, queryable second brain over scattered notes and docs using hybrid vector plus BM25 retrieval with section-level citations, resources, and prompts.
      -