MCP Semantic Search
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
@nacho-labs/mcp-semantic-search
MCP server that gives AI coding tools persistent semantic memory. Index decisions, patterns, and project context — recall them by meaning, not keywords.
Powered by @nacho-labs/nachos-embeddings. Runs entirely locally with Transformers.js — no API keys, no cloud, no costs.
Prerequisites
Node.js 20.9+
Internet on first run to download the embedding model (~25MB, cached in a per-user directory)
Related MCP server: coding-memory-mcp
Quick start
Claude Code
claude mcp add --transport stdio semantic-search -- npx @nacho-labs/mcp-semantic-searchCursor / VS Code / any MCP client
Add to your MCP config (.mcp.json, mcp.json, or client-specific config):
{
"mcpServers": {
"semantic-search": {
"type": "stdio",
"command": "npx",
"args": ["@nacho-labs/mcp-semantic-search"]
}
}
}That's it. Your AI tool now has seven semantic memory tools.
Tools
Tool | Description |
| Check server health, metrics, and active configuration |
| Search indexed documents by meaning |
| Add a document to the index |
| Add multiple documents at once |
| Remove a document by ID |
| Get index size, store location, and config |
| Remove all documents (requires confirmation) |
What it does
You ask Claude: "How do we handle rate limiting?"
|
Claude calls: semantic_search("rate limiting")
|
Server embeds: query -> 384-dimension vector
|
Cosine search: against all indexed vectors
|
Returns: "We throttle API requests using sliding windows..."
(matched by meaning, not keywords)The embedding model understands meaning:
Query | Finds |
"rate limiting" | "We throttle API requests using sliding windows" |
"how to deploy" | "Production runs via docker compose up with..." |
"error handling" | "We use Result types instead of try/catch for..." |
What to index
High-value content for project memory:
Architecture decisions — "We chose PostgreSQL over DynamoDB because we need complex joins for the reporting module."
Code patterns — "Authentication middleware is in src/middleware/auth.ts. Uses JWT with RS256, tokens expire after 1 hour, refresh tokens after 30 days."
Conventions — "All API endpoints return { data, error, meta } shape. Errors use RFC 7807 problem details format."
Debugging insights — "If the worker queue backs up, check Redis memory. The default maxmemory-policy is noeviction which causes write failures."
Configuration
CLI arguments
npx @nacho-labs/mcp-semantic-search \
--store /path/to/store.json \
--similarity 0.5 \
--model Xenova/all-mpnet-base-v2 \
--cache-dir /tmp/modelsEnvironment variables
Variable | Description | Default |
| Path to persistence file |
|
| Min similarity threshold (0-1) |
|
| Embedding model |
|
| Model cache directory | per-user cache (see below) |
|
|
|
| Exact-duplicate detection (maps to |
|
| Near-duplicate threshold; |
|
Both dedup settings off (false and 0) disables deduplication.
Model cache
Unless MCP_SEMANTIC_CACHE_DIR is set, models are cached per user and shared
across projects: $NACHOS_EMBEDDINGS_CACHE, else the XDG cache directory, else
~/.cache/nachos-embeddings. Earlier versions used .cache/transformers in the
working directory; set MCP_SEMANTIC_CACHE_DIR to that path to keep using an
existing cache instead of re-downloading (~90MB).
Corrupt store
If the store file cannot be parsed, the server exits with a non-zero status and
a message naming the file; it does not retry. Repair or delete the file, or set
MCP_SEMANTIC_ON_CORRUPT_STORE=quarantine to rename the corrupt file aside and
start with an empty index.
With environment variables in MCP config
{
"mcpServers": {
"semantic-search": {
"type": "stdio",
"command": "npx",
"args": ["@nacho-labs/mcp-semantic-search"],
"env": {
"MCP_SEMANTIC_STORE": "/home/user/.semantic-memory/project.json",
"MCP_SEMANTIC_SIMILARITY": "0.5"
}
}
}
}Performance
Operation | Time |
Server startup (model cached) | ~500ms |
Server startup (first run) | ~2-5s |
Index a document | ~10-50ms |
Search 1000 documents | ~5-10ms |
Memory: ~100MB for model + ~1.5KB per document.
The in-memory store works well up to ~10K documents. Beyond that, consider a dedicated vector database.
Persistence
The index is saved to disk automatically after every write operation (index, remove, clear). On startup, the server loads the existing store if present.
Default location: .semantic-store.json in the working directory.
How it's built
This MCP server is a thin wrapper around two packages:
@nacho-labs/nachos-embeddings — Local vector embeddings and semantic search
@modelcontextprotocol/sdk — Official MCP TypeScript SDK
The embeddings package can also be used directly in your own code. See its README for the standalone API.
Development
git clone https://github.com/nacho-labs-llc/mcp-semantic-search.git
cd mcp-semantic-search
npm install
npm run build
npm startQuality checks
npm run format:check
npm run lint
npm run typecheck
npm test
npm run test:integrationnpm test runs deterministic unit/contract tests only; it does not build the
server or download a model.
npm run test:integration runs the network/model-backed compiled MCP stdio
smoke. It builds dist/, starts the server with StdioClientTransport, lists
tools, calls semantic_health, then indexes and searches a real document.
The integration smoke uses the real default Transformers.js provider. On its first run, it needs internet access to download the model (about 25 MB); later runs can reuse the configured model cache. The release CI workflow caches that directory between runs and passes the same explicit cache path to the smoke, but network availability is still required when a cache miss occurs.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
One shared project memory for your AI coding tools: recall, save and brief decisions anywhere.
Shared memory for AI coding agents. Save once, reuse from Cursor, Claude Code, Codex.
Private memory for AI agents: save and recall facts across Claude Code, Codex, Cursor and ChatGPT.
Related MCP Servers
- AlicenseCqualityBmaintenanceGives AI coding assistants persistent project memory and semantic code search, running fully locally with no API keys required.56MIT
- AlicenseNot gradedqualityDmaintenanceProvides a local long-term memory layer for AI coding tools like Cursor and Claude Code, enabling cross-session, cross-tool sharing of project facts, user preferences, decisions, and workflows.11 npm2MIT
- AlicenseNot gradedqualityBmaintenanceEnables saving bookmarks, notes, and files from inside Claude Code or Codex and later finding them from any project or session just by describing what you remember. All storage, indexing, and natural-language search run locally via SQLite and a bundled embedding model, with no accounts, cloud, or API keys.6 npmMIT
- FlicenseNot gradedqualityAmaintenanceProvides AI coding agents with a local-first persistent memory layer they can read and write during sessions, storing decisions, preferences, error patterns, and research per project or globally. Enables semantic and keyword search, formatted context recall, and cross-project guideline surfacing without API keys or cloud storage.-