Needle Extract MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Needle Extract MCPremember that my favorite color is blue"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Needle Extract MCP
A production-ready, ultra-lightweight Model Context Protocol (MCP) server for persistent conversational memory.
Overview
Needle Extract MCP enables small local models (<=4B parameters) to persist and retrieve long-term user facts reliably. It eliminates the need for heavy VRAM usage, external vector databases, or complex multi-step tool logic. By employing a lightweight extraction logic and SQLite's built-in FTS5 text search, this server acts as a rapid, lightweight memory store for any AI agent compatible with the Model Context Protocol (MCP) standard.
Related MCP server: rekal
Features
FastMCP Protocol: Fully compliant with standard MCP. Exposes
rememberandrecalltools for LLM integration.Smart Chunking Engine: Automatically preprocesses and chunks incoming prompts into short sentence blocks (under 50 words) to guarantee it fits safely within small KV windows (such as Needle 2's 256-token limit).
Lightweight DB: Uses
sqlite3with FTS5 (Full-Text Search) and the Porter stemmer for lightning-fast BM25 keyword matching and fact retrieval. No heavy vector database required.Regex Fallback: Built-in rule-based fallback parsing to ensure uninterrupted server execution if extraction logic fails.
Strict Validation: Leverages
pydanticto maintain strict memory schema parsing and validation.
Architecture
server.py: The FastMCP server handling standard I/O communication and exposing the MCP tools.chunker.py: Performs sentence-level windowing, stripping noise like code/markdown blocks, and filtering trivial chunks to minimize model passes.extractor.py: Handles schema decoding and mapping conversational snippets to structuredMemoryFactobjects.db.py: Manages SQLite FTS5 virtual tables, transaction batching, and BM25 searching.
Requirements
Python 3.11+
CPU-only execution (sub-50MB RAM footprint).
Zero cloud dependencies.
Installation
git clone https://github.com/BhargavGadekar/needle-extract-mcp.git
cd needle-extract-mcp
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtRunning the MCP Server
To configure your MCP Client (like Antigravity or LM Studio) to use this server, add the following to your MCP client's configuration file (e.g., mcp_config.json):
{
"mcpServers": {
"needle-extract": {
"command": "/absolute/path/to/needle-extract-mcp/.venv/bin/python",
"args": ["/absolute/path/to/needle-extract-mcp/server.py"]
}
}
}Note: Replace /absolute/path/to/needle-extract-mcp with the actual path to your repository on your system.
Available Tools
1. remember
Inputs:
conversation_snippet(string)Description: Extracts facts from a conversation snippet and stores them in persistent memory. It chunks the text, extracts atomic facts, assigns topics/tags, and commits them in a batch transaction.
Returns: A confirmation message with a bulleted list of extracted facts, or a "no new facts detected" message.
2. recall
Inputs:
query(string)Description: Searches persistent memory for relevant facts based on a text query. It uses SQLite FTS5 for BM25 ranking and handles wildcard tokens.
Returns: A formatted, scannable bullet list of facts found in the database.
Testing
Run the automated test suite with pytest to ensure chunking limits, extraction heuristics, and storage/search mechanisms are working properly.
pytest test_memory.pyLicense
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Mem0-compatible persistent memory for AI agents: write facts once, recall them semantically.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
- GoMindOAuthcom.gominddb
Persistent knowledge graph for AI agents. Remember, recall, and forget facts.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceProvides persistent local memory functionality for AI assistants, enabling them to store, retrieve, and search contextual information across conversations with SQLite-based full-text search. All data stays private on your machine while dramatically improving context retention and personalized assistance.3-
- AlicenseNot gradedqualityAmaintenanceProvides long-term memory for LLMs via local SQLite storage with hybrid search (BM25, vectors, recency decay), enabling AI coding agents to persist and recall memories across sessions without cloud or API keys.53MIT
- AlicenseNot gradedqualityCmaintenanceProvides persistent long-term memory for LLMs via local SQLite storage and semantic search, enabling recall across sessions without external APIs.6 npm4MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to maintain long-term memory by logging and retrieving facts and decisions in a SQLite database, with relevance ranking and full history tracking.7MIT