MCP Server¶
Tenets is a free, open source, 100% local MCP server that solves two critical problems for AI coding:
- Intelligent Code Context — NLP-powered ranking finds and aggregates the most relevant code automatically
- Automatic Guiding Principles — Your tenets (coding standards, rules) are injected into every prompt, preventing context drift
Integrates natively with Cursor, Claude Desktop, Windsurf, and custom AI agents.
Step-by-step guide for Cursor IDE
Configure Claude Desktop with Tenets
Get started in 30 seconds
Common questions answered
Learn more: Model Context Protocol Explained · Why Context Matters
Installation¶
Quick Start¶
Start the Server¶
# Default: stdio transport for local IDE integration
tenets-mcp
# SSE transport for web clients
tenets-mcp --transport sse --port 8080
# HTTP transport for remote deployment
tenets-mcp --transport http --port 8080
Verify Installation¶
Python 3.14 compatibility¶
- Use tenets >= 0.7.0 on Python 3.14 to avoid the prior import recursion in
tenets.core. - No extra flags needed; stdio/SSE/HTTP transports all work on 3.14+.
IDE Configuration¶
Claude Desktop¶
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
If you installed tenets in a virtual environment, use the full path:
Cursor¶
Add to your Cursor MCP settings (Settings → MCP Servers):
Windsurf / Codeium¶
Configure the MCP server in Windsurf settings:
VS Code with MCP Extension¶
If using an MCP extension for VS Code:
Available Tools¶
The MCP server exposes these tools to AI assistants:
Context Tools¶
| Tool | Description |
|---|---|
distill | Build ranked, token-optimized context from codebase (markdown/xml/json/html) |
rank_files | Rank files by relevance without full content (supports include/exclude patterns, test filters) |
Analysis Tools¶
| Tool | Description |
|---|---|
examine | Analyze codebase structure and complexity |
chronicle | Analyze git history and patterns |
momentum | Track development velocity |
Session Tools¶
| Tool | Description |
|---|---|
session_create | Create a development session |
session_list | List all sessions |
session_pin_file | Pin a file to a session |
session_pin_folder | Pin a folder to a session |
Tenet Tools¶
| Tool | Description |
|---|---|
tenet_add | Add a guiding principle |
tenet_list | List all tenets |
tenet_instill | Activate pending tenets |
set_system_instruction | Set system-level instruction |
Available Resources¶
Resources are read-only data the AI can access:
| Resource URI | Description |
|---|---|
tenets://sessions/list | All development sessions |
tenets://sessions/{name}/state | Specific session state |
tenets://tenets/list | All guiding principles |
tenets://config/current | Current configuration |
Available Prompts¶
Prompts are reusable templates for common tasks:
| Prompt | Description |
|---|---|
build_context_for_task | Build context for a development task |
code_review_context | Prepare context for code review |
understand_codebase | Generate codebase understanding |
Tool-to-Prompt Matrix¶
Common development tasks and which tools to use:
| Task | Tool(s) | Example Prompt |
|---|---|---|
| Find relevant code | distill | "Find code related to payment processing" |
| Quick file scan | rank_files | "Which files are most relevant to auth?" |
| Code review | distill + chronicle | "Review recent changes to the API" |
| Onboarding | examine + distill | "Help me understand this codebase" |
| Feature planning | distill + session_create | "I'm building a new feature for X" |
| Refactoring | distill + rank_files | "Find all usages of deprecated function" |
| Bug investigation | chronicle + distill | "Find changes that could cause issue X" |
| Track velocity | momentum | "Show development activity this week" |
Example Usage¶
Once configured, ask your AI assistant:
"Use tenets to find relevant files for implementing user authentication"
The AI will call the distill tool and return ranked, optimized context.
"Create a session called 'auth-feature' and pin the auth folder"
The AI will use session_create and session_pin_folder.
"Add a tenet: Always validate user input before processing"
The AI will use tenet_add to create a guiding principle.
Tool Responses (Examples)¶
distill¶
{
"context": "# File: src/auth.py\n...",
"token_count": 45000,
"files": ["src/auth.py", "src/user.py"],
"files_summarized": ["src/utils.py"],
"metadata": {"mode": "balanced", "total_scanned": 150}
}
rank_files¶
{
"files": [
{"path": "src/auth.py", "score": 0.85},
{"path": "src/user.py", "score": 0.72}
],
"total_scanned": 150,
"mode": "balanced"
}
session_create¶
Error Semantics¶
Tenets returns clear errors that AI agents can act on:
- Path errors (missing or inaccessible):
- Distill/Rank will raise an error or return an empty result — agents should retry with a valid path.
- Invalid parameters (mode/format):
- MCP validation prevents tool invocation; agents should correct parameters based on schema.
- Session operations:
- Pinning a nonexistent file returns a structured failure response; agents should prompt to confirm the path.
When in doubt, agents should: 1) Validate inputs against the tool schema, and 2) Ask the user to clarify scope (path, include/exclude patterns, session name).
Remote Deployment¶
For team or cloud deployment, use HTTP transport:
Configure clients to connect:
Programmatic Usage¶
from tenets.mcp import create_server
# Create and run server
server = create_server()
server.run(transport="stdio")
# Or with custom config
from tenets.config import TenetsConfig
config = TenetsConfig(max_tokens=150000)
server = create_server(config=config)
server.run(transport="http", port=8080)
Configuration¶
MCP settings can be added to .tenets.yml:
mcp:
enabled: true
# Tool availability
tools:
distill: true
rank_files: true
examine: true
chronicle: true
momentum: true
session: true
tenet: true
Troubleshooting¶
Server not starting¶
- Verify MCP dependencies:
pip install tenets[mcp] - Check Python version: requires 3.9+
- Try verbose mode:
tenets-mcp --verbose
IDE not connecting¶
- Restart the IDE after configuration changes
- Check the server is running:
tenets-mcp --version - Verify the command path is correct in IDE settings
- Check IDE logs for MCP connection errors
Tools not appearing¶
- Ensure MCP server is running
- Refresh MCP connection in IDE
- Check server logs for initialization errors
MCP Discovery & Marketplaces¶
How AI Assistants Find MCP Servers¶
MCP servers are discovered through configuration files. Each AI assistant has its own configuration format:
| Assistant | Config Location | Format |
|---|---|---|
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) | JSON |
| Cursor | Settings → MCP Servers | JSON |
| VS Code + MCP Extension | .vscode/settings.json or workspace settings | JSON |
Publishing to MCP Directories¶
To make tenets discoverable by other developers:
1. Official MCP Server Registry¶
Submit to the MCP Servers Directory:
# Fork and clone the servers repository
git clone https://github.com/modelcontextprotocol/servers.git
# Add your server to the README
# Submit a pull request
2. Awesome MCP Lists¶
Submit to community-curated lists: - awesome-mcp - Community curated - mcp-directory - Searchable directory
3. Package Managers¶
Tenets is available via pip, making it easy to install:
Local Development Setup¶
For developers working on tenets locally:
# Clone the repository
git clone https://github.com/jddunn/tenets.git
cd tenets
# Install in development mode with MCP support
pip install -e ".[mcp,dev]"
# Run the MCP server
tenets-mcp
Registering with IDEs Automatically¶
Some IDEs support automatic MCP server discovery through package metadata.
pyproject.toml Entry Point¶
Tenets registers an entry point that MCP-aware tools can discover:
Manual Registration¶
If automatic discovery isn't available, add to your IDE config:
Claude Desktop (macOS):
Cursor: 1. Open Settings (⌘ + ,) 2. Navigate to MCP Servers 3. Add new server with command tenets-mcp
Verifying Installation¶
After configuration, verify the server is recognized:
- Restart your IDE after config changes
- Check server status in IDE's MCP panel
- Test a tool call: Ask "Use tenets to rank files for authentication"
Distributing to Teams¶
For team deployment, create a shared configuration:
{
"mcpServers": {
"tenets": {
"command": "tenets-mcp",
"env": {
"TENETS_MAX_TOKENS": "150000",
"TENETS_RANKING_ALGORITHM": "balanced"
}
}
}
}
Share this configuration file with your team for consistent setup.
Enterprise Features¶
The following features are available with enterprise support:
- Privacy Redaction: Automatically strip API keys, credentials, and PII
- Anonymization: Remove author information for compliance
- Custom ML Models: Fine-tuned models for your codebase
- SSO/SAML: Enterprise authentication
- Audit Logging: Compliance tracking
- Air-gapped Deployment: Offline operation support
Contact us for enterprise inquiries.
Related Resources¶
- Cursor MCP Setup Guide — Detailed Cursor configuration
- Claude Desktop MCP Guide — Configure Claude Desktop
- Quick Start — Get started in 30 seconds
- CLI Reference — Command-line interface documentation
- FAQ — Frequently asked questions
- Model Context Protocol Explained — Technical deep dive into MCP
- Why Context Matters — The importance of intelligent context