Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/consiliency/code-index-mcp/ai-integrationgit clone --depth 1 https://github.com/Consiliency/Code-Index-MCPWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00685 | $0.00685 |
| Opus 5 | $0.00342 | $0.00342 |
| Sonnet 5 | $0.00137 | $0.00137 |
| Haiku 4.5 | $0.00068 | $0.00068 |
Grade A, and why
ai-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AI Integration Rules for Code-Index-MCP
Overview
This file defines rules and guidelines for AI integration within the Code-Index-MCP project, including embedding services, language models, and semantic search capabilities.
Embedding Services
Voyage AI Integration
- Purpose: Generate code embeddings for semantic search
- Configuration: API key required in environment variables
- Fallback: Local embedding generation if API unavailable
- Caching: Embeddings should be cached locally to reduce API calls
Implementation Guidelines
# Use the semantic_indexer utility
from mcp_server.utils.semantic_indexer import SemanticIndexer
# Initialize with API key
indexer = SemanticIndexer(api_key=os.getenv("VOYAGE_AI_API_KEY"))
# Generate embeddings with caching
embeddings = indexer.get_embeddings(code_snippet, use_cache=True)
Language Model Integration
MCP Protocol
- Purpose: Provide code intelligence to Claude and other LLMs
- Tools: Symbol lookup, code search, definition finding
- Response Format: Structured JSON with location references
Best Practices
- Batch Processing: Group embedding requests to minimize API calls
- Error Handling: Gracefully fall back to fuzzy search on API failures
- Rate Limiting: Respect API rate limits with exponential backoff
- Security: Never log or expose API keys
Semantic Search
Hybrid Approach
- Combine lexical search (fuzzy matching) with semantic search
- Weight results based on confidence scores
- Provide context-aware code suggestions
Query Processing
# Example hybrid search implementation
def hybrid_search(query: str, weights: Dict[str, float] = None):
weights = weights or {"lexical": 0.4, "semantic": 0.6}
# Lexical search using fuzzy indexer
lexical_results = fuzzy_indexer.search(query)
# Semantic search using embeddings
semantic_results = semantic_indexer.search(query)
# Combine and rank results
return combine_results(lexical_results, semantic_results, weights)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 102 lines · 685 tokens per session scan A 9fa9ed5f03d2
ai-integration is a cursor rule published in the GitHub repository Consiliency/Code-Index-MCP (57 stars, last pushed 1mo ago), licensed MIT. It adds 685 tokens to every session, about $0.0034 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.