@neuledge/context
v0.2.3
Published
Context management for Neuledge packages
Readme
The Problem
You're building with Next.js 16, and your AI assistant confidently suggests code using the old Pages Router because that's what it learned from training data. You paste the docs. It hallucinates anyway. You paste more docs. The context window fills up. Repeat.
AI assistants are powerful, but they're stuck in the past. Their training data is months or years old, and they don't know the specifics of the libraries you're using today.
The Solution
Context connects your AI assistant directly to up-to-date documentation—locally, instantly, and privately.
You: "How do I create middleware in Next.js 16?"
AI: [automatically queries local docs]
"In Next.js 16, create a middleware.ts file in your project root..."
[accurate, version-specific answer]No copy-pasting. No hallucinations about deprecated APIs. No waiting for cloud lookups.
Real-World Use Cases
:muscle: "Make my AI actually useful for the stack I use"
Add docs for your entire tech stack. Your AI assistant becomes an expert in the exact versions you're using:
context add https://github.com/vercel/next.js
context add https://github.com/prisma/prisma
context add https://github.com/tailwindlabs/tailwindcssNow ask things like:
- "How do I set up Prisma with Next.js App Router?"
- "What's the Tailwind config for dark mode?"
- "Show me the new Server Actions syntax"
:building_construction: "Stop answering the same questions for my team"
Building an internal library? Package your documentation once, share it with your team:
# Build docs from your repo
context add https://github.com/your-company/design-system
# Your whole team can now ask:
# "How do I use the DataTable component?"
# "What props does Button accept?":airplane: "Code on flights and in coffee shops"
Context works 100% offline. Download docs once, query forever—no internet required.
:lock: "Keep proprietary code discussions private"
Cloud documentation services see your queries. Context runs entirely on your machine. Your questions about internal APIs stay internal.
Why Context Over Cloud Alternatives?
| | Context7 | Deepcon | Context | |---|:---:|:---:|:---:| | Price | $10/month | $8/month | Free forever | | Free tier | 1,000 req/month ¹ | 100 req/month | Unlimited | | Rate limits | 60 req/hour | Throttled | None | | Latency | 100-500ms | 100-300ms | <10ms | | Works offline | :x: | :x: | :white_check_mark: | | Privacy | Queries sent to cloud | Queries sent to cloud | 100% local | | Private repos | $15/1M tokens | :x: | Free |
¹ Context7 reduced free tier from ~6,000 to 1,000 requests/month in January 2026
:zap: Key Features
- Single tool - One MCP tool does everything, no multi-step lookups
- Token-aware - Smart relevance filtering, never overwhelms the context window
- Dynamic schema - Available libraries shown in tool definition
- Offline-first - Zero network calls during operation
- SQLite + FTS5 - Fast full-text search with stemming
:rocket: Quick Start
1. Install
npm install -g @neuledge/context2. Add documentation
# From any git repository (GitHub, GitLab, Bitbucket, etc.)
context add https://github.com/vercel/next.js
context add https://gitlab.com/org/repo
context add [email protected]:user/repo.git
# From a local directory
context add ./my-project
context add /path/to/docs
# From URL (pre-built package)
context add https://example.com/[email protected]
# From local file
context add ./my-package.db3. Configure your AI agent
Context works with any MCP-compatible agent. Choose your setup below:
claude mcp add context -- context serveAdd to your config file:
- Linux:
~/.config/claude/claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"context": {
"command": "context",
"args": ["serve"]
}
}
}Restart Claude Desktop to apply changes.
Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-specific):
{
"mcpServers": {
"context": {
"command": "context",
"args": ["serve"]
}
}
}Or use Settings > Developer > Edit Config to add the server through the UI.
Requires VS Code 1.102+ with GitHub Copilot
Add to .vscode/mcp.json in your workspace:
{
"servers": {
"context": {
"type": "stdio",
"command": "context",
"args": ["serve"]
}
}
}Click the Start button that appears in the file, then use Agent mode in Copilot Chat.
Add to ~/.codeium/windsurf/mcp_config.json:
- Windows:
%USERPROFILE%\.codeium\windsurf\mcp_config.json
{
"mcpServers": {
"context": {
"command": "context",
"args": ["serve"]
}
}
}Or access via Windsurf Settings > Cascade > MCP Servers.
Add to your Zed settings (cmd+, or ctrl+,):
{
"context_servers": {
"context": {
"command": {
"path": "context",
"args": ["serve"]
}
}
}
}Check the Agent Panel settings to verify the server shows a green indicator.
Run goose configure and select Command-line Extension, or add directly to ~/.config/goose/config.yaml:
extensions:
context:
type: stdio
command: context
args:
- serve
timeout: 3004. Start using it
That's it! Now just ask your AI agent:
"How do I create middleware in Next.js?"
The agent automatically uses the get_docs tool when relevant.
:books: CLI Reference
context add <source>
Install a documentation package. The source type is auto-detected.
From git repository:
Works with GitHub, GitLab, Bitbucket, Codeberg, or any git URL:
# HTTPS URLs
context add https://github.com/vercel/next.js
context add https://gitlab.com/org/repo
context add https://bitbucket.org/org/repo
# Specific tag or branch
context add https://github.com/vercel/next.js/tree/v16.0.0
# SSH URLs
context add [email protected]:user/repo.git
context add ssh://[email protected]/user/repo.git
# Custom options
context add https://github.com/vercel/next.js --path packages/docs --name nextjsFrom local directory:
Build a package from documentation in a local folder:
# Auto-detects docs folder (docs/, documentation/, doc/)
context add ./my-project
# Specify docs path explicitly
context add /path/to/repo --path docs
# Custom package name and version
context add ./my-lib --name my-library --pkg-version 1.0.0| Option | Description |
|--------|-------------|
| --pkg-version <version> | Custom version label |
| --path <path> | Path to docs folder in repo/directory |
| --name <name> | Custom package name |
| --save <path> | Save a copy of the package to the specified path |
Saving packages for sharing:
# Save to a directory (auto-names as [email protected])
context add https://github.com/vercel/next.js --save ./packages/
# Save to a specific file
context add ./my-docs --save ./my-package.dbFrom URL:
context add https://cdn.example.com/[email protected]From local file:
context add ./[email protected]Finding the right documentation repository:
Many popular projects keep their documentation in a separate repository from their main codebase. If you see a warning about few sections found, the docs likely live elsewhere:
# Example: React's docs are in a separate repo
context add https://github.com/facebook/react
# ⚠️ Warning: Only 45 sections found...
# The warning includes a Google search link to help find the docs repo
# The actual React docs repository:
context add https://github.com/reactjs/react.devCommon patterns for documentation repositories:
project-docs(e.g.,prisma/docs)project.devorproject.io(e.g.,reactjs/react.dev)project-website(e.g.,expressjs/expressjs.com)
When the CLI detects few documentation sections, it will show a Google search link to help you find the correct repository.
context list
Show installed packages.
$ context list
Installed packages:
[email protected] 4.2 MB 847 sections
react@18 2.1 MB 423 sections
Total: 2 packages (6.3 MB)context remove <name>
Remove a package.
context remove nextjscontext serve
Start the MCP server (used by Claude Desktop).
context servecontext query <library> <topic>
Query documentation directly from the command line. Useful for testing and debugging.
# Query a package (use name@version format from 'context list')
context query '[email protected]' 'middleware authentication'
# Returns the same JSON format as the MCP get_docs tool:gear: How It Works
┌─────────────────────────────────────────────────────┐
│ Your Machine │
│ │
│ ┌──────────┐ ┌────────────┐ ┌───────────┐ │
│ │ Claude │────▶│ MCP Server │────▶│ ~/.context│ │
│ │ │ │ (get_docs) │ │ /packages│ │
│ └──────────┘ └────────────┘ └───────────┘ │
│ │ │
│ ▼ │
│ ┌────────────┐ │
│ │ SQLite │ │
│ │ FTS5 │ │
│ └────────────┘ │
└─────────────────────────────────────────────────────┘When you add a package:
- Repository is cloned (for git URLs) or read (for local directories)
- Documentation is parsed and split into sections
- Sections are indexed with FTS5 full-text search
- The package is stored in
~/.context/packages/
When Claude queries:
- FTS5 finds relevant sections by keyword matching
- Results are filtered by relevance score
- Token budget ensures responses stay concise
- Claude receives focused, relevant documentation
:package: Package Format
Packages are SQLite databases (.db files) containing pre-indexed documentation.
~/.context/packages/
├── [email protected]
├── [email protected]
└── [email protected]You can:
- Build from any git repository (GitHub, GitLab, Bitbucket, etc.)
- Build from local directories
- Download pre-built packages from URLs
- Share packages via releases or any file host
:wrench: Development
# Install dependencies
pnpm install
# Build
pnpm build
# Test
pnpm test
# Lint
pnpm lint