cicada-mcp 0.2.0__tar.gz → 0.3.1rc1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cicada-mcp might be problematic. Click here for more details.

Files changed (155) hide show
  1. cicada_mcp-0.3.1rc1/PKG-INFO +541 -0
  2. cicada_mcp-0.3.1rc1/README.md +499 -0
  3. cicada_mcp-0.3.1rc1/cicada/_version_hash.py +4 -0
  4. cicada_mcp-0.3.1rc1/cicada/cli.py +15 -0
  5. cicada_mcp-0.3.1rc1/cicada/commands.py +1255 -0
  6. cicada_mcp-0.3.1rc1/cicada/dead_code/__init__.py +1 -0
  7. cicada_mcp-0.2.0/cicada/find_dead_code.py → cicada_mcp-0.3.1rc1/cicada/dead_code/finder.py +2 -1
  8. cicada_mcp-0.3.1rc1/cicada/dependency_analyzer.py +147 -0
  9. cicada_mcp-0.3.1rc1/cicada/entry_utils.py +92 -0
  10. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/extractors/base.py +9 -9
  11. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/extractors/call.py +17 -20
  12. cicada_mcp-0.3.1rc1/cicada/extractors/common.py +64 -0
  13. cicada_mcp-0.3.1rc1/cicada/extractors/dependency.py +231 -0
  14. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/extractors/doc.py +2 -49
  15. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/extractors/function.py +10 -14
  16. cicada_mcp-0.3.1rc1/cicada/extractors/keybert.py +228 -0
  17. cicada_mcp-0.3.1rc1/cicada/extractors/keyword.py +191 -0
  18. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/extractors/module.py +6 -10
  19. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/extractors/spec.py +8 -56
  20. cicada_mcp-0.3.1rc1/cicada/format/__init__.py +20 -0
  21. {cicada_mcp-0.2.0/cicada → cicada_mcp-0.3.1rc1/cicada/format}/ascii_art.py +1 -1
  22. cicada_mcp-0.3.1rc1/cicada/format/formatter.py +1145 -0
  23. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/git_helper.py +134 -7
  24. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/indexer.py +322 -89
  25. cicada_mcp-0.3.1rc1/cicada/interactive_setup.py +433 -0
  26. cicada_mcp-0.3.1rc1/cicada/interactive_setup_helpers.py +305 -0
  27. cicada_mcp-0.3.1rc1/cicada/keyword_expander.py +437 -0
  28. cicada_mcp-0.3.1rc1/cicada/keyword_search.py +331 -0
  29. cicada_mcp-0.3.1rc1/cicada/keyword_test.py +494 -0
  30. cicada_mcp-0.3.1rc1/cicada/mcp/__init__.py +10 -0
  31. cicada_mcp-0.3.1rc1/cicada/mcp/entry.py +17 -0
  32. cicada_mcp-0.3.1rc1/cicada/mcp/filter_utils.py +107 -0
  33. cicada_mcp-0.3.1rc1/cicada/mcp/pattern_utils.py +118 -0
  34. cicada_mcp-0.2.0/cicada/mcp_server.py → cicada_mcp-0.3.1rc1/cicada/mcp/server.py +819 -73
  35. cicada_mcp-0.3.1rc1/cicada/mcp/tools.py +473 -0
  36. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/pr_finder.py +2 -3
  37. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/pr_indexer/indexer.py +3 -2
  38. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/setup.py +174 -37
  39. cicada_mcp-0.3.1rc1/cicada/tier.py +225 -0
  40. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/utils/__init__.py +9 -2
  41. cicada_mcp-0.3.1rc1/cicada/utils/fuzzy_match.py +54 -0
  42. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/utils/index_utils.py +9 -0
  43. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/utils/path_utils.py +18 -0
  44. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/utils/text_utils.py +52 -1
  45. cicada_mcp-0.3.1rc1/cicada/utils/tree_utils.py +47 -0
  46. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/version_check.py +99 -0
  47. cicada_mcp-0.3.1rc1/cicada/watch_manager.py +320 -0
  48. cicada_mcp-0.3.1rc1/cicada/watcher.py +431 -0
  49. cicada_mcp-0.3.1rc1/cicada_mcp.egg-info/PKG-INFO +541 -0
  50. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada_mcp.egg-info/SOURCES.txt +42 -15
  51. cicada_mcp-0.3.1rc1/cicada_mcp.egg-info/entry_points.txt +4 -0
  52. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada_mcp.egg-info/requires.txt +1 -0
  53. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/pyproject.toml +9 -4
  54. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_acceptance.py +22 -19
  55. cicada_mcp-0.3.1rc1/tests/test_acceptance_shell_scripts.py +139 -0
  56. cicada_mcp-0.3.1rc1/tests/test_blame_cache_fix.py +97 -0
  57. cicada_mcp-0.3.1rc1/tests/test_call_extractor.py +174 -0
  58. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_call_sites.py +1 -1
  59. cicada_mcp-0.3.1rc1/tests/test_claude_md_update.py +217 -0
  60. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_clean.py +63 -57
  61. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_cli.py +530 -145
  62. cicada_mcp-0.3.1rc1/tests/test_dependency_analysis.py +401 -0
  63. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_e2e.py +1 -1
  64. cicada_mcp-0.3.1rc1/tests/test_entry_utils.py +52 -0
  65. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_indexer_comprehensive.py +155 -129
  66. cicada_mcp-0.3.1rc1/tests/test_indexer_dependencies.py +254 -0
  67. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_interactive_setup.py +497 -335
  68. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_keybert_extractor.py +26 -132
  69. cicada_mcp-0.3.1rc1/tests/test_keyword_expander.py +315 -0
  70. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_keyword_search.py +192 -231
  71. cicada_mcp-0.3.1rc1/tests/test_mcp_dependency_tools.py +393 -0
  72. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_mcp_e2e.py +57 -8
  73. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_mcp_git_integration.py +1 -1
  74. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_mcp_logging_integration.py +1 -1
  75. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_mcp_server_core.py +158 -1
  76. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_mcp_server_formatting.py +67 -1
  77. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_mcp_server_pr_history.py +4 -4
  78. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_module_usage_categories.py +1 -1
  79. cicada_mcp-0.3.1rc1/tests/test_new_filtering_features.py +196 -0
  80. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_path_utils.py +8 -9
  81. cicada_mcp-0.3.1rc1/tests/test_pr_discoverability_features.py +483 -0
  82. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_pr_finder.py +39 -5
  83. cicada_mcp-0.3.1rc1/tests/test_search_function.py +450 -0
  84. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_server_cli.py +93 -51
  85. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_setup.py +218 -62
  86. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_storage.py +7 -29
  87. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_test_files_filter.py +1 -1
  88. cicada_mcp-0.3.1rc1/tests/test_tier.py +286 -0
  89. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_version_check.py +42 -0
  90. cicada_mcp-0.3.1rc1/tests/test_watch_manager.py +499 -0
  91. cicada_mcp-0.3.1rc1/tests/test_watcher.py +617 -0
  92. cicada_mcp-0.3.1rc1/tests/test_watcher_error_scenarios.py +137 -0
  93. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_with_aliases.py +1 -1
  94. cicada_mcp-0.2.0/PKG-INFO +0 -735
  95. cicada_mcp-0.2.0/README.md +0 -694
  96. cicada_mcp-0.2.0/cicada/cli.py +0 -757
  97. cicada_mcp-0.2.0/cicada/extractors/dependency.py +0 -349
  98. cicada_mcp-0.2.0/cicada/formatter.py +0 -864
  99. cicada_mcp-0.2.0/cicada/interactive_setup.py +0 -490
  100. cicada_mcp-0.2.0/cicada/keybert_extractor.py +0 -286
  101. cicada_mcp-0.2.0/cicada/keyword_search.py +0 -545
  102. cicada_mcp-0.2.0/cicada/keyword_test.py +0 -127
  103. cicada_mcp-0.2.0/cicada/lightweight_keyword_extractor.py +0 -290
  104. cicada_mcp-0.2.0/cicada/mcp_entry.py +0 -683
  105. cicada_mcp-0.2.0/cicada/mcp_tools.py +0 -291
  106. cicada_mcp-0.2.0/cicada_mcp.egg-info/PKG-INFO +0 -735
  107. cicada_mcp-0.2.0/cicada_mcp.egg-info/entry_points.txt +0 -4
  108. cicada_mcp-0.2.0/tests/test_ascii_art.py +0 -281
  109. cicada_mcp-0.2.0/tests/test_dead_code_analyzer.py +0 -581
  110. cicada_mcp-0.2.0/tests/test_find_dead_code.py +0 -725
  111. cicada_mcp-0.2.0/tests/test_formatter.py +0 -1051
  112. cicada_mcp-0.2.0/tests/test_lightweight_keyword_extractor.py +0 -400
  113. cicada_mcp-0.2.0/tests/test_search_function.py +0 -73
  114. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/LICENSE +0 -0
  115. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/__init__.py +0 -0
  116. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/clean.py +0 -0
  117. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/command_logger.py +0 -0
  118. /cicada_mcp-0.2.0/cicada/dead_code_analyzer.py → /cicada_mcp-0.3.1rc1/cicada/dead_code/analyzer.py +0 -0
  119. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/extractors/__init__.py +0 -0
  120. {cicada_mcp-0.2.0/cicada → cicada_mcp-0.3.1rc1/cicada/format}/colors.py +0 -0
  121. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/parser.py +0 -0
  122. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/pr_indexer/__init__.py +0 -0
  123. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/pr_indexer/cli.py +0 -0
  124. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/pr_indexer/github_api_client.py +0 -0
  125. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/pr_indexer/line_mapper.py +0 -0
  126. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/pr_indexer/pr_index_builder.py +0 -0
  127. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/utils/call_site_formatter.py +0 -0
  128. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/utils/function_grouper.py +0 -0
  129. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/utils/hash_utils.py +0 -0
  130. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/utils/signature_builder.py +0 -0
  131. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/utils/storage.py +0 -0
  132. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada/utils/subprocess_runner.py +0 -0
  133. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada_mcp.egg-info/dependency_links.txt +0 -0
  134. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/cicada_mcp.egg-info/top_level.txt +0 -0
  135. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/setup.cfg +0 -0
  136. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_command_logger.py +0 -0
  137. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_extractors_base.py +0 -0
  138. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_git_extended_history.py +0 -0
  139. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_git_helper.py +0 -0
  140. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_github_api_client.py +0 -0
  141. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_gitignore_integration.py +0 -0
  142. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_hash_utils.py +0 -0
  143. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_index_utils.py +0 -0
  144. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_line_mapper.py +0 -0
  145. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_mcp_pr_tools.py +0 -0
  146. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_multi_editor_setup.py +0 -0
  147. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_parser.py +0 -0
  148. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_parser_comprehensive.py +0 -0
  149. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_pr_index_builder.py +0 -0
  150. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_pr_indexer_integration.py +0 -0
  151. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_pr_indexer_unit.py +0 -0
  152. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_signal_handling.py +0 -0
  153. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_signature_builder.py +0 -0
  154. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_subprocess_runner.py +0 -0
  155. {cicada_mcp-0.2.0 → cicada_mcp-0.3.1rc1}/tests/test_text_utils.py +0 -0
@@ -0,0 +1,541 @@
1
+ Metadata-Version: 2.4
2
+ Name: cicada-mcp
3
+ Version: 0.3.1rc1
4
+ Summary: An Elixir module search MCP server
5
+ Author-email: wende <wende@hey.com>
6
+ Maintainer-email: wende <wende@hey.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/wende/cicada
9
+ Project-URL: Repository, https://github.com/wende/cicada
10
+ Project-URL: Issues, https://github.com/wende/cicada/issues
11
+ Project-URL: Changelog, https://github.com/wende/cicada/blob/main/CHANGELOG.md
12
+ Project-URL: Documentation, https://github.com/wende/cicada#readme
13
+ Keywords: elixir,phoenix,mcp,model-context-protocol,code-search,developer-tools,git-history,code-intelligence,ai-assistant
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Software Development :: Code Generators
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Topic :: Software Development :: Version Control :: Git
24
+ Classifier: Topic :: Text Processing :: Indexing
25
+ Classifier: Framework :: Pytest
26
+ Requires-Python: >=3.10
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: mcp>=0.1.0
30
+ Requires-Dist: pyyaml>=6.0
31
+ Requires-Dist: tree-sitter>=0.20.0
32
+ Requires-Dist: tree-sitter-elixir>=0.1.0
33
+ Requires-Dist: gitpython>=3.1.0
34
+ Requires-Dist: keybert>=0.8.0
35
+ Requires-Dist: lemminflect>=0.2.3
36
+ Requires-Dist: rank-bm25>=0.2.2
37
+ Requires-Dist: simple-term-menu>=1.6.0
38
+ Requires-Dist: tomli>=2.0.0; python_version < "3.11"
39
+ Requires-Dist: gensim>=4.4.0
40
+ Requires-Dist: watchdog>=3.0.0
41
+ Dynamic: license-file
42
+
43
+ <div align="center">
44
+
45
+ <img src="https://raw.githubusercontent.com/wende/cicada/main/public/cicada.png" alt="CICADA Logo" width="360"/>
46
+
47
+ # CICADA
48
+
49
+ ### **C**ode **I**ntelligence: **C**ontextual **A**nalysis, **D**iscovery, and **A**ttribution
50
+
51
+ **Give your AI assistant structured access to your Elixir codebase.**
52
+
53
+ [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
54
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55
+ [![codecov](https://codecov.io/gh/wende/cicada/branch/main/graph/badge.svg)](https://codecov.io/gh/wende/cicada)
56
+ [![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io)
57
+
58
+ [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cicada&config=eyJjb21tYW5kIjoidXZ4IGNpY2FkYS1tY3AgLiJ9)
59
+
60
+ [Quick Install](#quick-install) · [Security](#privacy--security) · [Developers](#for-developers) · [AI Assistants](#for-ai-assistants) · [Docs](#documentation)
61
+
62
+ </div>
63
+
64
+ ---
65
+
66
+ ## What's New in 0.3
67
+
68
+ - **Dependency analysis tools** - New `get_module_dependencies` and `get_function_dependencies` with transitive depth support
69
+ - **Expanded editor support** - Added Gemini CLI, Codex, and OpenCode (now 6 editors supported)
70
+ - **Watch mode** - Automatic reindexing with `cicada watch` or `--watch` flag
71
+ - **Better discoverability** - Smart error suggestions, inline PR context, staleness warnings
72
+ - **Wildcard & OR patterns** - Search with `MyApp.*`, `create*|update*` across modules and functions
73
+ - **Breaking:** Removed `CICADA_REPO_PATH` environment variable
74
+
75
+ ---
76
+
77
+ ## Why CICADA?
78
+
79
+ Traditional AI assistants treat your repo like a pile of text. That leads to:
80
+
81
+ - **Token waste:** blind grep dumps that burn 3k+ tokens per question.
82
+ - **Hallucinated edits:** aliases/imports hide call sites, so refactors miss real usages.
83
+ - **No historical context:** design intent and PR trade-offs never make it into the prompt.
84
+
85
+ CICADA is an MCP server that gives assistants AST-level knowledge:
86
+
87
+ - Module + function definitions with signatures, specs, docs, owning files.
88
+ - Complete call-site tracking (aliases, imports, dynamic references).
89
+ - Semantic/keyword search so you can ask for "authentication" even if it's called `verify_credentials/2`.
90
+ - Git + PR attribution to surface *why* code exists.
91
+ - Dead-code detection and module dependency views for safe refactors.
92
+
93
+ **Result:** in our comparison, the same question dropped from **3,127 tokens / 52.8s** to **550 tokens / 35s** with correct answers.
94
+
95
+ ---
96
+
97
+ ## Quick Install
98
+
99
+ ```bash
100
+ # 1. Install uv (if needed)
101
+ curl -LsSf https://astral.sh/uv/install.sh | sh
102
+
103
+ # 2. Install CICADA
104
+ uv tool install cicada-mcp
105
+
106
+ # 3. Index your Elixir project
107
+ cd /path/to/project
108
+ cicada claude # or: cicada cursor, cicada vs, cicada gemini, cicada codex, cicada opencode
109
+
110
+ # 4. Restart your editor
111
+ ```
112
+
113
+ <div align="left">
114
+ <details>
115
+ <summary><strong>Try before installing permanently</strong></summary>
116
+
117
+ ```bash
118
+ uvx --from cicada-mcp cicada claude # or cursor, vs
119
+ ```
120
+
121
+ Runs CICADA on demand (slower after the first run, but zero install).
122
+
123
+ </details>
124
+ </div>
125
+
126
+ **Available commands after installation:**
127
+ - `cicada [claude|cursor|vs|gemini|codex|opencode]` - One-command setup per project
128
+ - `cicada-mcp` - MCP server (auto-started by editor)
129
+ - `cicada watch` - Watch for file changes and automatically reindex
130
+ - `cicada index` - Re-index code with custom options (`-f/--force` + --fast/--regular/--max, --watch)
131
+ - `cicada index-pr` - Index pull requests for PR attribution
132
+ - `cicada find-dead-code` - Find potentially unused functions
133
+
134
+ Ask your assistant:
135
+ ```
136
+ "Show me the functions in MyApp.User"
137
+ "Where is authenticate/2 called?"
138
+ "Find code related to API authentication"
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Privacy & Security
144
+
145
+ - **100% local:** parsing + indexing happen on your machine; no cloud uploads.
146
+ - **No telemetry:** CICADA doesn't collect usage or phone home.
147
+ - **Read-only tools:** MCP endpoints only read the index; they can't change your repo.
148
+ - **Optional GitHub access:** PR features rely on `gh` and your existing OAuth token.
149
+ - **Data layout:**
150
+ ```
151
+ ~/.cicada/projects/<repo_hash>/
152
+ ├─ index.json # modules, functions, call sites, metadata
153
+ ├─ config.yaml # indexing options + keyword tier
154
+ ├─ hashes.json # incremental indexing cache
155
+ └─ pr_index.json # optional PR metadata + reviews
156
+ ```
157
+ Your repo only gains an editor config (`.mcp.json`, `.cursor/mcp.json`, `.vscode/settings.json`, `.gemini/mcp.json`, `.codex/mcp.json`, or `.opencode.json`).
158
+
159
+ ---
160
+
161
+ ## For Developers
162
+
163
+ > Wire CICADA into your editor once, and every assistant session inherits the context.
164
+
165
+ ### Install & Configure
166
+
167
+ ```bash
168
+ cd /path/to/project
169
+ cicada claude # or cicada cursor / cicada vs / cicada gemini / cicada codex / cicada opencode
170
+ ```
171
+
172
+ This command:
173
+ 1. Parses every `.ex`/`.exs` file with tree-sitter.
174
+ 2. Builds the index in `~/.cicada/projects/<hash>/`.
175
+ 3. Creates the correct MCP config for your editor.
176
+ 4. Configures `.gitattributes` so git can track functions through refactors.
177
+
178
+ ### Re-indexing
179
+
180
+ - **Incremental update:** `cicada claude` (or cursor/vs) detects changed files only.
181
+ - **Force rebuild:** `rm ~/.cicada/projects/<hash>/hashes.json && cicada index .`
182
+ - **Switch keyword tier:** `cicada index --force --fast|--regular|--max .`
183
+
184
+
185
+ ### Enable PR Attribution (optional)
186
+
187
+ ```bash
188
+ brew install gh # or apt install gh
189
+ gh auth login
190
+ cicada index-pr . # incremental
191
+ cicada index-pr . --clean # full rebuild
192
+ ```
193
+
194
+ Unlocks questions like "Which PR introduced line 42?" or "What did reviewers say about `billing.ex`?"
195
+
196
+ ### Automatic Re-indexing with Watch Mode
197
+
198
+ Enable automatic reindexing when files change by starting the MCP server with the `--watch` flag:
199
+
200
+ **For Claude Code (.mcp.json):**
201
+ ```json
202
+ {
203
+ "mcpServers": {
204
+ "cicada": {
205
+ "command": "cicada-mcp",
206
+ "args": ["--watch"],
207
+ "env": {
208
+ "CICADA_CONFIG_DIR": "/home/user/.cicada/projects/<hash>"
209
+ }
210
+ }
211
+ }
212
+ }
213
+ ```
214
+
215
+ **For Cursor (.cursor/mcp.json):**
216
+ ```json
217
+ {
218
+ "mcpServers": {
219
+ "cicada": {
220
+ "command": "cicada-mcp",
221
+ "args": ["--watch"]
222
+ }
223
+ }
224
+ }
225
+ ```
226
+
227
+ **Or use with the server subcommand:**
228
+ ```bash
229
+ cicada server --watch
230
+ cicada server --watch --fast # Use fast tier for reindexing
231
+ cicada server --watch --max # Use max tier for reindexing
232
+ ```
233
+
234
+ When watch mode is enabled:
235
+ - A separate process monitors `.ex` and `.exs` files for changes
236
+ - Changes are automatically reindexed (incremental, fast)
237
+ - 2-second debounce prevents excessive reindexing during rapid edits
238
+ - The watch process stops automatically when the MCP server stops
239
+ - Excluded directories: `deps`, `_build`, `node_modules`, `.git`, `assets`, `priv`
240
+
241
+ ### CLI Cheat Sheet
242
+
243
+ | Command | Purpose | Run When |
244
+ |---------|---------|---------|
245
+ | `cicada claude` | Configure MCP + incremental re-index | First setup, after local changes |
246
+ | `cicada watch` | Monitor files and auto-reindex on changes | During active development |
247
+ | `cicada index --force --regular .` | Full rebuild w/ semantic keywords | After large refactors or enabling AI tier |
248
+ | `cicada index-pr .` | Sync PR metadata/reviews | After new PRs merge |
249
+ | `cicada find-dead-code --min-confidence high` | List unused public functions | Cleanup sprints |
250
+
251
+ ### Troubleshooting
252
+
253
+ <details>
254
+ <summary><b>"Index file not found"</b></summary>
255
+
256
+ Run the indexer first:
257
+ ```bash
258
+ cicada index /path/to/project
259
+ ```
260
+
261
+ Ensure indexing completed successfully. Check for `~/.cicada/projects/<hash>/index.json`.
262
+
263
+ </details>
264
+
265
+ <details>
266
+ <summary><b>"Module not found"</b></summary>
267
+
268
+ Use the exact module name as it appears in code (e.g., `MyApp.User`, not `User`).
269
+
270
+ If module was recently added, re-index:
271
+ ```bash
272
+ cicada index .
273
+ ```
274
+
275
+ </details>
276
+
277
+ <details>
278
+ <summary><b>MCP Server Won't Connect</b></summary>
279
+
280
+ **Troubleshooting checklist:**
281
+
282
+ 1. **Verify configuration file exists:**
283
+ ```bash
284
+ # For Claude Code
285
+ ls -la .mcp.json
286
+
287
+ # For Cursor
288
+ ls -la .cursor/mcp.json
289
+
290
+ # For VS Code
291
+ ls -la .vscode/settings.json
292
+ ```
293
+
294
+ 2. **Check paths are absolute:**
295
+ ```bash
296
+ cat .mcp.json
297
+ # Should contain: /absolute/path/to/project
298
+ # Not: ./project or ../project
299
+ ```
300
+
301
+ 3. **Ensure index exists:**
302
+ ```bash
303
+ ls -la ~/.cicada/projects/
304
+ # Should show directory for your project
305
+ ```
306
+
307
+ 4. **Restart editor completely** (not just reload window)
308
+
309
+ 5. **Check editor MCP logs:**
310
+ - Claude Code: Console output
311
+ - Cursor: Settings → MCP → View Logs
312
+ - VS Code: Output panel → MCP
313
+
314
+ </details>
315
+
316
+ <details>
317
+ <summary><b>PR Features Not Working</b></summary>
318
+
319
+ **Setup GitHub CLI:**
320
+ ```bash
321
+ # Install GitHub CLI
322
+ brew install gh # macOS
323
+ sudo apt install gh # Ubuntu
324
+ # or visit https://cli.github.com/
325
+
326
+ # Authenticate
327
+ gh auth login
328
+
329
+ # Index PRs
330
+ cicada index-pr .
331
+ ```
332
+
333
+ **Common issues:**
334
+ - "No PR index found" → Run `cicada index-pr .`
335
+ - "Not a GitHub repository" → Ensure repo has GitHub remote
336
+ - Slow indexing → First-time indexing fetches all PRs; subsequent runs are incremental
337
+ - Rate limiting → GitHub API has rate limits; wait and retry if you hit limits
338
+
339
+ **Force rebuild:**
340
+ ```bash
341
+ cicada index-pr . --clean
342
+ ```
343
+
344
+ </details>
345
+
346
+ <details>
347
+ <summary><b>Keyword Search Not Working</b></summary>
348
+
349
+ **Error:** "Keyword search not available"
350
+
351
+ **Cause:** Index was built without keyword extraction.
352
+
353
+ **Solution:**
354
+ ```bash
355
+ # Re-index with keyword extraction
356
+ cicada index --regular . # or --fast or --max
357
+ ```
358
+
359
+ **Verify:**
360
+ ```bash
361
+ cat ~/.cicada/projects/<hash>/config.yaml
362
+ # Should show keyword_extraction: enabled
363
+ ```
364
+
365
+ </details>
366
+
367
+ More detail: [docs/PR_INDEXING.md](docs/PR_INDEXING.md), [docs/08-INCREMENTAL_INDEXING.md](docs/08-INCREMENTAL_INDEXING.md).
368
+
369
+ ---
370
+
371
+ ## For AI Assistants
372
+
373
+ CICADA ships eleven focused MCP tools. Use the decision table to pick the right one:
374
+
375
+ ### 🧭 Which Tool Should You Use?
376
+
377
+ | Need | Tool | Notes |
378
+ |------|------|-------|
379
+ | List a module's API | `search_module` | Supports wildcards (`*`) and OR (`|`) patterns. Includes public/private functions, signatures, specs, docs |
380
+ | Find where a function is defined & called | `search_function` | Supports wildcards (`*`) and OR (`|`) patterns. Resolves aliases/imports, shows code context |
381
+ | Discover who imports/aliases a module | `search_module_usage` | Great for dependency impact analysis |
382
+ | See what modules a module depends on | `get_module_dependencies` | Shows all modules used by a module (with transitive depth support) |
383
+ | See what functions a function calls | `get_function_dependencies` | Shows all functions called by a function (with transitive depth support) |
384
+ | Search by concept ("authentication", `*_user`) | `search_by_features` | Requires keyword tier index |
385
+ | Identify unused code | `find_dead_code` | Confidence-ranked (high, medium, low) |
386
+ | Find PR for a line | `find_pr_for_line` | Needs `cicada index-pr` + `gh` |
387
+ | View PR history for a file | `get_file_pr_history` | Shows descriptions + review comments |
388
+ | Track function/file evolution | `get_commit_history` | Follows refactors via `.gitattributes` |
389
+ | Show blame with grouped authorship | `get_blame` | Useful when you need owners |
390
+
391
+ **Want to see these tools in action?** Check out [Complete Workflow Examples](docs/WORKFLOW_EXAMPLES.md) with pro tips and real-world scenarios.
392
+
393
+ ### Core Search Tools
394
+
395
+ **`search_module`** - Find modules and view all their functions
396
+ - Search by module name or file path with wildcards (`MyApp.*`, `*User*`) and OR patterns (`MyApp.User|MyApp.Post`)
397
+ - View function signatures with type specs
398
+ - Filter public/private functions
399
+ - Output in Markdown or JSON
400
+
401
+ **`search_function`** - Locate function definitions and track usage
402
+ - Search by function name, arity, or module path with wildcards (`create*`, `*_user`) and OR patterns (`create*|update*`)
403
+ - See where functions are called with line numbers
404
+ - View actual code usage examples
405
+ - Filter for test files only
406
+
407
+ **`search_module_usage`** - Track module dependencies
408
+ - Find all aliases and imports
409
+ - See all function calls to a module
410
+ - Understand module relationships
411
+ - Map dependencies across codebase
412
+
413
+ ### Git History & Attribution Tools
414
+
415
+ **`find_pr_for_line`** - Identify which PR introduced any line of code
416
+ - Line-level PR attribution via git blame
417
+ - Author and commit information
418
+ - Direct links to GitHub PRs
419
+ - Requires: GitHub CLI + PR index
420
+
421
+ **`get_file_pr_history`** - View complete PR history for a file
422
+ - All PRs that modified the file
423
+ - PR descriptions and metadata
424
+ - Code review comments with line numbers
425
+ - Requires: GitHub CLI + PR index
426
+
427
+ **`get_commit_history`** - Track file and function evolution over time
428
+ - Complete commit history for files
429
+ - Function-level tracking (follows refactors)
430
+ - Creation and modification timeline
431
+ - Requires: `.gitattributes` configuration
432
+
433
+ **`get_blame`** - Show line-by-line code ownership
434
+ - Grouped authorship display
435
+ - Commit details for each author
436
+ - Code snippets with context
437
+
438
+ ### Advanced Features
439
+
440
+ **`search_by_features`** (Beta) - Search code by concepts and features
441
+ - **🎯 Perfect for: "I don't know the exact name"** - Search by what code does, not what it's called
442
+ - Find code related to concepts like "authentication", "api key storage", "email validation"
443
+ - Wildcard pattern matching (`create*`, `*_user`, `validate_*`)
444
+ - Filter results by type: modules only, functions only, or all
445
+ - AI-powered keyword extraction from documentation
446
+ - Relevance scoring to surface the most relevant results
447
+ - Requires: Index built with keyword extraction (--fast, --regular, or --max)
448
+
449
+ **When to use:** You know what you're looking for conceptually but not the exact module/function names. Instead of guessing names with `search_function`, describe what the code does!
450
+
451
+ **`find_dead_code`** - Identify potentially unused functions
452
+ - Three confidence levels (high, medium, low)
453
+ - Smart detection of callbacks and behaviors
454
+ - Recognition of dynamic call patterns
455
+ - Module-level grouping with line numbers
456
+ - Excludes test files and `@impl` functions
457
+
458
+ Detailed parameters + output formats: [MCP_TOOLS_REFERENCE.md](MCP_TOOLS_REFERENCE.md).
459
+
460
+ ### Token-Friendly Responses
461
+
462
+ All tools return structured Markdown/JSON snippets (signatures, call sites, PR metadata) instead of full files, keeping prompts lean.
463
+
464
+ ---
465
+
466
+ ## Learn by Doing (5–10 min each)
467
+
468
+ ### 1. Safe Refactor Checklist
469
+ 1. `search_function` → "Where is `create_user/2` called?"
470
+ 2. `search_module_usage` → "Which modules alias `MyApp.User`?"
471
+ 3. `search_function` with `test_only:true` to confirm test coverage.
472
+ 4. `get_file_pr_history` → "Show PRs that modified `lib/my_app/user.ex`."
473
+
474
+ ### 2. Untangle Legacy Intent
475
+ 1. `search_module` to skim the API.
476
+ 2. `get_file_pr_history` for design discussions/reviews.
477
+ 3. `get_commit_history` on the hot function.
478
+ 4. `get_blame` on confusing lines to ping the right author.
479
+
480
+ ### 3. Cleanup Sprint
481
+ 1. `find_dead_code --min-confidence high` for candidates.
482
+ 2. For each, `search_function` to double-check dynamic usage.
483
+ 3. `find_pr_for_line` to ensure it isn't waiting on an unfinished feature.
484
+ 4. Remove or deprecate confidently.
485
+
486
+ For full walkthroughs see [docs/17-WORKFLOW_EXAMPLES.md](docs/17-WORKFLOW_EXAMPLES.md) and [docs/12-TOOL_DISCOVERABILITY_TASKS.md](docs/12-TOOL_DISCOVERABILITY_TASKS.md).
487
+
488
+ ---
489
+
490
+ ## Documentation
491
+
492
+ - [CHANGELOG.md](CHANGELOG.md) – release notes.
493
+ - [docs/01-KEYWORD_EXTRACTION_ANALYSIS.md](docs/01-KEYWORD_EXTRACTION_ANALYSIS.md) – semantic search internals.
494
+ - [docs/09-PR_INDEXING.md](docs/09-PR_INDEXING.md) – GitHub integration details.
495
+ - [docs/16-MCP_TOOL_CALL_BENCHMARKING.md](docs/16-MCP_TOOL_CALL_BENCHMARKING.md) – token/time benchmarks.
496
+
497
+ ---
498
+
499
+ ## Roadmap
500
+
501
+ | Available | Coming Soon |
502
+ |-----------|-------------|
503
+ | Elixir indexing + AST search | Python + TypeScript support |
504
+ | Semantic keyword tiers (`--fast/regular/max`) | Shared/team indexes |
505
+ | PR attribution + review scraping | Native IDE plugins (no MCP bridge) |
506
+ | Dead-code + dependency analysis | Optional remote index storage |
507
+
508
+ ---
509
+
510
+ ## Contributing
511
+
512
+ ```bash
513
+ git clone https://github.com/wende/cicada.git
514
+ cd cicada
515
+ uv sync
516
+ pytest
517
+ ```
518
+
519
+ Before submitting a PR:
520
+ - Run `black cicada tests`
521
+ - Ensure tests + coverage pass (`pytest --cov=cicada --cov-report=term-missing`)
522
+ - Update docs if behaviour changes
523
+
524
+ We welcome issues/PRs for:
525
+ - New language grammars
526
+ - Tool output improvements
527
+ - Better onboarding docs and tutorials
528
+
529
+ ---
530
+
531
+ ## License
532
+
533
+ MIT – see [LICENSE](LICENSE).
534
+
535
+ <div align="center">
536
+
537
+ **Stop letting your AI search blindly. Give it CICADA.**
538
+
539
+ [Get Started](#quick-install) · [Report Issues](https://github.com/wende/cicada/issues)
540
+
541
+ </div>