You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

localnest-mcp

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localnest-mcp

LocalNest read-only MCP server for exposing project context from local machine

latest
Source
npmnpm
Version
0.0.5
Version published
Weekly downloads
336
55.56%
Maintainers
2
Weekly downloads
 
Created
Source

LocalNest MCP

stable nightly Node.js License: MIT Quality CodeQL Socket

Your codebase. Your AI. Your machine — no cloud, no leaks, no surprises.

LocalNest is a local-first MCP server that gives AI agents safe, scoped access to your code — with hybrid search, semantic indexing, and persistent memory that never leaves your machine.

📖 Full documentation · Architecture deep dive

Why LocalNest?

Most AI code tools phone home. LocalNest doesn't.

Everything — file reads, vector embeddings, memory — runs in-process on your machine. No cloud subscription, no rate limits, no data leaving your box. And because it speaks MCP, any compatible client (Cursor, Windsurf, Codex, Kiro, Gemini CLI) can plug in with one config block.

What you getHow it works
Safe file accessScoped reads under your configured roots — nothing outside
Instant lexical searchripgrep-backed symbol and pattern search (JS fallback if missing)
Semantic searchLocal vector embeddings via all-MiniLM-L6-v2 — no GPU needed
Hybrid retrievalLexical + semantic fused with RRF ranking for best-of-both results
Project awarenessAuto-detects projects from marker files, scopes every tool call
Agent memoryDurable, queryable knowledge graph — your AI remembers what it learned

Quick Start

npm install -g localnest-mcp
localnest setup
localnest doctor

3. Drop this into your MCP client config

Setup auto-writes the config for detected tools. You'll also find a ready-to-paste block at ~/.localnest/config/mcp.localnest.json:

{
  "mcpServers": {
    "localnest": {
      "command": "localnest-mcp",
      "startup_timeout_sec": 30,
      "env": {
        "MCP_MODE": "stdio",
        "LOCALNEST_CONFIG": "~/.localnest/config/localnest.config.json",
        "LOCALNEST_INDEX_BACKEND": "sqlite-vec",
        "LOCALNEST_DB_PATH": "~/.localnest/data/localnest.db",
        "LOCALNEST_INDEX_PATH": "~/.localnest/data/localnest.index.json",
        "LOCALNEST_EMBED_PROVIDER": "huggingface",
        "LOCALNEST_EMBED_MODEL": "sentence-transformers/all-MiniLM-L6-v2",
        "LOCALNEST_EMBED_CACHE_DIR": "~/.localnest/cache",
        "LOCALNEST_EMBED_DIMS": "384",
        "LOCALNEST_RERANKER_PROVIDER": "huggingface",
        "LOCALNEST_RERANKER_MODEL": "cross-encoder/ms-marco-MiniLM-L-6-v2",
        "LOCALNEST_RERANKER_CACHE_DIR": "~/.localnest/cache",
        "LOCALNEST_MEMORY_ENABLED": "false",
        "LOCALNEST_MEMORY_BACKEND": "auto",
        "LOCALNEST_MEMORY_DB_PATH": "~/.localnest/data/localnest.memory.db"
      }
    }
  }
}

Windows: Use the config written by localnest setup — it sets the correct command for your platform automatically.

Restart your MCP client. If it times out, set startup_timeout_sec: 30 in your client config.

Requirements: Node.js >=18 · ripgrep recommended but optional

AST-aware chunking ships by default for JavaScript, Python, Go, Bash, Lua, and Dart. Other languages still index cleanly with line-based fallback chunking.

The current stable runtime uses @huggingface/transformers for local embeddings and reranking. New setup defaults use huggingface, and older xenova configs remain accepted as a compatibility alias.

# macOS
brew install ripgrep

# Ubuntu/Debian
sudo apt-get install ripgrep

# Windows
winget install BurntSushi.ripgrep.MSVC

Upgrade

localnest upgrade              # latest stable
localnest upgrade stable       # latest stable
localnest upgrade beta         # latest beta
localnest upgrade <version>    # pin to a specific version
localnest version              # check current

How Agents Use It

Two workflows cover almost everything:

Fast lookup — find it, read it, done

Best for pinpointing a file, symbol, or code pattern.

localnest_search_files   → find the module by path/name
localnest_search_code    → find the exact symbol or identifier
localnest_read_file      → read the relevant lines

Deep task — debug, refactor, review with context

Best for complex work where memory and semantic understanding matter.

localnest_task_context    → one call: runtime status + recalled memories
localnest_search_hybrid   → concept-level search across your codebase
localnest_read_file       → read the relevant sections
localnest_capture_outcome → persist what you learned for next time

Tool success ≠ useful result. A tool can return OK and still be empty. Treat non-empty file matches and real line content as meaningful evidence — not just process success.

Tools

Workspace & Discovery

ToolWhat it does
localnest_list_rootsList configured roots
localnest_list_projectsList projects under a root
localnest_project_treeFile/folder tree for a project
localnest_summarize_projectLanguage and extension breakdown
localnest_read_fileRead a bounded line window from a file

Search & Index

ToolWhat it does
localnest_search_filesFile/path name search — start here for module discovery
localnest_search_codeLexical search — exact symbols, regex, identifiers
localnest_search_hybridHybrid search — lexical + semantic, RRF-ranked
localnest_get_symbolFind definition/export locations for a symbol
localnest_find_usagesFind import and call-site usages for a symbol
localnest_index_projectBuild or refresh the semantic index
localnest_index_statusIndex metadata — exists, stale, backend
localnest_embed_statusEmbedding backend and vector-search readiness

Memory

ToolWhat it does
localnest_task_contextOne-call runtime + memory context for a task
localnest_memory_recallRecall relevant memories for a query
localnest_capture_outcomeCapture a task outcome into memory
localnest_memory_capture_eventBackground event ingest with auto-promotion
localnest_memory_storeStore a memory manually
localnest_memory_updateUpdate a memory and append a revision
localnest_memory_deleteDelete a memory
localnest_memory_getFetch one memory with revision history
localnest_memory_listList stored memories
localnest_memory_eventsInspect recent memory events
localnest_memory_add_relationLink two memories with a named relation
localnest_memory_remove_relationRemove a relation
localnest_memory_relatedTraverse the knowledge graph one hop
localnest_memory_suggest_relationsAuto-suggest related memories by similarity
localnest_memory_statusMemory consent, backend, and database status

Server & Updates

ToolWhat it does
localnest_server_statusRuntime config, roots, ripgrep, index backend
localnest_healthCompact health summary with background monitor report
localnest_usage_guideBest-practice guidance for agents
localnest_update_statusCheck npm for latest version (cached)
localnest_update_selfUpdate globally and sync bundled skill (approval required)

All tools support response_format: "json" (default) or "markdown". List tools return total_count, has_more, next_offset for pagination.

Memory — Your AI Doesn't Forget

Enable memory during localnest setup and LocalNest starts building a durable knowledge graph in a local SQLite database. Every bug fix, architectural decision, and preference your AI agent touches can be recalled on the next session.

  • Requires Node 22.13+ — search and file tools work fine on Node 18/20 without it
  • Memory failure never blocks other tools — everything degrades independently

How auto-promotion works: events captured via localnest_memory_capture_event are scored for signal strength. High-signal events — bug fixes, decisions, preferences — get promoted into durable memories. Weak exploratory events are recorded and quietly discarded after 30 days.

Index Backend

BackendWhen to use
sqlite-vecRecommended. Persistent SQLite, fast and efficient for large repos. Requires Node 22+.
jsonCompatibility fallback. Auto-selected if sqlite-vec is unavailable.

Check localnest_server_statusupgrade_recommended to know when to migrate.

Configuration

Setup writes everything to ~/.localnest/:

~/.localnest/
├── config/   → localnest.config.json, mcp.localnest.json
├── data/     → SQLite index + memory databases
├── cache/    → Model weights, update status
├── backups/  → Config migration history
└── vendor/   → Managed native deps (sqlite-vec)

Config priority: PROJECT_ROOTS env → LOCALNEST_CONFIG file → current directory

Key environment variables:

VariableDefaultDescription
LOCALNEST_INDEX_BACKENDsqlite-vecsqlite-vec or json
LOCALNEST_DB_PATH~/.localnest/data/localnest.dbSQLite database path
LOCALNEST_VECTOR_CHUNK_LINES60Lines per index chunk
LOCALNEST_VECTOR_CHUNK_OVERLAP15Overlap between chunks
LOCALNEST_VECTOR_MAX_FILES20000Max files per index run
LOCALNEST_EMBED_MODELsentence-transformers/all-MiniLM-L6-v2Embedding model
LOCALNEST_EMBED_CACHE_DIR~/.localnest/cacheModel cache path
LOCALNEST_RERANKER_MODELcross-encoder/ms-marco-MiniLM-L-6-v2Cross-encoder reranker model
LOCALNEST_MEMORY_ENABLEDfalseEnable local memory subsystem
LOCALNEST_MEMORY_DB_PATH~/.localnest/data/localnest.memory.dbMemory database path
LOCALNEST_MEMORY_AUTO_CAPTUREfalseAuto-promote background events
LOCALNEST_UPDATE_CHECK_INTERVAL_MINUTES120npm update check interval
All environment variables
VariableDefaultDescription
LOCALNEST_INDEX_PATH~/.localnest/data/localnest.index.jsonJSON index path
LOCALNEST_SQLITE_VEC_EXTENSIONauto-detectedNative vec0 extension path
LOCALNEST_VECTOR_MAX_TERMS80Max terms per chunk
LOCALNEST_EMBED_PROVIDERhuggingfaceEmbedding backend
LOCALNEST_EMBED_DIMS384Embedding vector dimensions
LOCALNEST_RERANKER_PROVIDERhuggingfaceReranker backend
LOCALNEST_RERANKER_CACHE_DIR~/.localnest/cacheReranker cache path
LOCALNEST_MEMORY_BACKENDautoauto, node-sqlite, or sqlite3
LOCALNEST_MEMORY_CONSENT_DONEfalseSuppress consent prompt
LOCALNEST_UPDATE_PACKAGElocalnest-mcpnpm package name to check
LOCALNEST_UPDATE_FAILURE_BACKOFF_MINUTES15Retry on failed npm check

Install Note

0.0.5 promotes the beta.9 install/runtime fixes into the stable line, including bundled skill version reporting, installed-runtime validation hardening, and the simplified skill-sync flow. Some npm environments may still show a single upstream deprecation warning from the ONNX runtime dependency chain; LocalNest functionality is unaffected.

Performance tips:

  • Scope queries with project_path + a narrow glob whenever possible
  • Start with max_results: 20–40, widen only when needed
  • Leave reranking off by default — enable only for final precision passes

Skill Distribution

LocalNest ships a bundled AI agent skill for Claude Code, Cursor, Codex, and other supported clients. Install once and your agent knows exactly how to use every tool.

localnest install skills             # install or update bundled skills
localnest install skills --force     # force reinstall
localnest-mcp-install-skill          # legacy alias

Shell CLI tools for automation and hooks:

localnest-mcp-task-context --task "debug auth" --project-path /path/to/project
localnest-mcp-capture-outcome --task "fix auth" --summary "..." --files-changed 2

Both commands accept JSON on stdin. Install from GitHub:

npx skills add https://github.com/wmt-mobile/localnest --skill localnest-mcp

Auto-Migration

Upgrade without ceremony. On startup, LocalNest automatically migrates older config schemas and the flat ~/.localnest layout into the new config/, data/, cache/, and backups/ structure. No manual reruns, no broken configs after upgrades.

Security

LocalNest follows the OSS security pipeline pattern:

Contributing

See CONTRIBUTING.md · CHANGELOG.md · SECURITY.md

New to the codebase? Start with the Architecture Overview — covers how the server boots, how search and memory work, and where everything lives.

Contributors

Contributors

Thanks to everyone who contributes code, docs, reviews, testing, and issue reports.

Keywords

mcp

FAQs

Package last updated on 11 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts