Local semantic code search for AI assistants via MCP
npm install @liendev/lien> /ljΙΜ/ β French for "link"
Give AI deep understanding of your codebase through semantic search. 100% local, 100% private.
Lien connects AI coding assistants like Cursor and Claude Code to your codebase through the Model Context Protocol (MCP). Ask questions in natural language, get precise answers from semantic searchβall running locally on your machine.
π Full Documentation | π Getting Started | π How It Works
---
- π 100% Local & Private - All code analysis happens on your machine
- π Semantic Search - Natural language queries: "How does authentication work?"
- π Cross-Repo Search - Search across all repositories in your organization (Qdrant backend)
- π― MCP Integration - Works seamlessly with Cursor, Claude Code, and other MCP-compatible tools
- β‘ Fast - Sub-500ms queries, minutes to index large codebases
- π Free Forever - No API costs, no subscriptions, no usage limits
- π¦ Framework-Aware - Auto-detects Node.js, Laravel, Shopify; supports 15+ languages
- ποΈ Monorepo Support - Index multiple frameworks in one repository
- π Complexity Analysis - Human-friendly metrics: test paths, mental load, time to understand
- π Impact Analysis - Find all dependents before refactoring with risk assessment
``bash1. Install
npm install -g @liendev/lien
That's itβzero configuration needed. Lien auto-detects your project and indexes on first use.
$3
For cross-repository search across your organization, configure Qdrant:
`bash
Option 1: Global config file
mkdir -p ~/.lien
cat > ~/.lien/config.json < {
"backend": "qdrant",
"qdrant": {
"url": "http://localhost:6333",
"apiKey": "your-api-key"
}
}
EOFOption 2: Environment variables
export LIEN_BACKEND=qdrant
export LIEN_QDRANT_URL=http://localhost:6333
export LIEN_QDRANT_API_KEY=your-api-keyIndex your repos (orgId auto-detected from git remote)
lien index
`Note:
orgId is automatically extracted from your git remote URL. Cross-repo search requires all repos to share the same orgId.MCP Tools
Lien exposes 6 powerful tools via Model Context Protocol:
| Tool | Description |
|------|-------------|
|
semantic_search | Natural language code search (supports crossRepo with Qdrant) |
| find_similar | Find similar code patterns |
| get_files_context | Get file context with test associations |
| list_functions | List symbols by pattern |
| get_dependents | Impact analysis (what depends on this?) |
| get_complexity` | Tech debt analysis with human-friendly metrics |Lien tracks code complexity with intuitive outputs:
- π Test paths - Cyclomatic complexity as "needs ~X tests for full coverage"
- π§ Mental load - Cognitive complexity with nesting penalty
- β±οΈ Time to understand - Halstead effort as readable duration (~2h 30m)
- π Estimated bugs - Halstead prediction (Volume / 3000)
- Installation - npm, npx, or local setup
- Getting Started - Step-by-step configuration for Cursor or Claude Code
- Configuration - Customize indexing, thresholds, performance
- CLI Commands - Full command reference
- MCP Tools - Complete API reference for all 6 tools
- How It Works - Architecture overview
TypeScript β’ JavaScript β’ Vue β’ Python β’ PHP β’ Liquid β’ Go β’ Rust β’ Java β’ C/C++ β’ Ruby β’ Swift β’ Kotlin β’ C# β’ Scala β’ Markdown
Frameworks: Node.js, Laravel, Shopify (Liquid themes)
Contributions welcome! See CONTRIBUTING.md for guidelines.
- π Issues - Report bugs or request features
- π¬ Discussions - Ask questions and share ideas
AGPL-3.0 Β© Alf Henderson
Lien is free forever for local use. The AGPL license ensures that:
- β
You can use Lien locally without restrictions
- β
You can modify and distribute Lien freely
- β
Improvements get contributed back to the community
- β
We can sustain long-term development
For questions about licensing, contact us at alf@lien.dev
---
Made with β€οΈ for developers who value privacy and local-first tools.