Tenets
About
Offline MCP server that ranks & summarizes code using BM25, TF-IDF, embeddings & git signals; integrates with Cursor, Claude Desktop and Windsurf; privacy preserving.
Details
- Author
- jddunn
- Categories
- Developer Tools, Other, AI
Jump to
Setup
Install Tenets in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/jddunn/tenets
Follow the installation instructions in the repository README, then restart your MCP client.
Sessions & Guiding Principles (Tenets)
The killer feature: define guiding principles once, and they'reautomatically injected into every prompt.
# Create a working session tenets session create payment-feature # Add guiding principles (tenets) — these auto-inject into all prompts tenets tenet add "Always validate user inputs before database operations" --priority critical tenets tenet add "Use Decimal for monetary calculations, never float" --priority high tenets tenet add "Log all payment state transitions" --priority medium # Pin critical files (guaranteed inclusion in context) tenets session pin-file payment-feature src/core/payment.py # Instill tenets to the session tenets instill --session payment-feature # Now every distill automatically includes your tenets + pinned files tenets distill "add refund flow" --session payment-feature # Output includes: relevant code + your 3 guiding principles
Why this matters:In long AI conversations, context drifts. The AI forgets your coding standards. Tenets solve this by re-injecting your rules every time.
# Visualize architecture tenets viz deps --output architecture.svg # Dependency graph tenets viz deps --format html -o deps.html # Interactive HTML # Track development patterns tenets chronicle --since "last week" # Git activity tenets momentum --team # Sprint velocity # Analyze codebase tenets examine . --complexity --threshold 10 # Find complex code
ranking: algorithm: balanced # fast | balanced | thorough threshold: 0.1 use_git: true # Use git signals for relevance context: max_tokens: 100000 output: format: markdown copy_on_distill: true # Auto-copy to clipboard ignore: - vendor/ - '.generated.'
tenets employs a multi-layered approach optimized specifically for code understanding (but its core functionality could be applied to any field of document matching). It tokenizescamelCaseandsnake_caseidentifiers intelligently. Test files are excluded by default unless specifically mentioned in some way. Language-specific AST parsing for15+ languagesis included.
Deterministic algorithms inbalancedwork reliably and quickly meant to be used by default. BM25 scoring prevents biasing of files which may use redundant patterns (test files with which might have "response" referenced over and over won't necessarily dominate searches for "response").
The default ranking factors consist of: BM25 scoring (25% - statistical relevance preventing repetition bias), keyword matching (20% - direct substring matching), path relevance (15%), TF-IDF similarity (10%), import centrality (10%), git signals (10% - recency 5%, frequency 5%), complexity relevance (5%), and type relevance (5%).
When files exceed token budgets, tenets intelligently preserves:
- Function/class signatures
- Import statements
- Complex logic blocks
- Documentation and comments
- Recent changes
Semantic understand can be had with ML features:pip install tenets[ml]. Enable with--ml --rerankerflags or setuse_ml: trueanduse_reranker: truein config.
Inthoroughmode, sentence-transformer embeddings are enabled, andunderstandthatauthenticate()andlogin()are conceptually related for example, and thatpaymenteven has some crossover in relevancy (since these are typically associated together).
Optional cross-encoder neural re-rankingin this mode jointly evaluates query-document pairs with self-attention for superior accuracy.
A cross-encoder, for example, will correctly rank"DEPRECATED: We no longer implement oauth2"lower thanimplement_authorization_flow()for query"implement oauth2", understanding the negative context despite keyword matches.
Since cross-encoders process document-query pairs together (O(n²) complexity), they're much slower than bi-encoders and only used for re-ranking top K results.
- Full Documentation- Complete guide and API reference
- CLI Reference- All commands and options
- Configuration Guide- Detailed configuration options
- Architecture Overview- How tenets works internally
# Markdown (default, optimized for AI) tenets distill "implement OAuth2" --format markdown # Interactive HTML with search, charts, copy buttons tenets distill "review API" --format html -o report.html # JSON for programmatic use tenets distill "analyze" --format json | jq '.files[0]' # XML optimized for Claude tenets distill "debug issue" --format xml
from tenets import Tenets # Initialize tenets = Tenets() # Basic usage result = tenets.distill("implement user authentication") print(f"Generated {result.token_count} tokens") # Rank files without content from tenets.core.ranking import RelevanceRanker ranker = RelevanceRanker(algorithm="balanced") ranked_files = ranker.rank(files, prompt_context, threshold=0.1) for file in ranked_files[:10]: print(f"{file.path}: {file.relevance_score:.3f}")
Specialized analyzers for Python, JavaScript/TypeScript, Go, Java, C/C++, Ruby, PHP, Rust, and more. Configuration and documentation files are analyzed with smart heuristics for YAML, TOML, JSON, Markdown, etc.
Documentation·MCP Guide·Privacy·Terms
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
A fully-local MCP server for question-answering over your PDFs. Ask in plain language; Claude retrieves only the relevant passages with page citations. On-device embeddings (sentence-transformers) + ChromaDB — no API keys, nothing leaves your machine.
Private persistent memory for Claude, ChatGPT & Gemini via MCP — semantic search, zero-code setup.
An MCP server for web and similarity search, designed for Claude Desktop. It integrates with various external embedding and API services.
MCP server for Prompt Builder — search, retrieve, and compile prompt components from a community vault using semantic search (pgvector) and slug-based lookup. Works with Claude Desktop and Cursor.
A server providing web and similarity search functionalities, designed for Claude Desktop. It requires external embedding and API services.
Persistent visual cache for LLM-driven software development. Caches screenshots using perceptual hashing, vector search, and AX trees to prevent token overhead and visual hallucination loops.
next-devtools-mcp is a MCP server that provides Next.js development tools and utilities for AI coding assistants like Claude and Cursor.
A demonstration server for ActionKit, providing access to Slack actions via Claude Desktop.
An open-source MCP server that integrates with Google's Gemini AI. Requires a Google Gemini API key.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





