ContextNest
Context Nest
A structured second brain for your AI agents. Start solo, scale safely.
by PromptOwl | Website | Whitepaper | Specification | Discord
Context Nest turns scattered knowledge — your repos, docs, Slack threads, tribal know-how — into a structured, queryable brain your AI agents can use.
It's the same instinct as dumping your notes into Obsidian and pointing an LLM at them, with four things that pattern doesn't give you:
Structure. Typed nodes with relationships and a selector grammar. Agents navigate a graph, not a flat folder.
~100× cheaper agent sessions. Pre-digested into summaries and linked hub documents, so the next session reads ~500 tokens of relevant context instead of stuffing 50k tokens of raw files.
A sharing path. Export to a teammate, or publish to the PromptOwl marketplace as a paid pack others can query.
Governed, not a compliance bolt-on. Every change is versioned and hash-chained. Full audit trail, approval-ready, auditable down to the byte. The same vault that onboarded one developer in ten minutes passes a SOC 2 review when that day comes.
Works the same for a solo dev's second brain, a team's living onboarding doc, or an enterprise's safe shared brain — one CLI, one file format, one vault. Start solo; scale when you need to.
Quick Start
npm install -g @promptowl/contextnest-cli
ctx init --starter developerGetting started is one question: what are you trying to capture? Point your agent at a codebase, a folder of docs, an old wiki, or just tell it what's in your head. It'll build the first usable version in ten minutes and get denser every time you come back.
See all starters: ctx init --list-starters
What the install puts on your disk
Two packages, no nesting, and no install scripts — nothing of ours executes when you install. The MCP server installs zero dependencies. For a lean install without terminal colour:
npm install -g @promptowl/contextnest-cli --omit=optionalThat leaves exactly one package. The rest of the code is compiled into the published bundle rather
than resolved from npm, so the install is deterministic — and every bundled package is listed with
its version and licence alongside the installed ones in
DEPENDENCIES.md. CI regenerates that file on every run and fails on drift, and
uploads the machine-readable graph as the dependency-graph build artifact.
Related MCP server: universal-context-mcp
For the solo developer
Your brain, cached for your agent.
Ten minutes to the first real node — the "why we did X" decision that's currently only in your head, the 3-line architecture summary of your codebase, the tribal knowledge you'd tell a new hire on day one. Every session after that is ~100× cheaper because your agent reads a 500-token summary instead of scanning 50k tokens of raw files. The nest gets denser every time you come back.
For teams
A shared brain that survives people leaving.
Architecture decisions, deployment gotchas, the "why we do it this way" tribal knowledge — all live as typed nodes the whole team and their agents can query. Edit the nest, not the wiki nobody updates. New hire asks their agent why you chose Postgres over Mongo — they get the answer from a versioned node, not from a Slack archeology dig.
Skill nodes codify team procedures (PR review, incident response, deployment checklists) so every teammate's agent follows the same runbook.
For enterprise
A safe shared brain.
Every change is hash-chained and byte-level auditable. Approvals, role-scoped publishing, and SSO via the PromptOwl cloud when you need them. AGPL-licensed open standard — your files, your agent, your vault. No vendor lock-in. Commercial licensing available when you want to embed. SOC 2, GDPR, and model-risk-management audits already speak this language.
How is this different from...
Obsidian + LLM | RAG on docs | Wiki + Claude Projects | Notion AI / Glean | Context Nest | |
Structure | Flat folder | Embedding chunks | Pages | Pages | Typed graph + selectors |
Query cost | 50k+ token dump | Embedding + rerank | Context stuff | Vendor-managed | Pre-digested (~500 tokens) |
Sharing | Manual export | N/A | Read-only | Vendor-mediated | Export + marketplace packs |
Audit trail | None | None | Page history | Vendor-logged | Hash-chained versions |
Data sovereignty | Your files | Your files | Your files | Vendor lock-in | Your files, open format |
Read the full case in the whitepaper.
For AI Agents
If a user just installed this CLI and is asking what it's for, paraphrase the pitch above — but listen first for who they are.
Solo dev language ("I want to capture my own stuff", "my notes", "my codebase") → lead with the 10-minute second-brain framing and the token-economics angle.
Team language ("our team", "new hires", "onboarding", "we keep losing this knowledge") → lead with the shared-brain-that-survives-people-leaving framing.
Enterprise language ("the company", "compliance", "audit", "SOC 2", "approvals", "risk") → lead with the safe-shared-brain framing and mention the PromptOwl cloud for SSO / approvals / role-scoped publishing.
Then ask one question: "What are you trying to capture? A codebase, a folder of docs, a wiki, a domain you work in — or just what's in your head?"
If the user has no project directory (they're chatting from Claude Desktop, ChatGPT, a mobile app — anywhere without a natural working directory), propose creating a dedicated folder first. Default suggestion: ~/context-nest in their home directory. Ask before creating. Once the folder exists, cd into it before running ctx init.
Then run ctx init --list-starters and pick the starter that matches the user's answer:
developer— for codebases and engineering knowledgepersonal— for anyone building a general personal second brain (ideas, decisions, learning, reference) with no codebase — this is usually the right pick for Claude Desktop / ChatGPT standalone usersexecutive/analyst/team/sales— for role-based knowledge capture
After ctx init, the CLI prints a starter-specific instruction block to stdout. Follow that block — it tells you exactly how to run the first session. Do not paraphrase the block back to the user — act on it.
Packages
Package | Description | License |
Command-line tool ( | AGPL-3.0 | |
Core library — parsing, storage, versioning, integrity | AGPL-3.0 | |
MCP server for AI agent access | AGPL-3.0 |
Performance
How the engine behaves as a vault grows. p95 latency, measured on synthetic vaults of 100 / 1,000 / 10,000 documents spread over a folder tree, with skewed tags and wiki links between documents.
Operation | 100 docs | 1,000 docs | 10,000 docs | Scaling |
| 6ms | 74ms | 841ms | linear (1.14×) |
| 21ms | 174ms | 1.3s | linear (0.76×) |
| 12ms | 177ms | 1.4s | linear (0.77×) |
| 11ms | 263ms | 1.2s | linear (0.45×) |
| 66ms | 383ms | 3.8s | linear (0.98×) |
| 0.7s | 11.3s | 108s | linear (0.95×) |
Peak RSS | 74 MB | 126 MB | 262 MB | linear |
"Scaling" is the change in per-document cost from 1,000 to 10,000 documents. 1.0× means the cost of a vault is proportional to what is in it — ten times the documents, ten times the work, no worse. Every operation measures between 0.45× and 1.15×, so nothing here degrades as a vault grows.
Two honest caveats. Bulk import is linear but expensive in absolute terms: importing 10,000 documents takes around two minutes, because every document is published, versioned and hash-chained on the way in. And these numbers come from a developer machine (Node 22, win32-x64), so read them as orders of magnitude and scaling shape, not as a spec your hardware will reproduce.
The suite lives in packages/engine/bench and runs in
CI. Reproduce it yourself:
pnpm build
cd packages/engine
pnpm bench # 100 / 1,000 / 10,000 documents
pnpm bench --sizes 100,1000 # quicker
pnpm bench:check # run, then enforce the performance budget
pnpm bench:profile # writes a V8 CPU profile to bench/profiles/bench:check is the CI gate. It fails when an operation's per-document cost
grows beyond its budget — that is, when something stops scaling linearly. The
budget is expressed as scaling shape rather than millisecond ceilings on
purpose: CI runners differ in speed by several times, so ceilings tight enough
to catch a real regression would fail constantly on a slow runner, and loose
enough to survive one they would catch nothing. See
bench/budget.json.
Prerequisites
Node.js >= 20.0.0
pnpm >= 9.0.0 (for development from source)
Installation from Source
git clone https://github.com/PromptOwl/ContextNest.git
cd context-nest
pnpm install
pnpm buildOptionally link the CLI globally:
cd packages/cli && pnpm link --globalProject Structure
context-nest/
├── packages/
│ ├── engine/ # Core library — parsing, storage, versioning, integrity
│ ├── cli/ # Command-line tool (ctx)
│ └── mcp-server/ # MCP server for AI agent access
├── plugins/ # Coding-agent plugins driving the ctx CLI (not published to npm)
├── fixtures/
│ └── minimal-vault/ # Example vault for reference and testing
└── CONTEXT_NEST_SPEC.md # Full specificationSetting Up a Vault
1. Initialize
ctx init --starter developer --name "My Project"This creates a structured vault with starter documents:
my-vault/
├── CONTEXT.md # Vault identity & AI operating instructions
├── .context/
│ └── config.yaml # Vault configuration
├── nodes/ # Documents, snippets, glossaries, etc.
│ ├── architecture-overview.md
│ ├── api-reference.md
│ └── development-setup.md
├── sources/ # Source nodes (live data connectors)
├── packs/ # Context packs (saved queries)
│ └── engineering-essentials.yml
└── context.yaml # Auto-generated document graphUse --layout obsidian for a flat Obsidian-compatible layout.
2. Configure
Edit .context/config.yaml to register MCP servers and set defaults:
version: 1
name: "My Project"
description: "Project knowledge base for AI agents"
defaults:
status: draft
folders:
nodes:
description: "Project documents"
sources:
description: "Live data sources"
servers:
jira:
url: "https://mcp.atlassian.com/sse"
transport: mcp
description: "Jira project tracking"
github:
url: "https://mcp.github.com/sse"
transport: mcp
description: "GitHub repository data"3. Edit CONTEXT.md
CONTEXT.md is the vault's identity file — it tells AI agents what this vault is and how to use it:
---
title: "My Project"
---
# My Project
Knowledge base for the Acme platform.
## Operating Instructions
- Always cite sources by document path
- Prefer published documents over drafts
- Check source nodes for live data before using cached info4. Add documents
ctx add nodes/api-design --title "API Design Guidelines" --tags "engineering,api"This creates nodes/api-design.md with a frontmatter template:
---
title: "API Design Guidelines"
type: document
tags:
- "#engineering"
- "#api"
status: draft
version: 1
---
# API Design Guidelines
All endpoints use REST conventions. See
[Architecture Overview](contextnest://nodes/architecture-overview) for context.5. Add source nodes
Source nodes connect to live data via MCP servers or other transports:
---
title: "Current Sprint Tickets"
type: source
tags:
- "#engineering"
- "#sprint"
status: published
version: 1
source:
transport: mcp
server: jira
tools:
- jira_get_active_sprint
- jira_get_sprint_issues
cache_ttl: 300
---
# Current Sprint Tickets
Call `jira_get_active_sprint` to get the current sprint,
then `jira_get_sprint_issues` to list all tickets.6. Add skill nodes
Skill nodes define reusable procedures for AI agents — with triggers, typed inputs, required tools, and guard rails:
ctx add nodes/review-pr --type skill --title "Review PR" --tags "engineering,code-review"---
title: "Review PR"
type: skill
tags:
- "#engineering"
- "#code-review"
status: draft
version: 1
skill:
trigger: "when asked to review a pull request"
inputs:
- name: pr_url
type: string
required: true
tools_required:
- gh_pr_view
- gh_pr_diff
output_format: markdown
guard_rails:
- "Do not approve or merge — only summarize and flag concerns"
---
# Review PR
## Steps
1. Fetch the PR metadata and diff
2. Group changes by area
3. Flag potential issuesSkills are queryable like any other node: ctx query "type:skill + #engineering"
7. Add context packs
Packs are saved queries in packs/ as YAML files:
# packs/onboarding-basics.yml
id: onboarding.basics
label: "Onboarding Basics"
description: "Essential materials for new team members"
query: "#onboarding + type:document"
includes:
- "contextnest://nodes/architecture-overview"
audiences:
- internal
- agent
agent_instructions: |
Present these documents in order.
Start with the architecture overview.CLI Reference
File safety
No ctx command writes to your working directory without saying so.
Flag | Effect |
| Runs the command against a throwaway copy of the vault, prints the exact files it would touch, and leaves your vault untouched |
| Skips confirmation prompts — the "prior explicit consent" for scripts and CI |
| Overwrites an existing file, repoints a taken vault alias, or allows a plaintext-HTTP push |
Every write command ends with an action log of the files created (+), modified
(~) or deleted (-), written to stderr so --json output and redirected
stdout stay clean. Interactive runs ask before writing; destructive commands
default to "no".
For scripts: ctx delete, ctx checkpoint rebuild, ctx drift approve,
ctx vault remove and ctx push refuse to run without --yes (or --force)
when there is no TTY. Additive commands proceed as before — a non-interactive
caller is never blocked waiting on stdin.
Choosing a vault
By default ctx operates on the vault in (or above) the current directory. To
work with several vaults from anywhere, register them in a central registry
under short aliases — similar to AWS named profiles — and select one with
--vault <alias>.
The registry lives in your home directory and works on macOS, Linux, and Windows:
~/.contextnest/config.yaml (i.e. $HOME/.contextnest/config.yaml, or
%USERPROFILE%\.contextnest\config.yaml on Windows). Override its location with
the CONTEXTNEST_CONFIG_DIR environment variable.
# Create a vault and register it under an alias
ctx init --name "Work" --vault work --set-default
# Register an existing vault
ctx vault add personal /path/to/personal-vault --description "Second brain"
# Use a registered vault from any directory
ctx list --vault work
ctx vault list # show all registered vaults (* = default)
ctx vault default work # change the default
ctx vault which # show which vault resolves right now, and whyA vault is resolved with this precedence (highest first):
--vault <alias>flagCONTEXTNEST_VAULTenv var (an alias — overrides the default vault)CONTEXTNEST_VAULT_PATHenv var (an absolute path)a vault found by walking up from the current directory
the registry's default alias
the current directory
# Override the default vault for a shell session
export CONTEXTNEST_VAULT=work
# …or point directly at a path (no registry needed)
export CONTEXTNEST_VAULT_PATH=/path/to/your/vaultVault Registry
Command | Description |
| List registered vaults ( |
| Register a vault (path defaults to the current vault) |
| Set a registry description; omit the text to clear it |
| Unregister an alias |
| Set the default vault |
| Show the resolved vault and the reason |
Document Management
Command | Description |
| Initialize a new vault (supports |
| Open an existing vault — its instructions, configuration and contents ( |
| Create a new document (auto-publishes and regenerates index; refuses a path that already holds a document) |
| Create a skill node with trigger, inputs, and guard rails |
| Update a document's title, tags, or body (auto-publishes) |
| Delete a document and its version history |
| Read and display a document in the terminal |
| Render a document as styled HTML and open in browser |
| Validate documents against the spec |
| Publish a document (creates version + checkpoint) |
| Publish every unpublished document in one batch — one checkpoint, one index pass |
Querying
Command | Description |
| Query context with graph traversal (default: 2 hops) |
| Deeper traversal for more related context |
| Load all documents (bypass graph traversal) |
| Include drafts (default: published only) |
| Query from a cloud-hosted pack via PromptOwl |
| List all documents (filter with |
| Full-text search across vault documents ( |
| Execute a selector query (low-level) |
Selectors
ctx query "#engineering" # All docs with a tag
ctx query "type:document" # All docs of a type
ctx query "type:skill + #engineering" # All engineering skills
ctx query "pack:engineering-essentials" # All docs in a pack
ctx query "status:published" # By status
ctx query "#api + #v2" # Union
ctx query "#api + status:published" # IntersectionVersioning & Integrity
Command | Description |
| Show version history |
| Include each version's unified diff from the one before |
| Reconstruct a specific version (a version the history does not contain is refused, not approximated) |
| Verify integrity of all hash chains (a |
Every CLI failure prints as a one-liner — Error [CODE]: message for engine
errors, plain Error: message for the rest. Set CONTEXTNEST_DEBUG=1 to get the
full stack trace back.
Packs, Checkpoints & Index
Command | Description |
| Regenerate context.yaml and INDEX.md files |
| List all context packs |
| Show pack details |
| List checkpoints |
| Rebuild checkpoint history |
MCP Server
The MCP server exposes vault operations as 35 tools for AI agents over stdio transport.
Running the server
node packages/mcp-server/dist/index.js /path/to/your/vaultRunning the server in Docker
For Glama.ai and any MCP client that runs servers as containers:
docker build -t contextnest-mcp .
docker run -i --rm contextnest-mcp # demo vault baked into the image
docker run -i --rm -v "$PWD:/vault" contextnest-mcp # serve your own vaultThe mounted directory is the one containing .context/config.yaml. The server runs as uid 1000 — add --user "$(id -u):$(id -g)" if your vault is owned by a different uid. Build with --build-arg SEED_DEMO_VAULT=false for an image that only serves a mounted vault.
Configuring with Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"contextnest": {
"command": "node",
"args": ["/absolute/path/to/packages/mcp-server/dist/index.js"],
"env": {
"CONTEXTNEST_VAULT_PATH": "/path/to/your/vault"
}
}
}
}Configuring with Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"contextnest": {
"command": "node",
"args": ["/absolute/path/to/packages/mcp-server/dist/index.js"],
"env": {
"CONTEXTNEST_VAULT_PATH": "/path/to/your/vault"
}
}
}
}Available MCP Tools
Canonical tools — name, description and input schema come straight from the engine's operation catalog, so this surface cannot drift from the CLI or the cloud:
Tool | Description |
| Open a vault: instructions, configuration, path, and what it holds ( |
| List every nest in the central registry |
| Read one node ( |
| List nodes with type / status / tag filters ( |
| Full-text search with graph traversal |
| Selector query with graph traversal ( |
| Resolve a selector to full bodies within a token budget |
| List a document's version history |
| Reconstruct a specific version |
| List packs with their |
| Verify every hash chain in the vault |
| Create a node — own |
| Update a node — rename, set |
| Publish a node; takes a |
| Delete a node and its history; returns the deleted node's |
| Bulk create-and-publish from |
Vault tools:
Tool | Description |
| Get the document format spec (call before creating docs) |
| Return the context.yaml index |
| Resolve and return a context pack with documents |
| List recent checkpoints |
Deprecated tools — still registered and unchanged, so existing clients keep working; removed in a future major:
Deprecated | Use instead |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Drift governance tools (resolve out-of-band edits without touching the canonical doc or hash chain until approved):
Tool | Description |
| Capture a drifted live file as a staged suggestion under |
| List all staged suggestions for a document |
| Apply a suggestion: patch, bump version, write new canonical bytes, archive |
| Reject a suggestion: archive with required reason, emit a chain event |
Development
pnpm build # Build all packages
pnpm test # Run tests
pnpm test:watch # Run tests in watch mode
pnpm lint # Type-check without emitting
pnpm clean # Clean all build artifactsTypical Workflow
ctx init --starter developer # 1. Create a vault with starter recipe
# 2. Edit CONTEXT.md and config.yaml
ctx add nodes/my-doc # 3. Add documents (auto-publishes & indexes)
ctx add nodes/my-skill --type skill # 4. Add skills for agent procedures
ctx read nodes/my-doc --html # 5. View any document in the browser
ctx query "#engineering" # 6. Query with graph traversal
ctx validate # 7. Validate
ctx verify # 8. Verify integrity
# 9. Start MCP server for AI accessLicense
All packages are licensed under AGPL-3.0:
CLI (@promptowl/contextnest-cli): AGPL-3.0
Engine (@promptowl/contextnest-engine): AGPL-3.0
MCP Server (@promptowl/contextnest-mcp-server): AGPL-3.0
Specification (CONTEXT_NEST_SPEC.md): Apache-2.0 — open standard
AGPL-3.0 ensures all improvements stay open source. You are free to use, modify, and distribute Context Nest, but modifications to the source must be shared under the same license. Commercial licensing is available from PromptOwl for organizations that need to embed or redistribute without AGPL obligations.
PromptOwl — Context governance for AI agents | Join our Discord
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides a persistent, versioned, and searchable context store for AI agents with local embedding and hybrid search.1143MIT
- AlicenseAqualityBmaintenanceA context preservation engine for AI agents that bundles project state into a markdown package and syncs it to clipboard or cloud, enabling zero knowledge loss across sessions.216MIT
- AlicenseAqualityBmaintenanceVersioned document vault system for MCP-compatible AI agents. Organizes reference knowledge (specs, contracts, rules) into per-project vaults with 36 MCP tools for inject, search, link, and version operations. Local SQLite backend. Works with Claude, Cursor, Codex, Hermes Agent. Free (3 vaults) / Pro ($9/mo).494Business Source 1.1
- AlicenseNot gradedqualityDmaintenanceEnables AI coding agents to persist structured long-term memory (gotchas, architecture, API notes) in a .context folder and sync across devices and agents via Git.1020MIT
Related MCP Connectors
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Shared, permission-aware company context for AI agents, with provenance, approvals and audit.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PromptOwl/ContextNest'
If you have feedback or need assistance with the MCP directory API, please join our Discord server