by PromptOwl
Provides a structured, version‑controlled vault of markdown documents that AI agents can query through a CLI or an MCP server, delivering cheap, auditable context and governance for solo developers, teams, or enterprises.
Context Nest organizes scattered knowledge—code repositories, documentation, Slack threads, tribal know‑how—into a typed graph of markdown nodes. Each node is versioned, hash‑chained, and stored in a portable vault that agents can traverse with a selector‑based query language.
npm install -g @promptowl/contextnest-cli (or use npx for one‑off commands).ctx init --starter developer --name "My Project" creates the directory structure and starter documents.ctx add <path>, ctx update <path>, or ctx add <path> --type skill for procedural skill nodes.ctx query "#engineering" or use more complex selectors.npx -y @promptowl/contextnest-mcp-server /path/to/vault and configure the server in your agent’s .mcp.json.Q: Do I need to host a server?
A: Only if agents need remote access. The CLI works fully offline; the MCP server can be started locally with the npx command.
Q: What runtimes are supported? A: Node.js ≥ 20 and pnpm ≥ 9 for development; the CLI runs on any system with Node.
Q: How is data stored? A: Plain markdown files inside a vault directory, accompanied by YAML config and hash‑chained version metadata.
Q: Can I integrate with existing tools? A: Yes – source nodes can connect to Jira, GitHub, or any MCP‑compatible service, and skill nodes can invoke external tools.
Q: What licensing applies? A: All packages are AGPL‑3.0; a commercial license is available for embedding without the AGPL requirements.
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:
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.
npm install -g @promptowl/contextnest-cli
ctx init --starter developer
Getting 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
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.
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.
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.
| 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.
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.
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 captureAfter 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.
| Package | Description | License |
|---|---|---|
| @promptowl/contextnest-cli | Command-line tool (ctx) |
AGPL-3.0 |
| @promptowl/contextnest-engine | Core library — parsing, storage, versioning, integrity | AGPL-3.0 |
| @promptowl/contextnest-mcp-server | MCP server for AI agent access | AGPL-3.0 |
git clone https://github.com/PromptOwl/ContextNest.git
cd context-nest
pnpm install
pnpm build
Optionally link the CLI globally:
cd packages/cli && pnpm link --global
context-nest/
├── packages/
│ ├── engine/ # Core library — parsing, storage, versioning, integrity
│ ├── cli/ # Command-line tool (ctx)
│ └── mcp-server/ # MCP server for AI agent access
├── fixtures/
│ └── minimal-vault/ # Example vault for reference and testing
└── CONTEXT_NEST_SPEC.md # Full specification
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 graph
Use --layout obsidian for a flat Obsidian-compatible layout.
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"
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 info
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.
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.
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 issues
Skills are queryable like any other node: ctx query "type:skill + #engineering"
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.
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 why
A vault is resolved with this precedence (highest first):
--vault <alias> flagCONTEXTNEST_VAULT env var (an alias — overrides the default vault)CONTEXTNEST_VAULT_PATH env var (an absolute path)# 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/vault
| Command | Description |
|---|---|
ctx vault list |
List registered vaults (* marks the default) |
ctx vault add <alias> [path] |
Register a vault (path defaults to the current vault) |
ctx vault remove <alias> |
Unregister an alias |
ctx vault default <alias> |
Set the default vault |
ctx vault which |
Show the resolved vault and the reason |
| Command | Description |
|---|---|
ctx init |
Initialize a new vault (supports --starter recipes) |
ctx add <path> |
Create a new document (auto-publishes and regenerates index) |
ctx add <path> --type skill |
Create a skill node with trigger, inputs, and guard rails |
ctx update <path> |
Update a document's title, tags, or body (auto-publishes) |
ctx delete <path> |
Delete a document and its version history |
ctx read <path> |
Read and display a document in the terminal |
ctx read <path> --html |
Render a document as styled HTML and open in browser |
ctx validate [path] |
Validate documents against the spec |
ctx publish <path> |
Publish a document (creates version + checkpoint) |
| Command | Description |
|---|---|
ctx query <selector> |
Query context with graph traversal (default: 2 hops) |
ctx query <selector> --hops 4 |
Deeper traversal for more related context |
ctx query <selector> --full |
Load all documents (bypass graph traversal) |
ctx query @org/pack |
Query from a cloud-hosted pack via PromptOwl |
ctx list |
List all documents (filter with --type, --status, --tag) |
ctx search <query> |
Full-text search across vault documents |
ctx resolve <selector> |
Execute a selector query (low-level) |
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" # Intersection
| Command | Description |
|---|---|
ctx history <path> |
Show version history |
ctx reconstruct <path> <version> |
Reconstruct a specific version |
ctx verify |
Verify integrity of all hash chains |
| Command | Description |
|---|---|
ctx index |
Regenerate context.yaml and INDEX.md files |
ctx pack list |
List all context packs |
ctx pack show <id> |
Show pack details |
ctx checkpoint list |
List checkpoints |
ctx checkpoint rebuild |
Rebuild checkpoint history |
The MCP server exposes vault operations as 19 tools for AI agents over stdio transport.
node packages/mcp-server/dist/index.js /path/to/your/vault
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"
}
}
}
}
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"
}
}
}
}
Read tools:
| Tool | Description |
|---|---|
vault_info |
Get vault identity and configuration summary |
resolve |
Execute a selector query with graph traversal |
read_document |
Read a document by URI or path |
list_documents |
List documents with optional type/status/tag filters |
document_format |
Get the document format spec (call before creating docs) |
read_index |
Return the context.yaml index |
read_pack |
Resolve and return a context pack with documents |
search |
Full-text search with graph traversal |
verify_integrity |
Verify all hash chains |
list_checkpoints |
List recent checkpoints |
read_version |
Read a specific version of a document |
Mutation tools (all auto-publish and regenerate the index):
| Tool | Description |
|---|---|
create_document |
Create a new document with frontmatter and optional body |
update_document |
Update a document's title, tags, status, or body |
delete_document |
Delete a document and its version history |
publish_document |
Explicitly publish a document (bump version, create checkpoint) |
Drift governance tools (resolve out-of-band edits without touching the canonical doc or hash chain until approved):
| Tool | Description |
|---|---|
stage_drift_suggestion |
Capture a drifted live file as a staged suggestion under _suggestions/ |
list_suggestions |
List all staged suggestions for a document |
approve_suggestion |
Apply a suggestion: patch, bump version, write new canonical bytes, archive |
reject_suggestion |
Reject a suggestion: archive with required reason, emit a chain event |
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 artifacts
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 access
All packages are licensed under AGPL-3.0:
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
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.
by topoteretes
Provides dynamic memory for AI agents through modular ECL (Extract, Cognify, Load) pipelines, enabling seamless integration with graph and vector stores using minimal code.
by basicmachines-co
Enables persistent, local‑first knowledge management by allowing LLMs to read and write Markdown files during natural conversations, building a traversable knowledge graph that stays under the user’s control.
by agentset-ai
Provides an open‑source platform to build, evaluate, and ship production‑ready retrieval‑augmented generation (RAG) and agentic applications, offering end‑to‑end tooling from ingestion to hosting.
by smithery-ai
Provides read and search capabilities for Markdown notes in an Obsidian vault for Claude Desktop and other MCP clients.
by chatmcp
Summarize chat messages by querying a local chat database and returning concise overviews.
by dmayboroda
Provides on‑premises conversational retrieval‑augmented generation (RAG) with configurable Docker containers, supporting fully local execution, ChatGPT‑based custom GPTs, and Anthropic Claude integration.
by qdrant
Provides a Model Context Protocol server that stores and retrieves semantic memories using Qdrant vector search, acting as a semantic memory layer.
by doobidoo
Provides a universal memory service with semantic search, intelligent memory triggers, OAuth‑enabled team collaboration, and multi‑client support for Claude Desktop, Claude Code, VS Code, Cursor and over a dozen AI applications.
{
"mcpServers": {
"contextnest": {
"command": "npx",
"args": [
"-y",
"@promptowl/contextnest-mcp-server",
"/path/to/vault"
],
"env": {}
}
}
}claude mcp add contextnest npx -y @promptowl/contextnest-mcp-server /path/to/vault