mcp-code-indexer 4.2.8__py3-none-any.whl → 4.2.9__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.
mcp_code_indexer/main.py CHANGED
@@ -1138,10 +1138,13 @@ async def main() -> None:
1138
1138
  if vector_daemon_task and not vector_daemon_task.done():
1139
1139
  logger.info("Cancelling vector daemon")
1140
1140
  vector_daemon_task.cancel()
1141
+
1142
+ # Wait for vector daemon to finish
1143
+ if vector_daemon_task:
1141
1144
  try:
1142
1145
  await vector_daemon_task
1143
1146
  except asyncio.CancelledError:
1144
- pass
1147
+ logger.info("Vector daemon cancelled successfully")
1145
1148
 
1146
1149
 
1147
1150
  def cli_main() -> None:
@@ -38,8 +38,6 @@ class VectorDaemon:
38
38
  self.db_manager = db_manager
39
39
  self.cache_dir = cache_dir
40
40
  self.is_running = False
41
- self.shutdown_requested = False
42
- self.shutdown_event = asyncio.Event()
43
41
 
44
42
  # Process tracking
45
43
  self.monitored_projects: Set[str] = set()
@@ -56,24 +54,7 @@ class VectorDaemon:
56
54
  "last_activity": time.time(),
57
55
  }
58
56
 
59
- # Setup signal handlers will be done in start() method to access event loop
60
-
61
- def _setup_signal_handlers(self) -> None:
62
- """Setup signal handlers for graceful shutdown."""
63
- try:
64
- loop = asyncio.get_running_loop()
65
- for sig in [signal.SIGTERM, signal.SIGINT]:
66
- loop.add_signal_handler(sig, self._signal_handler, sig)
67
- if hasattr(signal, 'SIGHUP'):
68
- loop.add_signal_handler(signal.SIGHUP, self._signal_handler, signal.SIGHUP)
69
- except Exception as e:
70
- logger.warning(f"Could not setup signal handlers: {e}")
71
-
72
- def _signal_handler(self, signum: int) -> None:
73
- """Handle shutdown signals."""
74
- logger.info(f"Received signal {signum}, initiating graceful shutdown")
75
- self.shutdown_requested = True
76
- self.shutdown_event.set()
57
+ # Signal handling is delegated to the parent process
77
58
 
78
59
  async def start(self) -> None:
79
60
  """Start the vector daemon."""
@@ -83,9 +64,6 @@ class VectorDaemon:
83
64
 
84
65
  self.is_running = True
85
66
 
86
- # Setup signal handlers now that we have an event loop
87
- self._setup_signal_handlers()
88
-
89
67
  logger.info(
90
68
  "Starting vector daemon",
91
69
  extra={
@@ -119,19 +97,21 @@ class VectorDaemon:
119
97
  finally:
120
98
  await self._cleanup()
121
99
 
122
- async def _notify_shutdown(self) -> None:
123
- """Notify shutdown event (called from signal handler)."""
124
- self.shutdown_event.set()
125
-
126
100
  async def _run_until_shutdown(self) -> None:
127
101
  """Run daemon until shutdown is requested."""
128
- await self.shutdown_event.wait()
102
+ # Wait indefinitely until task is cancelled by parent process
103
+ try:
104
+ while True:
105
+ await asyncio.sleep(1.0)
106
+ except asyncio.CancelledError:
107
+ logger.info("Vector daemon shutdown requested")
108
+ raise
129
109
 
130
110
  async def _monitor_projects(self) -> None:
131
111
  """Monitor projects for vector indexing requirements."""
132
112
  logger.info("Starting project monitoring")
133
113
 
134
- while not self.shutdown_requested:
114
+ while self.is_running:
135
115
  try:
136
116
  # Get all projects that need vector indexing
137
117
  projects = await self.db_manager.get_all_projects()
@@ -176,7 +156,7 @@ class VectorDaemon:
176
156
  """Worker task to process queued items."""
177
157
  logger.info(f"Starting worker: {worker_id}")
178
158
 
179
- while not self.shutdown_requested:
159
+ while self.is_running:
180
160
  try:
181
161
  # Get task from queue with timeout
182
162
  try:
@@ -245,7 +225,7 @@ class VectorDaemon:
245
225
 
246
226
  async def _stats_reporter(self) -> None:
247
227
  """Periodically report daemon statistics."""
248
- while not self.shutdown_requested:
228
+ while self.is_running:
249
229
  try:
250
230
  uptime = time.time() - self.stats["start_time"]
251
231
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mcp-code-indexer
3
- Version: 4.2.8
3
+ Version: 4.2.9
4
4
  Summary: MCP server that tracks file descriptions across codebases, enabling AI agents to efficiently navigate and understand code through searchable summaries and token-aware overviews.
5
5
  License: MIT
6
6
  Keywords: mcp,model-context-protocol,code-indexer,ai-tools,codebase-navigation,file-descriptions,llm-tools
@@ -48,8 +48,8 @@ Description-Content-Type: text/markdown
48
48
 
49
49
  # MCP Code Indexer 🚀
50
50
 
51
- [![PyPI version](https://badge.fury.io/py/mcp-code-indexer.svg?55)](https://badge.fury.io/py/mcp-code-indexer)
52
- [![Python](https://img.shields.io/pypi/pyversions/mcp-code-indexer.svg?55)](https://pypi.org/project/mcp-code-indexer/)
51
+ [![PyPI version](https://badge.fury.io/py/mcp-code-indexer.svg?56)](https://badge.fury.io/py/mcp-code-indexer)
52
+ [![Python](https://img.shields.io/pypi/pyversions/mcp-code-indexer.svg?56)](https://pypi.org/project/mcp-code-indexer/)
53
53
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
54
54
 
55
55
  A production-ready **Model Context Protocol (MCP) server** that revolutionizes how AI agents navigate and understand codebases. Built for high-concurrency environments with advanced database resilience, the server provides instant access to intelligent descriptions, semantic search, and context-aware recommendations while maintaining 800+ writes/sec throughput.
@@ -19,7 +19,7 @@ mcp_code_indexer/error_handler.py,sha256=ylciEM-cR7E8Gmd8cfh5olcllJm0FnaYBGH86ya
19
19
  mcp_code_indexer/file_scanner.py,sha256=7Ab34lRQGeh5GBCzcSP96p4YK6LDWFGUHLXqi499UZ4,11838
20
20
  mcp_code_indexer/git_hook_handler.py,sha256=sTtZV3-Yy1Evt06R5NZclELeepM4Ia9OQoR2O6BK3Hk,45517
21
21
  mcp_code_indexer/logging_config.py,sha256=M5eVZ5PwfTROib7ISTQ522n2hUSc4hJ_wUgsrJKsTTg,10030
22
- mcp_code_indexer/main.py,sha256=fwiRj8z49oed-0L-VqMFk6P9ahrodj6DRjVzmLkvS14,38705
22
+ mcp_code_indexer/main.py,sha256=Gy986s-anJJEFaMNZRVZ8cCX-v_Q5W3Q9cNQGkwRG68,38835
23
23
  mcp_code_indexer/middleware/__init__.py,sha256=UCEPzOlZldlqFzYEfrXw1HvCDvY1jpLvyaDGUzVr2aw,368
24
24
  mcp_code_indexer/middleware/auth.py,sha256=4HkHMDZBNsyPA1VE8qF7pRNKbqG4xIDZjllENbgynxI,7258
25
25
  mcp_code_indexer/middleware/error_middleware.py,sha256=0RnKM5fK_n_7AITK2ueAqv30kLBdjU3vaWOTwWd2Xs0,11965
@@ -47,7 +47,7 @@ mcp_code_indexer/vector_mode/chunking/ast_chunker.py,sha256=GTl_6U0nSgDRRzKS07tJ
47
47
  mcp_code_indexer/vector_mode/chunking/chunk_optimizer.py,sha256=xD0zEibjt6FLBFaKHNc63-iKTtCgnOlLL_9Hc8mCrzE,19752
48
48
  mcp_code_indexer/vector_mode/chunking/language_handlers.py,sha256=YEpTVjzyJH445OjniGV05apexsfG5KVR4lwBEl4mGJc,18189
49
49
  mcp_code_indexer/vector_mode/config.py,sha256=g5p9Q4EAR20DfLv4RxaQnk3_UdysuvWS8rcsjs1vgwI,6680
50
- mcp_code_indexer/vector_mode/daemon.py,sha256=fw1gJ6_R3vCt41-uv3M8UVoHv5qHmC3PwGaFBY41Uvk,13218
50
+ mcp_code_indexer/vector_mode/daemon.py,sha256=Hzk4M5prNPWzaTjt_eaPEzyMy2PNK1QjdgQsCukfUf0,12254
51
51
  mcp_code_indexer/vector_mode/monitoring/__init__.py,sha256=9rNWCvHxRMvYumdIrPjb5K9fpOwe1Aem24hdh8gXoDM,439
52
52
  mcp_code_indexer/vector_mode/monitoring/change_detector.py,sha256=X82e_sKbJJFPhqZFJubLQb8Rs-srRtS7sh0nUOsPCPw,10338
53
53
  mcp_code_indexer/vector_mode/monitoring/file_watcher.py,sha256=AQ6YHSKXPubtprLZngeLb0othJOCNQZ7wwXUvqwphT4,15299
@@ -58,8 +58,8 @@ mcp_code_indexer/vector_mode/providers/voyage_client.py,sha256=pfm9BOx5Temf0LM-V
58
58
  mcp_code_indexer/vector_mode/security/__init__.py,sha256=itfeuysSqV-m9xuo-CMkAoucxexVfPgeOU-ieTLvdls,336
59
59
  mcp_code_indexer/vector_mode/security/patterns.py,sha256=0xaiMnZm7YXswq3hVe_DJYePE9MhWuvizApLnmXus9M,11572
60
60
  mcp_code_indexer/vector_mode/security/redactor.py,sha256=tsFzhCJ99bp4EFqQVjZ-4f8Uf3ux9X4ODVR09oJG01U,13380
61
- mcp_code_indexer-4.2.8.dist-info/LICENSE,sha256=JN9dyPPgYwH9C-UjYM7FLNZjQ6BF7kAzpF3_4PwY4rY,1086
62
- mcp_code_indexer-4.2.8.dist-info/METADATA,sha256=CZYuqiv_hWpYDHgoBLAwRYWCeKw9ZMXzrvzPVgVhc2Q,27483
63
- mcp_code_indexer-4.2.8.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
64
- mcp_code_indexer-4.2.8.dist-info/entry_points.txt,sha256=UABj7HZ0mC6rvF22gxaz2LLNLGQShTrFmp5u00iUtvo,67
65
- mcp_code_indexer-4.2.8.dist-info/RECORD,,
61
+ mcp_code_indexer-4.2.9.dist-info/LICENSE,sha256=JN9dyPPgYwH9C-UjYM7FLNZjQ6BF7kAzpF3_4PwY4rY,1086
62
+ mcp_code_indexer-4.2.9.dist-info/METADATA,sha256=7598CIN95wLAeFhJH1cgg-9I1Jc8yrTPBQb3GoIOPTY,27483
63
+ mcp_code_indexer-4.2.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
64
+ mcp_code_indexer-4.2.9.dist-info/entry_points.txt,sha256=UABj7HZ0mC6rvF22gxaz2LLNLGQShTrFmp5u00iUtvo,67
65
+ mcp_code_indexer-4.2.9.dist-info/RECORD,,