Setting Up Tenets MCP Server: Complete Guide¶
Author: Johnny Dunn | Date: December 4, 2024
Overview¶
Tenets is a local MCP server with two core capabilities:
- Intelligent code context — NLP-powered ranking finds relevant files automatically
- Automatic tenets injection — Your guiding principles are included in every prompt
This guide covers installation, configuration, and verification for all major MCP hosts.
Time required: 5-10 minutes
Prerequisites¶
Python Environment¶
Tenets requires Python 3.9+:
pip Package Manager¶
MCP-Compatible Host¶
One of: - Cursor (native MCP support) - Claude Desktop (macOS, Windows) - Windsurf (MCP extension) - VS Code with Continue or MCP extension
Installation¶
Standard Installation¶
This installs: - tenets CLI and Python library - tenets-mcp server binary - MCP protocol dependencies (mcp, httpx)
Verify Installation¶
tenets-mcp --version
# tenets-mcp v0.7.x
which tenets-mcp
# /usr/local/bin/tenets-mcp (or your Python bin path)
Save this path—you'll need it for configuration.
Optional: ML Features¶
For semantic embeddings (slower but more accurate):
Adds sentence-transformers for embedding-based ranking.
Cursor Configuration¶
Cursor has native MCP support. Configuration lives in ~/.cursor/mcp.json.
Step 1: Create/Edit Config¶
Step 2: Add Tenets Server¶
Minimal configuration:
With full path (recommended for reliability):
With environment variables:
{
"mcpServers": {
"tenets": {
"command": "tenets-mcp",
"env": {
"TENETS_LOG_LEVEL": "DEBUG",
"TENETS_CACHE_DIR": "/tmp/tenets-cache"
}
}
}
}
Step 3: Restart Cursor¶
Fully quit and reopen Cursor (not just reload window).
Step 4: Verify¶
In Cursor's AI chat:
You should see distill, rank_files, examine, etc.
Claude Desktop Configuration¶
macOS¶
Config path: ~/Library/Application Support/Claude/claude_desktop_config.json
# Create directory
mkdir -p ~/Library/Application\ Support/Claude
# Create/edit config
nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
Configuration:
Windows¶
Config path: %APPDATA%\Claude\claude_desktop_config.json
Configuration:
{
"mcpServers": {
"tenets": {
"command": "C:\\Users\\YourName\\AppData\\Local\\Programs\\Python\\Python311\\Scripts\\tenets-mcp.exe"
}
}
}
Find your path:
Restart Claude Desktop¶
Quit and reopen the application.
Windsurf Configuration¶
Windsurf uses VS Code-style settings with MCP extension.
Step 1: Open Settings¶
Cmd/Ctrl + , → Search "MCP"
Step 2: Edit JSON¶
Step 3: Restart¶
Reload Windsurf window.
VS Code with Continue¶
Continue extension provides MCP support for VS Code.
Step 1: Install Continue¶
Install from VS Code marketplace.
Step 2: Configure MCP¶
Open Continue settings and add:
Advanced Configuration¶
Project-Specific Servers¶
Run different Tenets instances for different projects:
{
"mcpServers": {
"tenets-frontend": {
"command": "tenets-mcp",
"args": ["--path", "/home/user/projects/frontend"]
},
"tenets-backend": {
"command": "tenets-mcp",
"args": ["--path", "/home/user/projects/backend"]
},
"tenets-infra": {
"command": "tenets-mcp",
"args": ["--path", "/home/user/projects/infrastructure"]
}
}
}
Debug Mode¶
Enable verbose logging:
{
"mcpServers": {
"tenets": {
"command": "tenets-mcp",
"env": {
"TENETS_LOG_LEVEL": "DEBUG"
}
}
}
}
Custom Config File¶
Point to a specific .tenets.yml:
{
"mcpServers": {
"tenets": {
"command": "tenets-mcp",
"env": {
"TENETS_CONFIG": "/path/to/.tenets.yml"
}
}
}
}
Verification¶
Test 1: Tool Discovery¶
Ask your AI:
Expected response: - distill — Build optimized code context - rank_files — Preview file relevance scores - examine — Analyze codebase structure - session_create, session_pin_file, etc.
Test 2: Basic Distill¶
Expected: The AI calls distill and returns ranked code context.
Test 3: Examine Codebase¶
Expected: Structure analysis with file counts, languages, complexity.
Test 4: Session Creation¶
Expected: Confirmation of session creation.
Troubleshooting¶
"Command not found"¶
Cause: Shell can't find tenets-mcp binary.
Fix: Use absolute path:
# Find the path
which tenets-mcp
# /home/user/.local/bin/tenets-mcp
# Use in config
{
"mcpServers": {
"tenets": {
"command": "/home/user/.local/bin/tenets-mcp"
}
}
}
"Server not responding"¶
Cause: Server crashes on startup.
Debug:
# Run manually to see errors
tenets-mcp
# Check for Python errors
python -c "import tenets; print(tenets.__version__)"
Common fixes:
# Upgrade to latest
pip install tenets[mcp] --upgrade
# Reinstall
pip uninstall tenets && pip install tenets[mcp]
"Tools not appearing"¶
Cause: Config not loaded or JSON syntax error.
Debug:
- Validate JSON syntax: https://jsonlint.com
- Check config file path is correct
- Fully restart application (not just reload)
"Permission denied"¶
Cause: Binary not executable.
Fix:
Server Hangs on Large Codebases¶
Cause: Scanning too many files.
Fix: Add excludes to .tenets.yml:
Server Logs¶
Enable Debug Logging¶
{
"mcpServers": {
"tenets": {
"command": "tenets-mcp",
"env": {
"TENETS_LOG_LEVEL": "DEBUG"
}
}
}
}
Manual Server Testing¶
# Run server and send test request
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | tenets-mcp
Log File Location¶
Logs write to stderr by default. Capture them:
Performance Tuning¶
For Large Codebases (>10k files)¶
# .tenets.yml
scanner:
max_files: 5000 # Limit scan
exclude:
- "*.generated.*"
- vendor/
- third_party/
ranking:
algorithm: fast # Use faster mode by default
For Slow Machines¶
Next Steps¶
Now that Tenets is configured:
- Try distill: Ask your AI to find code for a specific task
- Create sessions: Pin files you reference repeatedly
- Add tenets: Define guiding principles (coding standards, architecture rules) that auto-inject into every prompt
- Explore modes: Test
fastvsbalancedvsthorough
The combination of intelligent context + automatic tenets injection helps maintain consistency across long conversations where context would otherwise drift.
Resources¶
- MCP Documentation — Full tool reference
- CLI Reference — Command-line usage
- Configuration Guide — All config options
- Architecture — How Tenets works