cicada-mcp 0.1.5__py3-none-any.whl → 0.1.7__py3-none-any.whl

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.

cicada/indexer.py CHANGED
@@ -102,7 +102,8 @@ class ElixirIndexer:
102
102
  if not repo_path_obj.exists():
103
103
  raise ValueError(f"Repository path does not exist: {repo_path_obj}")
104
104
 
105
- print(f"Indexing repository: {repo_path_obj}")
105
+ if self.verbose:
106
+ print(f"Indexing repository: {repo_path_obj}")
106
107
 
107
108
  # Set up signal handlers for graceful interruption
108
109
  signal.signal(signal.SIGINT, self._handle_interrupt)
@@ -118,20 +119,22 @@ class ElixirIndexer:
118
119
  )
119
120
 
120
121
  keyword_extractor = LightweightKeywordExtractor(
121
- verbose=True, model_size=spacy_model
122
+ verbose=self.verbose, model_size=spacy_model
122
123
  )
123
124
  except Exception as e:
124
- print(f"Warning: Could not initialize keyword extractor: {e}")
125
- print("Continuing without keyword extraction...")
125
+ if self.verbose:
126
+ print(f"Warning: Could not initialize keyword extractor: {e}")
127
+ print("Continuing without keyword extraction...")
126
128
  extract_keywords = False
127
129
 
128
130
  # Find all Elixir files
129
131
  elixir_files = self._find_elixir_files(repo_path_obj)
130
132
  total_files = len(elixir_files)
131
133
 
132
- print(f"Found {total_files} Elixir files")
133
- if extract_keywords:
134
- print("Keyword extraction enabled")
134
+ if self.verbose:
135
+ print(f"Found {total_files} Elixir files")
136
+ if extract_keywords:
137
+ print("Keyword extraction enabled")
135
138
 
136
139
  # Parse all files
137
140
  all_modules = {}
@@ -222,7 +225,10 @@ class ElixirIndexer:
222
225
  files_processed += 1
223
226
 
224
227
  # Progress reporting
225
- if files_processed % self.PROGRESS_REPORT_INTERVAL == 0:
228
+ if (
229
+ self.verbose
230
+ and files_processed % self.PROGRESS_REPORT_INTERVAL == 0
231
+ ):
226
232
  print(f" Processed {files_processed}/{total_files} files...")
227
233
 
228
234
  # Check for interruption after each file
@@ -230,7 +236,8 @@ class ElixirIndexer:
230
236
  break
231
237
 
232
238
  except Exception as e:
233
- print(f" Skipping {file_path}: {e}")
239
+ if self.verbose:
240
+ print(f" Skipping {file_path}: {e}")
234
241
  # Check for interruption even after error
235
242
  if self._check_and_report_interruption(files_processed, total_files):
236
243
  break
@@ -258,12 +265,14 @@ class ElixirIndexer:
258
265
  from cicada.utils.path_utils import ensure_gitignore_has_cicada
259
266
 
260
267
  if ensure_gitignore_has_cicada(repo_path_obj):
261
- print("✓ Added .cicada/ to .gitignore")
268
+ if self.verbose:
269
+ print("✓ Added .cicada/ to .gitignore")
262
270
 
263
271
  save_index(index, output_path_obj, create_dirs=True)
264
272
 
265
273
  # Compute and save hashes for all PROCESSED files for future incremental updates
266
- print("Computing file hashes for incremental updates...")
274
+ if self.verbose:
275
+ print("Computing file hashes for incremental updates...")
267
276
  # Only hash files that were actually processed
268
277
  processed_files = [
269
278
  str(f.relative_to(repo_path_obj)) for f in elixir_files[:files_processed]
@@ -272,30 +281,31 @@ class ElixirIndexer:
272
281
  save_file_hashes(str(output_path_obj.parent), file_hashes)
273
282
 
274
283
  # Report completion status
275
- if self._interrupted:
276
- print(f"\n✓ Partial index saved!")
277
- print(
278
- f" Processed: {files_processed}/{total_files} files ({files_processed/total_files*100:.1f}%)"
279
- )
280
- print(f" Modules: {len(all_modules)}")
281
- print(f" Functions: {total_functions}")
282
- print(
283
- f"\n💡 Run the command again to continue indexing remaining {total_files - files_processed} file(s)"
284
- )
285
- else:
286
- print(f"\nIndexing complete!")
287
- print(f" Modules: {len(all_modules)}")
288
- print(f" Functions: {total_functions}")
284
+ if self.verbose:
285
+ if self._interrupted:
286
+ print(f"\n✓ Partial index saved!")
287
+ print(
288
+ f" Processed: {files_processed}/{total_files} files ({files_processed/total_files*100:.1f}%)"
289
+ )
290
+ print(f" Modules: {len(all_modules)}")
291
+ print(f" Functions: {total_functions}")
292
+ print(
293
+ f"\n💡 Run the command again to continue indexing remaining {total_files - files_processed} file(s)"
294
+ )
295
+ else:
296
+ print(f"\nIndexing complete!")
297
+ print(f" Modules: {len(all_modules)}")
298
+ print(f" Functions: {total_functions}")
289
299
 
290
- # Report keyword extraction failures if any
291
- if extract_keywords and keyword_extraction_failures > 0:
292
- print(
293
- f"\n⚠️ Warning: Keyword extraction failed for {keyword_extraction_failures} module(s) or function(s)"
294
- )
295
- print(" Some documentation may not be indexed for keyword search.")
300
+ # Report keyword extraction failures if any
301
+ if extract_keywords and keyword_extraction_failures > 0:
302
+ print(
303
+ f"\n⚠️ Warning: Keyword extraction failed for {keyword_extraction_failures} module(s) or function(s)"
304
+ )
305
+ print(" Some documentation may not be indexed for keyword search.")
296
306
 
297
- print(f"\nIndex saved to: {output_path_obj}")
298
- print(f"Hashes saved to: {output_path_obj.parent}/hashes.json")
307
+ print(f"\nIndex saved to: {output_path_obj}")
308
+ print(f"Hashes saved to: {output_path_obj.parent}/hashes.json")
299
309
 
300
310
  return index
301
311
 
@@ -351,7 +361,8 @@ class ElixirIndexer:
351
361
  str(repo_path_obj), str(output_path_obj), extract_keywords, spacy_model
352
362
  )
353
363
 
354
- print(f"Performing incremental index of: {repo_path_obj}")
364
+ if self.verbose:
365
+ print(f"Performing incremental index of: {repo_path_obj}")
355
366
 
356
367
  # Set up signal handlers for graceful interruption
357
368
  signal.signal(signal.SIGINT, self._handle_interrupt)
@@ -364,7 +375,8 @@ class ElixirIndexer:
364
375
  relative_files = [str(f.relative_to(repo_path_obj)) for f in elixir_files]
365
376
 
366
377
  # Detect file changes
367
- print("Detecting file changes...")
378
+ if self.verbose:
379
+ print("Detecting file changes...")
368
380
  new_files, modified_files, deleted_files = detect_file_changes(
369
381
  relative_files, existing_hashes, str(repo_path_obj)
370
382
  )
@@ -377,10 +389,14 @@ class ElixirIndexer:
377
389
  print("No changes detected. Index is up to date.")
378
390
  return existing_index
379
391
 
380
- print(f"Changes detected:")
381
- print(f" New files: {len(new_files)}")
382
- print(f" Modified files: {len(modified_files)}")
383
- print(f" Deleted files: {len(deleted_files)}")
392
+ if self.verbose:
393
+ print(f"Changes detected:")
394
+ if self.verbose:
395
+ print(f" New files: {len(new_files)}")
396
+ if self.verbose:
397
+ print(f" Modified files: {len(modified_files)}")
398
+ if self.verbose:
399
+ print(f" Deleted files: {len(deleted_files)}")
384
400
 
385
401
  if files_to_process:
386
402
  print(f"\nProcessing {len(files_to_process)} changed file(s)...")
@@ -394,7 +410,7 @@ class ElixirIndexer:
394
410
  )
395
411
 
396
412
  keyword_extractor = LightweightKeywordExtractor(
397
- verbose=True, model_size=spacy_model
413
+ verbose=self.verbose, model_size=spacy_model
398
414
  )
399
415
  except Exception as e:
400
416
  print(f"Warning: Could not initialize keyword extractor: {e}")
@@ -502,13 +518,15 @@ class ElixirIndexer:
502
518
  }
503
519
 
504
520
  # Merge with existing index
505
- print("\nMerging with existing index...")
521
+ if self.verbose:
522
+ print("\nMerging with existing index...")
506
523
  merged_index = merge_indexes_incremental(
507
524
  existing_index, new_index, deleted_files
508
525
  )
509
526
 
510
527
  # Update hashes for all current files
511
- print("Updating file hashes...")
528
+ if self.verbose:
529
+ print("Updating file hashes...")
512
530
  updated_hashes = dict(existing_hashes)
513
531
 
514
532
  # Compute hashes only for files that were actually processed
cicada/mcp_server.py CHANGED
@@ -1496,43 +1496,27 @@ def _auto_setup_if_needed():
1496
1496
  # Already set up, nothing to do
1497
1497
  return
1498
1498
 
1499
- # Setup needed - create storage and index
1500
- print("=" * 60, file=sys.stderr)
1501
- print("Cicada: First-time setup detected", file=sys.stderr)
1502
- print("=" * 60, file=sys.stderr)
1503
- print(file=sys.stderr)
1504
-
1499
+ # Setup needed - create storage and index (silent mode)
1505
1500
  # Validate it's an Elixir project
1506
1501
  if not (repo_path / "mix.exs").exists():
1507
1502
  print(
1508
- f"Error: {repo_path} does not appear to be an Elixir project",
1503
+ f"Error: {repo_path} does not appear to be an Elixir project (mix.exs not found)",
1509
1504
  file=sys.stderr,
1510
1505
  )
1511
- print("(mix.exs not found)", file=sys.stderr)
1512
1506
  sys.exit(1)
1513
1507
 
1514
1508
  try:
1515
1509
  # Create storage directory
1516
1510
  storage_dir = create_storage_dir(repo_path)
1517
- print(f"Repository: {repo_path}", file=sys.stderr)
1518
- print(f"Storage: {storage_dir}", file=sys.stderr)
1519
- print(file=sys.stderr)
1520
-
1521
- # Index repository
1522
- index_repository(repo_path)
1523
- print(file=sys.stderr)
1524
1511
 
1525
- # Create config.yaml
1526
- create_config_yaml(repo_path, storage_dir)
1527
- print(file=sys.stderr)
1512
+ # Index repository (silent mode)
1513
+ index_repository(repo_path, verbose=False)
1528
1514
 
1529
- print("=" * 60, file=sys.stderr)
1530
- print("✓ Setup Complete! Starting server...", file=sys.stderr)
1531
- print("=" * 60, file=sys.stderr)
1532
- print(file=sys.stderr)
1515
+ # Create config.yaml (silent mode)
1516
+ create_config_yaml(repo_path, storage_dir, verbose=False)
1533
1517
 
1534
1518
  except Exception as e:
1535
- print(f"Error during auto-setup: {e}", file=sys.stderr)
1519
+ print(f"Cicada auto-setup error: {e}", file=sys.stderr)
1536
1520
  sys.exit(1)
1537
1521
 
1538
1522
 
cicada/setup.py CHANGED
@@ -163,13 +163,16 @@ def get_mcp_config_for_editor(
163
163
  return config_path, config
164
164
 
165
165
 
166
- def create_config_yaml(repo_path: Path, storage_dir: Path) -> None:
166
+ def create_config_yaml(
167
+ repo_path: Path, storage_dir: Path, verbose: bool = True
168
+ ) -> None:
167
169
  """
168
170
  Create config.yaml in storage directory.
169
171
 
170
172
  Args:
171
173
  repo_path: Path to the repository
172
174
  storage_dir: Path to the storage directory
175
+ verbose: Whether to print progress messages (default: True)
173
176
  """
174
177
  config_path = get_config_path(repo_path)
175
178
  index_path = get_index_path(repo_path)
@@ -184,22 +187,24 @@ storage:
184
187
  with open(config_path, "w") as f:
185
188
  f.write(config_content)
186
189
 
187
- print(f"✓ Config file created at {config_path}")
190
+ if verbose:
191
+ print(f"✓ Config file created at {config_path}")
188
192
 
189
193
 
190
- def index_repository(repo_path: Path) -> None:
194
+ def index_repository(repo_path: Path, verbose: bool = True) -> None:
191
195
  """
192
196
  Index the repository with keyword extraction enabled.
193
197
 
194
198
  Args:
195
199
  repo_path: Path to the repository
200
+ verbose: Whether to print progress messages (default: True)
196
201
 
197
202
  Raises:
198
203
  Exception: If indexing fails
199
204
  """
200
205
  try:
201
206
  index_path = get_index_path(repo_path)
202
- indexer = ElixirIndexer(verbose=True)
207
+ indexer = ElixirIndexer(verbose=verbose)
203
208
 
204
209
  # Index with keyword extraction enabled by default
205
210
  # Note: Using 'small' model for compatibility with uvx
@@ -211,10 +216,12 @@ def index_repository(repo_path: Path) -> None:
211
216
  spacy_model="small",
212
217
  )
213
218
 
214
- print(f"✓ Repository indexed at {index_path}")
219
+ if verbose:
220
+ print(f"✓ Repository indexed at {index_path}")
215
221
  except Exception as e:
216
- print(f"Error: Failed to index repository: {e}")
217
- print("Please check that the repository contains valid Elixir files.")
222
+ if verbose:
223
+ print(f"Error: Failed to index repository: {e}")
224
+ print("Please check that the repository contains valid Elixir files.")
218
225
  raise
219
226
 
220
227
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cicada-mcp
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: An Elixir module search MCP server
5
5
  Author-email: wende <wende@hey.com>
6
6
  Maintainer-email: wende <wende@hey.com>
@@ -5,15 +5,15 @@ cicada/dead_code_analyzer.py,sha256=hk3kmuFTj3K2HQpLDwrA_7GHrPc4rP9Ecg3OnrFmdh4,
5
5
  cicada/find_dead_code.py,sha256=xCheicrNbYhLvrPGgqVJJBbf_rAm_gXwnfONDWPnNI0,8288
6
6
  cicada/formatter.py,sha256=wwxD1nt1ub7HDeDRGc61JhpmgleNVlp0SfQG9QBgGns,36194
7
7
  cicada/git_helper.py,sha256=zhyqSfk90tCwndWYxhh-LxFmqqXB1Wki91uDkZRr7Js,24303
8
- cicada/indexer.py,sha256=gVj6Jwc-sZgcGZnueqpRqcn4Wu451qo6RVfGuQahaZ4,25249
8
+ cicada/indexer.py,sha256=eK8OrxI0wHl-mm61aoP7kpj1qBQGIKqwKhx-_ydt1gQ,25897
9
9
  cicada/install.py,sha256=VU7OI031cM0S-Y7udXVRFs2hluQRI9S6tIm3XBLJL2w,23980
10
10
  cicada/keyword_search.py,sha256=pj5zSsYKX-pOeWyGI53ZRAZm91BnrEMHofGNoenoIqQ,21746
11
11
  cicada/lightweight_keyword_extractor.py,sha256=KtxcOjLPuoY6EjcWNvHvoZswcg9IoryMfG4EM3_LDMg,9172
12
- cicada/mcp_server.py,sha256=k_JnwQExgQ-dTAA-MfPTl8G02B9MEmVZJb8fAc_UnPY,60299
12
+ cicada/mcp_server.py,sha256=Fq_2BiCzASBBjgQrPheJJXPxM6z7IEiDDrzsWhc68Xg,59774
13
13
  cicada/mcp_tools.py,sha256=LHNyrpztmY0yk1Ysu3_I-ZE7KmngJJ0ukKd-1OJpenA,13805
14
14
  cicada/parser.py,sha256=uQlzYnQQicUWU-yF9LgvqDK-83xImzGlZOkjPoov8_I,4022
15
15
  cicada/pr_finder.py,sha256=FPSaGe5W4RwPi93VmyoIWcUZIaHLZdHsT7s_WCIvHBM,14214
16
- cicada/setup.py,sha256=23TRe2dRQNG2XsTobwN4jpfQ6aOTRXp_cRp1zHqv6CI,9512
16
+ cicada/setup.py,sha256=Ru52J_ZRx09GUXrTJRuOWZI85k6wSaqOuRpmSWSJvE0,9773
17
17
  cicada/version_check.py,sha256=c8BFl--ohKfLZYe_3tX40rKXydTR6FVGWiseGuIvcBk,3181
18
18
  cicada/extractors/__init__.py,sha256=Dnm_jjWMGPvaGmt1aZqcgpS964tak4hys5BFOjbCcg8,890
19
19
  cicada/extractors/base.py,sha256=reenF-Cngpg1LgueWsddYzGcmtHElSuNv1F5OlZRFpI,2487
@@ -39,9 +39,9 @@ cicada/utils/signature_builder.py,sha256=O76JfypSESNncQ_OppCAR7aUDz4ocBNPXEmI9uh
39
39
  cicada/utils/storage.py,sha256=wbw_Ma77v4uevDGTQP06Eu4m5V8IU6GkKUARYWXgj1A,2578
40
40
  cicada/utils/subprocess_runner.py,sha256=fibqu_YCCmQPvtTwaDkGkVyhGVSQ6oX235pBYavQW5M,5168
41
41
  cicada/utils/text_utils.py,sha256=_lt_65BcAVZa36QrTY84GR8v5m5oxvfPY3tr6PoNaxw,2923
42
- cicada_mcp-0.1.5.dist-info/licenses/LICENSE,sha256=ijMI5EAN1o3jl676-BOu0ELzlsBr2FqTRzmha9e1lug,1062
43
- cicada_mcp-0.1.5.dist-info/METADATA,sha256=h0oThL5OxMrls5uEubs4LQOJCK9p8yx-MkFQHzaVq7o,19952
44
- cicada_mcp-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
- cicada_mcp-0.1.5.dist-info/entry_points.txt,sha256=cwG5-3TwDGwFPiKiOC5gjlfvi9mBFc01EVtX2ZcXpcQ,317
46
- cicada_mcp-0.1.5.dist-info/top_level.txt,sha256=xZCtaMDbCi2CKA5PExum99ZU54IJg5iognV-k44a1W0,7
47
- cicada_mcp-0.1.5.dist-info/RECORD,,
42
+ cicada_mcp-0.1.7.dist-info/licenses/LICENSE,sha256=ijMI5EAN1o3jl676-BOu0ELzlsBr2FqTRzmha9e1lug,1062
43
+ cicada_mcp-0.1.7.dist-info/METADATA,sha256=ydnq27gKEEAabFUHZ4yXnkKZNyNYfTG3oUlmC_Jy7Pg,19952
44
+ cicada_mcp-0.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
+ cicada_mcp-0.1.7.dist-info/entry_points.txt,sha256=cwG5-3TwDGwFPiKiOC5gjlfvi9mBFc01EVtX2ZcXpcQ,317
46
+ cicada_mcp-0.1.7.dist-info/top_level.txt,sha256=xZCtaMDbCi2CKA5PExum99ZU54IJg5iognV-k44a1W0,7
47
+ cicada_mcp-0.1.7.dist-info/RECORD,,