Context Lens
Semantic search knowledge base for MCP-enabled AI assistants. Index local files or GitHub repos, query with natural language. Built on LanceDB vector storage. Works with Claude Desktop, Cursor, and other MCP clients.
What is Context Lens?
Context Lens is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to semantic search knowledge base for mcp-enabled ai assistants. index local files or github repos, query with natural language. built on lancedb vector storage. works with claude desktop, cursor, and ot...
Semantic search knowledge base for MCP-enabled AI assistants. Index local files or GitHub repos, query with natural language. Built on LanceDB vector storage. Works with Claude Desktop, Cursor, and other MCP clients.
This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Semantic search knowledge base for MCP-enabled AI assistants
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx context-lensConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Context Lens
Context Lens is a self-contained MCP server that turns any local files or public GitHub repositories into a semantic knowledge base your AI assistant can search with natural language. It uses the sentence-transformers/all-MiniLM-L6-v2 embedding model to convert content into 384-dimensional vectors stored in a serverless LanceDB database on disk, with no cloud services or external API keys required. AI assistants connected via MCP can index entire codebases or documentation sets and answer questions based on meaning rather than keyword matching — finding content about 'authentication' even when files use terms like 'login', 'credentials', or 'OAuth'.
Prerequisites
- Python 3.11 or higher
- uvx (from the uv package manager) for zero-config installation — install uv with `pip install uv`
- An MCP client: Claude Desktop, Cursor, Kiro IDE, or any MCP-compatible assistant
- Approximately 90 MB of disk space for the embedding model download on first run
- No external API keys or cloud accounts required
Install uvx
Context Lens is published to PyPI as the context-lens package and runs via uvx with no manual installation. First ensure uv is available.
pip install uv
# Verify
uvx --versionConfigure your MCP client
Add Context Lens to your MCP client configuration. The uvx command automatically downloads and runs the package. For Claude Desktop, edit claude_desktop_config.json.
{
"mcpServers": {
"context-lens": {
"command": "uvx",
"args": ["context-lens"]
}
}
}Restart your MCP client
Restart Claude Desktop or reload MCP servers in your client. On first run, Context Lens downloads the ~90 MB sentence-transformers/all-MiniLM-L6-v2 embedding model automatically.
Index a local directory
Ask your AI assistant to index a local folder. Context Lens uses language-aware parsers (AST for Python, structural parsing for JSON, header-based splitting for Markdown) to create meaningful chunks rather than arbitrary character splits.
Index a GitHub repository
Ask your AI assistant to add a public GitHub repository to the knowledge base. Context Lens clones and indexes it automatically.
Search the knowledge base
Ask natural language questions. Context Lens converts your question to a vector and finds semantically similar chunks using cosine similarity across the LanceDB index.
Context Lens Examples
Client configuration
Standard uvx-based configuration that works with Claude Desktop, Cursor, Kiro IDE, and any MCP-compatible client.
{
"mcpServers": {
"context-lens": {
"command": "uvx",
"args": ["context-lens"],
"autoApprove": ["list_documents", "search_documents"]
}
}
}Prompts to try
These prompts demonstrate indexing content and then querying it semantically via the MCP tools.
- "Add https://github.com/fastapi/fastapi to the knowledge base"
- "Index my local project at /Users/me/projects/myapp"
- "How does FastAPI handle dependency injection?"
- "Find all code related to authentication and access control in the indexed documents"
- "List all documents currently in the knowledge base"
- "Search for error handling patterns across the indexed repositories"Troubleshooting Context Lens
First run is slow or appears to hang
On first use, Context Lens downloads the sentence-transformers/all-MiniLM-L6-v2 embedding model (~90 MB). This is a one-time download. Wait for the download to complete before querying. Subsequent starts are fast.
uvx command not found
Install uv with `pip install uv` or via the official installer: `curl -LsSf https://astral.sh/uv/install.sh | sh`. After installation, ensure the uv bin directory is in your PATH and restart your terminal.
Search results are irrelevant or the wrong files are returned
Semantic search works best with natural language queries that describe the concept you are looking for. Avoid very short or highly technical queries (e.g. single function names) — use describe-what-it-does phrasing instead. If results are still poor, try re-indexing the content with `Add [path] to the knowledge base` to refresh the vectors.
Frequently Asked Questions about Context Lens
What is Context Lens?
Context Lens is a Model Context Protocol (MCP) server that semantic search knowledge base for mcp-enabled ai assistants. index local files or github repos, query with natural language. built on lancedb vector storage. works with claude desktop, cursor, and other mcp clients. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Context Lens?
Follow the installation instructions on the Context Lens GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Context Lens?
Context Lens works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Context Lens free to use?
Yes, Context Lens is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Context Lens Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to Context Lens? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
Browse More Knowledge & Memory MCP Servers
Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Context Lens in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Context Lens?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.