MCP server for context that feeds your prompts
100% local NLP-powered code ranking for AI coding assistants
pip install tenets[mcp] BM25 + TF-IDF + import graphs find the right files automatically.
Native MCP for Cursor, Claude Desktop, Windsurf.
Your code never leaves your machine.
Quick Setup
One install, one config — context that feeds your prompts
pip install tenets[mcp]~/.cursor/mcp.json:{
"mcpServers": {
"tenets": {
"command": "tenets-mcp"
}
}
}pip install tenets[mcp]claude_desktop_config.json:{
"mcpServers": {
"tenets": {
"command": "tenets-mcp"
}
}
}Config location → macOS: ~/Library/Application Support/Claude/ · Windows: %APPDATA%\Claude\
pip install tenets[mcp]{
"mcpServers": {
"tenets": {
"command": "tenets-mcp"
}
}
}✓ Restart your IDE — tenets tools are now available
🔌 Native MCP Integration
Model Context Protocol is Anthropic's open standard for AI tool connectivity. Tenets is a local MCP server — your AI assistant calls it directly to get intelligent code context.
🧠 NLP-Powered Ranking
Other MCP servers give raw file access. Tenets uses NLP analysis — BM25, TF-IDF, keyword extraction, import graphs — to find and rank the most relevant code for any task.
🔒 100% Local Processing
Everything runs on your machine. No cloud APIs, no data leaving your computer, no API keys for core features. Your codebase stays completely private.
See It In Action
$ tenets distill "add mistral api to summarizer" --format html

$ tenets rank "fix summarizing truncation bug" --tree
$ tenets examine . --complexity --hotspots --ownership
$ tenets examine . --show-details --hotspots --format html
$ tenets session create payment-integration
$ tenets tenet add "Always validate user input" --priority critical --category security
$ tenets tenet add "Use type hints in Python" --priority high --category style
$ tenets instill --session payment-integration
$ tenets system-instruction set "Prefer small, safe diffs and add tests" --enable
$ tenets distill "add OAuth2 refresh tokens" --session payment-integration --remove-comments --condense


$ tenets momentum --team --since "last month" --detailed
$ tenets viz deps --format html --output interactive.html
Core Features
Intelligent Context Building
Multi-factor ranking algorithm that goes beyond keyword matching. Analyzes code structure, import relationships, Git history, and semantic meaning to surface exactly the files you need for any development task.
- Multi-Factor Ranking: Keywords, structure, imports, path relevance, and Git signals
- Optional ML: Semantic embeddings and transformers when
tenets[ml]is installed - Summarization: Rules-based and ML summarizers built-in; LLMs only if API keys enabled
- Token Optimization: Budget-aware packing and model-specific token counting
- Lightweight Extras: Extras-based dependency architecture keeps core lean
Code Quality Metrics & Evaluation
Comprehensive evaluation system that assesses code quality, identifies hotspots, tracks technical debt, and provides actionable insights. Use tenets not just for prompting but for continuous code quality monitoring and improvement.
- Complexity Analysis: Cyclomatic, cognitive, and Halstead metrics
- Quality Evaluation: Maintainability index and code health scoring
- Technical Debt Tracking: Identify and prioritize refactoring needs
- Test Coverage Analysis: Find untested code paths and improve reliability
- Code Pattern Detection: Identify anti-patterns and best practices
Stateful Prompting & Tenets
Build complex features iteratively with persistent sessions. Define guiding principles (tenets) that shape how AI understands your codebase. Perfect for ongoing conversations with AI assistants and maintaining context across multiple prompts.
- Persistent Context: Maintain state across multiple CLI invocations
- Guiding Tenets: Define principles that guide AI interactions
- Incremental Building: Add context without starting over each time
- Session Branching: Explore alternatives without losing work
- SQLite Storage: Reliable local session persistence and history
Development Intelligence & Insights
Track velocity, identify bottlenecks, and understand team patterns. Visualize your architecture, monitor code evolution, and make data-driven decisions about refactoring, technical debt, and resource allocation.
- Velocity Tracking: Monitor team and individual productivity metrics
- Hotspot Analysis: Find frequently changing and problematic areas
- Dependency Visualization: Understand architecture and coupling
- Contributor Analytics: Track code ownership and expertise
- Trend Analysis: Monitor quality and velocity changes over time
How the NLP Pipeline Works
Input
Natural language prompt
or specific query
Scan
Parallel file discovery
respecting .gitignore
Analyze
Language analyzers & AST
structure and metrics
Rank
Multi-factor scoring
keywords, structure, git
ML (Optional)
Embeddings & semantic
similarity when enabled
Tenets Injection
Inject guiding principles
maintain consistency
Summarize & Output
Token budgeting & summaries
LLMs optional via API keys
Installation Options
Local MCP Server
pip install tenets[mcp]Context that feeds your prompts
Core Only
pip install tenetsCLI + Python library (no MCP)
Everything
pip install tenets[all]MCP + ML + visualization
Docker
# Official Docker commands are coming soonOfficial Docker image and compose examples coming soon