{
  "markdown": "<div align=\"center\">\n<img src=\"https://github.com/user-attachments/assets/699c0a3f-dfae-4e14-81db-c8ba970d9a35\">\n\n# CICADA\n\nmcp-name: io.github.wende/cicada\n\n### **C**ode **I**ntelligence: **C**ontextual **A**nalysis, **D**iscovery, and **A**ttribution\n\n**Context compaction for AI code assistants** – Give your AI structured, token-efficient access to 17+ languages including Elixir, Python, TypeScript, JavaScript, Rust, and more.\n\n> [**Up to 50% less waiting · Up to 70% less tokens · Up to 99% less explanations to do**](https://cicada-mcp.vercel.app/#benchmark-section)\n> **Tighter context = Better Quality**\n\n[![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![codecov](https://codecov.io/gh/wende/cicada/branch/main/graph/badge.svg)](https://codecov.io/gh/wende/cicada)\n[![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io)\n\n[![Elixir Support](https://img.shields.io/badge/Elixir-✓-blueviolet.svg)](https://elixir-lang.org/)\n[![Python Support](https://img.shields.io/badge/Python-✓-blue.svg)](https://www.python.org/)\n[![TypeScript Support](https://img.shields.io/badge/TypeScript-✓-blue.svg)](https://www.typescriptlang.org/)\n[![JavaScript Support](https://img.shields.io/badge/JavaScript-✓-yellow.svg)](https://www.javascript.com/)\n[![Rust Support](https://img.shields.io/badge/Rust-✓-orange.svg)](https://www.rust-lang.org/)\n[![+12 More](https://img.shields.io/badge/Languages-17+_Total-green.svg)](#)\n\n[![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cicada&config=eyJjb21tYW5kIjoidXZ4IGNpY2FkYS1tY3AgLiJ9)\n\n[Quick Install](#quick-install) · [Security](#privacy--security) · [Developers](#for-developers) · [AI Assistants](#for-ai-assistants) · [Docs](#documentation)\n\n</div>\n\n---\n\n## Why CICADA?\n\n**The core problem:** AI code assistants [waste context on blind searches](https://www.youtube.com/live/xmbSQz-PNMM?t=2402). Grep dumps entire files when you only need a function signature, leaving less room for actual reasoning.\n\n### The Context Compaction Approach\n\nInstead of raw text dumps, CICADA gives your AI **structured, pre-indexed knowledge**:\n\n| Traditional Search | CICADA |\n|-------------------|--------|\n| Grep dumps entire files | Returns only signatures + call sites |\n| Misses aliased imports | Tracks all reference types |\n| No semantic understanding | Keyword search finds `verify_credentials` when you ask for \"authentication\" |\n\n\n### What You Get\n\n- **AST-level indexing** – Module/function/class definitions with signatures, specs, docs\n- **17+ language support** – Elixir, Python, TypeScript, JavaScript, Rust, Go, Java, Kotlin, Scala, C/C++, Ruby, C#, Visual Basic, Dart, PHP, Erlang (beta)\n- **Complete call-site tracking** – Aliases, imports, dynamic references across all supported languages\n- **Semantic search** – Find code by concept with keyword extraction or embeddings (Ollama integration)\n- **Git + PR attribution** – Surface *why* code exists, not just what\n- **Dependency analysis** – Bidirectional tracking (what calls this, what does this call)\n- **Automatic language detection** – Works seamlessly across polyglot codebases\n\n---\n\n## Install\n\n```bash\n# 1. Install uv (if needed)\n# curl -LsSf https://astral.sh/uv/install.sh | sh\nuv tool install cicada-mcp\n\n# In your repo\ncicada claude   # or: cicada cursor, cicada vs, cicada gemini, cicada codex, cicada opencode, cicada zed\n```\n\n<div align=\"left\">\n<summary><strong>Try before installing permanently</strong></summary>\nRuns CICADA on demand (worse indexing quality, but zero install).\n\n```bash\nuvx cicada-mcp claude   # or cursor, vs\n```\nor\n\n```\nclaude mcp add cicada uvx cicada-mcp\n```   \n```\ngemini mcp add cicada uvx cicada-mcp\n```  \n```\ncodex mcp add cicada uvx cicada-mcp\n```  \n```\nkimi mcp add --transport stdio cicada -- cicada-mcp\n```  \n\n\nUses your editor's built-in MCP management to install CICADA.\n\n</details>\n</div>\n\n**Available commands after installation:**\n- `cicada [claude|cursor|vs|gemini|codex|opencode|zed]` - One-command interactive setup per project\n- `cicada-mcp` - MCP server (auto-started by editor)\n- `cicada serve` - Start REST API server for HTTP access to all MCP tools\n- `cicada status` - Show index status, PR index, link status, agent files, MCP configs\n- `cicada stats [repo]` - Display usage statistics (tool calls, tokens, execution times)\n- `cicada watch` - Watch for file changes and automatically reindex\n- `cicada index` - Re-index code with custom options (`-f/--force`, `--keywords`, `--embeddings`, `--watch`)\n- `cicada index-pr` - Index pull requests for PR attribution\n- `cicada run [tool]` - Execute any of the 7 MCP tools directly from CLI\n- `cicada agents install` - Install Claude Code agents to `./.claude/` directory\n- `cicada link [parent_dir]` - Links current repository to an existing index\n- `cicada clean` - Completely removes cicada integration from your folder as well as all settings\n\nAsk your assistant:\n```\n# Elixir\n\"Show me the functions in MyApp.User\"\n\"Where is authenticate/2 called?\"\n\n# Python\n\"Show me the AuthService class methods\"\n\"Where is login() used in the codebase?\"\n\n# Both languages\n\"Find code related to API authentication\"\n```\n\n---\n\n## Privacy & Security\n\n- **100% local:** parsing + indexing happen on your machine; no external access.\n- **No telemetry:** CICADA doesn't collect usage or any telemetry.\n- **Read-only tools:** MCP endpoints only read the index; they can't change your repo.\n- **Optional GitHub access:** PR features rely on `gh` and your existing OAuth token.\n- **Data layout:**\n  ```\n  ~/.cicada/projects/<repo_hash>/\n  ├─ index.json      # modules, functions, call sites, metadata\n  ├─ config.yaml     # indexing options + mode\n  ├─ hashes.json     # incremental indexing cache\n  └─ pr_index.json   # optional PR metadata + reviews\n  ```\n  Your repo only gains an editor config (`.mcp.json`, `.cursor/mcp.json`, `.vscode/settings.json`, `.gemini/settings.json`, `.codex/mcp.json`, or `.opencode.json`).\n\n---\n\n## For Developers\n\n> Wire CICADA into your editor once, and every assistant session inherits the context.\n\n### Install & Configure\n\n```bash\ncd /path/to/project\ncicada claude   # or cicada cursor / cicada vs / cicada gemini / cicada codex / cicada opencode / cicada zed\n```\n\n### Enable PR Attribution (optional)\n\n```bash\nbrew install gh    # or apt install gh\ngh auth login\ncicada index-pr .     # incremental\ncicada index-pr . --clean   # full rebuild\n```\n\nUnlocks questions like \"Which PR introduced line 42?\" or \"What did reviewers say about `billing.ex`?\"\n\n### Automatic Re-indexing with Watch Mode\n\nEnable automatic reindexing when files change by starting the MCP server with the `--watch` flag:\n\n** .mcp.json**\n```json\n{\n  \"mcpServers\": {\n    \"cicada\": {\n      \"command\": \"cicada-mcp\",\n      \"args\": [\"--watch\"],\n      \"env\": {\n        \"CICADA_CONFIG_DIR\": \"/home/user/.cicada/projects/<hash>\"\n      }\n    }\n  }\n}\n```\nWhen watch mode is enabled:\n- A separate process monitors `.ex`, `.exs` (Elixir) and `.py` (Python) files for changes\n- Changes are automatically reindexed (incremental, fast)\n- 2-second debounce prevents excessive reindexing during rapid edits\n- The watch process stops automatically when the MCP server stops\n- Excluded directories: `deps`, `_build`, `node_modules`, `.git`, `assets`, `priv`, `.venv`, `venv`\n\n### CLI Cheat Sheet\n\n**Note:** Language detection is automatic – CICADA detects Elixir (mix.exs) and Python (pyproject.toml) projects automatically.\n\n| Command | Purpose | Run When |\n|---------|---------|---------|\n| `cicada claude` | Configure MCP + incremental re-index | First setup, after local changes |\n| `cicada status` | Check index health, link status, agent files | After setup, troubleshooting |\n| `cicada stats` | View usage statistics and token metrics | Monthly reviews, optimization |\n| `cicada watch` | Monitor files and auto-reindex on changes | During active development |\n| `cicada index --keywords .` | Rebuild with keyword indexing | After large refactors or enabling keywords mode |\n| `cicada index --embeddings .` | Rebuild with embeddings (semantic search) | When you want Ollama-powered semantic analysis |\n| `cicada index-pr .` | Sync PR metadata/reviews | After new PRs merge |\n\n### Troubleshooting\n\n<details>\n<summary><b>\"Index file not found\"</b></summary>\n\nRun the indexer first:\n```bash\ncicada index /path/to/project\n```\n\nEnsure indexing completed successfully. Check for `~/.cicada/projects/<hash>/index.json`.\n\n</details>\n\n<details>\n<summary><b>\"Module not found\"</b></summary>\n\nUse the exact module name as it appears in code (e.g., `MyApp.User`, not `User`).\n\nIf module was recently added, re-index:\n```bash\ncicada index .\n```\n\n</details>\n\n<details>\n<summary><b>MCP Server Won't Connect</b></summary>\n\n**Troubleshooting checklist:**\n\n1. **Verify configuration file exists:**\n   ```bash\n   # For Claude Code\n   ls -la .mcp.json\n\n   # For Cursor\n   ls -la .cursor/mcp.json\n\n   # For VS Code\n   ls -la .vscode/settings.json\n   ```\n\n2. **Check paths are absolute:**\n   ```bash\n   cat .mcp.json\n   # Should contain: /absolute/path/to/project\n   # Not: ./project or ../project\n   ```\n\n3. **Ensure index exists:**\n   ```bash\n   ls -la ~/.cicada/projects/\n   # Should show directory for your project\n   ```\n\n4. **Restart editor completely** (not just reload window)\n\n5. **Check editor MCP logs:**\n   - Claude Code: --debug\n   - Cursor: Settings → MCP → View Logs\n   - VS Code: Output panel → MCP\n\n</details>\n\n<details>\n<summary><b>PR Features Not Working</b></summary>\n\n**Setup GitHub CLI:**\n```bash\n# Install GitHub CLI\nbrew install gh  # macOS\nsudo apt install gh  # Ubuntu\n# or visit https://cli.github.com/\n\n# Authenticate\ngh auth login\n\n# Index PRs\ncicada index-pr\n```\n\n**Common issues:**\n- \"No PR index found\" → Run `cicada index-pr .`\n- \"Not a GitHub repository\" → Ensure repo has GitHub remote\n- Slow indexing → First-time indexing fetches all PRs; subsequent runs are incremental\n- Rate limiting → GitHub API has rate limits; wait and retry if you hit limits\n\n**Force rebuild:**\n```bash\ncicada index-pr --clean\n```\n\n</details>\n\n<details>\n<summary><b>Keyword Search Not Working</b></summary>\n\n**Error:** \"Keyword search not available\"\n\n**Cause:** Index was built without keyword extraction.\n\n**Solution:**\n```bash\n# Re-index with keyword extraction\ncicada index .  # or --keywords\n```\n\n**Verify:**\n```bash\ncat ~/.cicada/projects/<hash>/config.yaml\n# Should show:\n# indexing:\n#   mode: keywords\n```\n\n</details>\n\nMore detail: [PR Indexing](codebook/tasks/202511192143-PR_INDEXING.md), [Incremental Indexing](codebook/tasks/202512251907-INCREMENTAL_INDEXING.md).\n\n<details>\n<summary><b>Python Indexing</b></summary>\n\n**Requirements:**\n- Node.js (for scip-python indexer)\n- Python project with pyproject.toml\n\n**First-time setup:**\nCICADA automatically installs scip-python via npm on first index. This may take a minute.\n\n**Known limitations (Beta):**\n- First indexing may be slower than Elixir (SCIP generation step)\n- Large virtual environments (.venv) are automatically excluded\n- Some dynamic Python patterns may not be captured\n\n**Performance tips:**\n```bash\n# Ensure .venv is excluded\necho \"/.venv/\" >> .gitignore\n\n# Use keywords mode for quickest indexing\ncicada index --keywords .\n```\n\n**Report issues:** [GitHub Issues](https://github.com/wende/cicada/issues) with \"Python\" label\n\n</details>\n\n---\n\n## For AI Assistants\n\nCICADA ships 7 focused MCP tools designed for efficient code exploration across Elixir, Python, and Erlang codebases.\n\n### 🧭 Which Tool Should You Use?\n\n| Need | Tool | Notes |\n|------|------|-------|\n| **Start exploring** | `query` | **🚀 START HERE** - Smart discovery with keywords/patterns + filters (scope, recent, path) |\n| View a module's complete API | `search_module` | Functions, signatures, specs, docs. Use `what_calls_it`/`what_it_calls` for bidirectional analysis |\n| Find where a function is used | `search_function` | Definition + all call sites. Supports wildcards (`*`) and OR (`\\|`) patterns |\n| Track git history | `git_history` | Unified tool: blame, commits, PRs, function evolution (replaces 4 legacy tools) |\n| Drill down into results | `expand_result` | Auto-expands modules or functions from query results |\n| Advanced index queries | `query_jq` | Custom jq queries for power users |\n\n**Want to see these tools in action?** Check out [Complete Workflow Examples](codebook/WORKFLOWS.md) with pro tips and real-world scenarios.\n\n### Core Tools\n\n**`query`** - Smart code discovery (your starting point)\n- Automatically detects keywords vs patterns\n- Filters: `scope` (public/private), `recent` (last 14 days), `filter_type` (modules/functions), `match_source` (docs/strings)\n- Returns snippets with smart next-step suggestions\n- Use `path_pattern` to filter by location\n\n**`search_module`** - Deep module analysis\n- View complete API: functions, signatures, specs, docs\n- For Python: Shows classes with method counts and signatures\n- For Elixir: Shows functions with arity notation\n- Bidirectional analysis:\n  - `what_calls_it=true` → See who uses this module (impact analysis)\n  - `what_it_calls=true` → See what this module depends on\n- Supports wildcards (Elixir: `MyApp.*`, Python: `api.handlers.*`) and OR patterns (`MyApp.User|MyApp.Post`)\n- Filter by visibility (public/private/all)\n\n**`search_function`** - Function usage tracking\n- Find definitions and all call sites\n- `what_calls_it=true` (default) → See all callers\n- `what_it_calls=true` → See all dependencies\n- Include code examples with `include_usage_examples=true`\n- Filter by `usage_type`: source, tests, or all\n\n### Git History (Unified Tool)\n\n**`git_history`** - All git operations in one tool\n- **Single line**: `git_history(\"file.ex\", start_line=42)` → blame + PR\n- **Line range**: `git_history(\"file.ex\", start_line=40, end_line=60)` → grouped blame\n- **Function tracking**: `git_history(\"file.ex\", function_name=\"create_user\")` → evolution\n- **File history**: `git_history(\"file.ex\")` → all PRs/commits\n- Time filtering: `recent=true` (14d), `recent=false` (>14d), `recent=null` (all)\n- Author filtering: `author=\"john\"`\n- Automatic PR index integration when available\n\n### Additional Tools\n\n**`expand_result`** - Drill down from query results\n- Auto-detects module vs function\n- Shows complete details with usage examples\n- Configure what to include: code, dependencies, callers\n- Convenient wrapper around search_module and search_function\n\n**`query_jq`** - Advanced index queries\n- Direct jq queries against the index\n- Schema discovery with `| schema`\n- Compact (default) or pretty output\n- Sample mode for large results\n\nDetailed parameters + output formats: [MCP_TOOLS_REFERENCE.md](MCP_TOOLS_REFERENCE.md).\n\n### Token-Friendly Responses\n\nAll tools return structured Markdown/JSON snippets (signatures, call sites, PR metadata) instead of full files, keeping prompts lean.\n\n**New in v0.5.1:** All tools now use compact output by default to minimize token usage. Use `verbose=true` for detailed output with full docs and specs.\n\n---\n\n\n---\n\n## Documentation\n\n- **[Codebook](codebook/README.md)** – Complete feature reference and user guides\n- **[Workflows](codebook/WORKFLOWS.md)** – Real-world examples chaining tools together\n- **[Installation](codebook/INSTALLATION.md)** – Step-by-step setup for all editors\n- **[Contributing](CONTRIBUTING.md)** – Development guidelines and architecture\n- [CHANGELOG.md](CHANGELOG.md) – Release notes\n\n**Deep Dives:**\n- [Keyword Extraction Analysis](codebook/RandD/202511052055-KEYWORD_EXTRACTION_ANALYSIS.md) – Semantic search internals\n- [PR Indexing](codebook/tasks/202511192143-PR_INDEXING.md) – GitHub integration details\n- [MCP Tool Call Benchmarking](codebook/RandD/202511052055-MCP_TOOL_CALL_BENCHMARKING.md) – Token/time benchmarks\n- [Tool Discoverability](codebook/RandD/202512242110-TOOL_DISCOVERABILITY_TASKS.md) – UX improvements research\n\n---\n\n## Roadmap\n\n### Current Status\n\n**Production Ready:**\n- ✅ Elixir (tree-sitter)\n- ✅ Python (SCIP)\n- ✅ TypeScript (SCIP)\n- ✅ JavaScript (SCIP)\n- ✅ Rust (SCIP)\n\n\n**Beta:**\n- 🚧 Erlang (tree-sitter)\n- 🚧 Go (SCIP)\n- 🚧 Java/Kotlin/Scala (SCIP)\n- 🚧 C/C++ (SCIP)\n- 🚧 Ruby (SCIP)\n- 🚧 C#/Visual Basic (SCIP)\n- 🚧 Dart (SCIP)\n- 🚧 PHP (SCIP)\n\n---\n\n## Comparison to Alternatives\n\n| Feature | CICADA | [Serena](https://github.com/oraios/serena) | [Codicil](https://github.com/E-xyza/codicil) (Elixir-only) |\n|---------|--------|--------|---------|\n| **Analysis Method** | SCIP (static index) | LSP (real-time server) | LLM summaries + embeddings |\n| **Code Editing** | ❌ | ✅ | ❌ |\n| **Git Context** | ✅ PR history, blame, evolution | ❌ | ❌ |\n| **Resource Usage** | Low (read from disk) | High (persistent server processes) | Medium (API calls) |\n| **Privacy** | 100% local | 100% local | Requires external LLM APIs |\n| **Semantic Search** | Local Ollama or keywords | ❌ | OpenAI/Anthropic embeddings |\n| **Call Graph** | Bidirectional with alias resolution | LSP-based | ❌ |\n\n**When to choose CICADA:** You want local-first operation with rich git context (PR attribution, blame, function evolution tracking) and efficient token usage.\n\n**When to choose Serena:** You need code editing capabilities through LSP and can accept higher resource usage.\n\n**When to choose Codicil:** You have an Elixir project and prefer LLM-powered semantic summaries (Elixir-only).\n\n---\n\n## Contributing\n\n```bash\ngit clone https://github.com/wende/cicada.git\ncd cicada\nuv sync\npytest\n```\n\nBefore submitting a PR:\n- Run `black cicada tests`\n- Ensure tests + coverage pass (`pytest --cov=cicada --cov-report=term-missing`)\n- Update docs if behaviour changes\n\nWe welcome issues/PRs for:\n- New language grammars\n- Tool output improvements\n- Better onboarding docs and tutorials\n\n---\n\n## License\n\nMIT – see [LICENSE](LICENSE).\n\n<div align=\"center\">\n\n**Stop wasting context on blind searches. Give your AI CICADA.**\n\n[Get Started](#quick-install) · [Report Issues](https://github.com/wende/cicada/issues)\n\n</div>\n",
  "bytes": 18166,
  "sha": "585c1e6a264fe03731ebd7876a0669cf694e3fb40b4928538a094af6c1fbbcc0",
  "repo_slug": "wende/cicada",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_wende_cicada_6fb044bf/readme"
}