llm-wiki-ops
Graph-level operations for Karpathy LLM Wiki knowledge bases, enabling LLM agents via MCP and humans via CLI to perform structured graph surgery including node/edge CRUD, wikilink management, index rebuilding, and graph metrics.
README
llm-wiki-ops
Graph-level operations for Karpathy LLM Wiki knowledge bases.
Lets LLM agents (via MCP) and humans (via CLI) perform structured graph surgery on a wiki: node/edge CRUD, wikilink management, index rebuilding, and graph metrics — all as pure file operations with zero LLM, Tauri, or network dependencies.
Features
- Node ops — add, update, rename, delete wiki pages with frontmatter and wikilink management
- Edge ops — add/remove typed edges between pages, with cascading wikilink insert/removal
- Metrics — topology (degree, hubs, connected components, fragmentation), source overlap / near-duplicate detection, cross-type edge matrix, type distribution
- Index maintenance — rebuild
index.mdtype sections while preserving custom content - Concurrency — wiki-level
proper-lockfilewrite lock + optimistic mtime/size/sha256 checks - MCP server — expose all operations as MCP tools for LLM agent integration
- CLI —
wiki-graphcommand for human/script use
Install
npm install llm-wiki-ops
CLI
# Add a node
wiki-graph add-node ./my-wiki --slug "my-page" --title "My Page" --type concept
# Add an edge
wiki-graph add-edge ./my-wiki --from "my-page" --to "other-page" --type relates_to
# Graph metrics
wiki-graph metrics ./my-wiki --json
# Rebuild index
wiki-graph rebuild-index ./my-wiki
MCP Server
wiki-graph-mcp --wiki ./my-wiki
Configure in your MCP client:
{
"mcpServers": {
"llm-wiki": {
"command": "wiki-graph-mcp",
"args": ["--wiki", "/path/to/wiki"]
}
}
}
Library
import { WikiGraph } from "llm-wiki-ops"
const wiki = new WikiGraph("/path/to/wiki")
await wiki.validate()
// CRUD
await wiki.addNode({ slug: "my-page", title: "My Page", type: "concept" })
await wiki.addEdge({ from: "my-page", to: "other-page", type: "relates_to" })
// Metrics
const metrics = await wiki.getMetrics()
console.log(metrics.topology.hubs)
console.log(metrics.sourceOverlap.duplicateClusters)
await wiki.cleanup()
Wiki Structure
Operates on the standard LLM Wiki layout:
my-wiki/
├── wiki/
│ ├── index.md
│ ├── entities/
│ ├── concepts/
│ ├── sources/
│ ├── queries/
│ ├── comparisons/
│ ├── synthesis/
│ └── overview/
├── raw/
├── purpose.md
└── schema.md
Development
npm install
npm run typecheck
npm test
npm run build
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.