Introduction
Lien (French for "link" or "connection") is a local-first semantic code search tool that provides deep codebase context to AI coding assistants like Cursor through the Model Context Protocol (MCP).
What is Lien?
Lien indexes your codebase locally and enables AI assistants to understand your code through natural language queries. Unlike cloud-based solutions, everything runs on your machine—your code never leaves your computer.
Key Benefits
Privacy First
Your code is precious intellectual property. Lien processes everything locally with no external API calls, no data collection, and no telemetry.
Semantic Understanding
Instead of simple text search, Lien understands code semantically. Ask "how does authentication work?" and get relevant results even if the code doesn't contain those exact words.
AI-Powered Development
Integrate with Cursor and other MCP-compatible tools to give AI assistants deep context about your codebase, enabling better suggestions and answers.
Framework Aware
Automatically detects and adapts to your project structure:
- Node.js/TypeScript: Package.json detection, Jest/Vitest/Mocha support
- Laravel/PHP: Composer detection, blade templates, frontend assets
- Shopify: Liquid theme detection, hybrid themes with Vue/React
- Monorepo: Multiple frameworks in one repository
How Does It Work?
- Scan: Lien walks your codebase and identifies source files based on framework detection
- Chunk: Files are split into semantic chunks (functions, classes, logical blocks)
- Embed: Each chunk is converted to a vector embedding using a local ML model
- Store: Embeddings are stored in a local vector database (LanceDB)
- Query: When you search, your query is embedded and matched against stored chunks
- Retrieve: The most relevant code chunks are returned with context
Use Cases
Understanding New Codebases
Quickly understand how a new codebase works without reading every file:
- "Show me the database schema"
- "How is error handling implemented?"
- "Where are API routes defined?"
Finding Implementations
Locate specific functionality across a large codebase:
- "Find JWT token validation"
- "Show authentication middleware"
- "Where is user registration handled?"
Discovering Patterns
Find similar code patterns for refactoring or consistency:
- "Find similar validation functions"
- "Show all database queries"
- "Locate API endpoint handlers"
Test Coverage
Understand what tests cover specific code:
- "What tests cover this module?"
- "Show related test files"
- "Find test patterns for this feature"
Architecture
Lien is built with modern, performant tools:
- TypeScript for type-safe development
- transformers.js for local embeddings (no external API)
- LanceDB for vector storage
- MCP SDK for Cursor integration
- Commander.js for CLI
Supported Languages
Lien indexes and understands code in:
- TypeScript, JavaScript (JSX/TSX), Vue
- Python, PHP, Liquid
- Go, Rust
- Java, C/C++
- Ruby, Swift, Kotlin, C#, Scala
Next Steps
Ready to get started? Follow our installation guide to set up Lien in minutes.