Skip to content

Latest commit

Β 

History

211 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ContextLens

ContextLens

The AI context layer for your codebase.

Track coding intent, capture AI interactions, and expose your development history to any MCP-compatible AI client.

VS Code Marketplace License: MIT CI Node.js

Installation Β· Features Β· Quick Start Β· Architecture Β· Documentation Β· Contributing


Warning

ContextLens is under active development. Some features are in preview and may change without notice.

πŸ€” Why ContextLens?

Every coding session generates context that AI tools lose between conversations. ContextLens captures the why behind every change β€” diffs, AI interactions, decisions β€” and makes it available to any AI client through the Model Context Protocol (MCP).

Without ContextLens: Each AI session starts from scratch, re-analyzing your code. With ContextLens: AI tools access your full development history, past decisions, and project context.

✨ Features

Episode-Based Context Tracking

  • Organize work into logical episodes (features, bugfixes, refactors)
  • Automatically capture diffs and AI interactions
  • Build a semantic history of your project

MCP Server (Model Context Protocol)

  • 9 Tools: Status, episodes, AI logging, diff explanation, context search
  • 5 Resources: Workspace state, git diff, episodes, diagnostics, symbols
  • 5 Prompts: Code review, test generation, security audit, diff explanation
  • Works with Claude Desktop, Cursor, Antigravity IDE, Gemini CLI, and more

Security-First Design

  • Rotating authentication tokens (30-min TTL)
  • Per-client rate limiting with burst protection
  • Input validation on all tool calls
  • Local-only binding (127.0.0.1)

Developer Dashboard

  • Visual timeline of project progress
  • AI-generated PR descriptions and impact assessments
  • Branch-level analysis

🎯 Supported MCP Clients

Client Status Setup
Claude Desktop βœ… Supported Auto-setup or manual
Cursor βœ… Supported Auto-setup or manual
Antigravity IDE βœ… Supported Manual config
VS Code Agent βœ… Built-in Automatic
Gemini CLI βœ… Supported Manual config
OpenAI Agents SDK βœ… Supported Python integration

πŸ“¦ Installation

VS Code Extension

# From VS Code Marketplace
ext install Noventra-Labs.contextlens

Or search "ContextLens" in the VS Code Extensions panel.

MCP Bridge (npm)

npm install -g @contextlens/mcp

Auto-Setup for AI Clients

  1. Install the VS Code extension
  2. Open Command Palette β†’ ContextLens: Auto-Setup MCP in AI Clients
  3. Done! Your AI client can now access ContextLens tools.

Manual Setup

Add to your AI client's MCP configuration:

{
  "contextlens": {
    "command": "node",
    "args": ["/path/to/mcp-bridge.js"]
  }
}

Use ContextLens: Copy MCP Configuration to get the correct path.

πŸš€ Quick Start

The canonical ContextLens flow is: install β†’ sign in β†’ start an episode β†’ code with your AI β†’ close the episode β†’ review context.

1. Start an Episode

Ask your AI client:

"Use the start_episode tool to begin tracking my work on the login feature"

Or run the ContextLens: New Episode command in VS Code. Episodes are also auto-created when you switch branches.

2. Code as Usual

ContextLens automatically captures:

  • Git diffs (redacted, truncated to 6000 chars)
  • Git commit messages
  • File changes (workspace-relative paths)
  • Branch switches (closing/opening episodes)

3. Get Context

Ask your AI client:

"What changes have I made in this episode? Use explain_diff to analyze them."

AI actions β€” explain_diff, explain_past_changes, summarize_branch, search_context β€” are manual triggers only. ContextLens never invokes an AI model automatically, so you control AI cost.

4. Search Past Work

"Search my past episodes for anything related to authentication using search_context"

Automatic vs. manual capture

Captured automatically Manual (AI-triggered) actions
Diffs, commits, file saves, branch switches log_ai_call, explain_diff, explain_past_changes, search_context
Paused with ContextLens: Pause / Resume Capture Always opt-in via your AI client

Where your data lives

  • Local only: diffs and AI prompts are redacted before they leave the machine; the offline sync queue (cl_queue.json) is local to VS Code.
  • Uploaded (after sign-in): redacted episode metadata, diff summaries, and AI prompt/response text are synced to your authenticated Firebase project. See Privacy.

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   AI Client         β”‚         β”‚   VS Code Extension             β”‚
β”‚   (Claude, Cursor)  β”‚         β”‚                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
         β”‚ stdio JSON-RPC       β”‚  β”‚  ToolRegistry (9 tools)   β”‚  β”‚
         β–Ό                      β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚  β”‚  Resources (5 URIs)       β”‚  β”‚
β”‚   mcp-bridge.js     │◄───HTTP─│  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚
β”‚   (MCP Server)      β”‚ :3012   β”‚  β”‚  Prompts (5 templates)    β”‚  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚
                                β”‚  β”‚  Security Layer           β”‚  β”‚
                                β”‚  β”‚  β”œβ”€β”€ TokenManager         β”‚  β”‚
                                β”‚  β”‚  β”œβ”€β”€ RateLimiter          β”‚  β”‚
                                β”‚  β”‚  └── InputValidator       β”‚  β”‚
                                β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Repository Structure

Component Path Description
VS Code Extension /vscode-extension Primary client with MCP server
MCP Implementation /vscode-extension/src/mcp/ Tools, resources, prompts, security
MCP Bridge /vscode-extension/mcp-bridge.js stdio JSON-RPC bridge for AI clients
Web Dashboard /contextlens-dashboard React-based visual interface
Backend /src Firebase Cloud Functions + Firestore
Documentation /docs Architecture, API, tutorials

πŸ“– Documentation

Document Description
Getting Started Installation and first steps
Architecture System design and data flow
Security Authentication, rate limiting, error codes
Examples Client configuration examples
API Reference Tools, resources, prompts reference
Data Model Episode lifecycle, fields, sync & edge cases
Privacy Policy How ContextLens handles codebase data and secrets
Troubleshooting Common issues and solutions
FAQ Frequently asked questions

🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for:

  • Development setup
  • Branch naming and commit conventions
  • How to add new MCP tools and resources
  • Testing requirements

πŸ”’ Security

Found a vulnerability? Please see SECURITY.md for responsible disclosure.

πŸ“‹ Roadmap

See ROADMAP.md for planned features and milestones.

πŸ“„ License

This project is licensed under the MIT License β€” see LICENSE for details.


About

ContextLens is an AI-driven developer companion that captures your coding intent, tracks development "episodes," and provides high-level project insights through a unified dashboard and CLI.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages