mcp-code-indexer 4.2.13__py3-none-any.whl → 4.2.15__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 +66 -1
- {mcp_code_indexer-4.2.13.dist-info → mcp_code_indexer-4.2.15.dist-info}/METADATA +3 -3
- {mcp_code_indexer-4.2.13.dist-info → mcp_code_indexer-4.2.15.dist-info}/RECORD +6 -6
- {mcp_code_indexer-4.2.13.dist-info → mcp_code_indexer-4.2.15.dist-info}/LICENSE +0 -0
- {mcp_code_indexer-4.2.13.dist-info → mcp_code_indexer-4.2.15.dist-info}/WHEEL +0 -0
- {mcp_code_indexer-4.2.13.dist-info → mcp_code_indexer-4.2.15.dist-info}/entry_points.txt +0 -0
mcp_code_indexer/main.py
CHANGED
|
@@ -1095,7 +1095,46 @@ async def main() -> None:
|
|
|
1095
1095
|
if transport:
|
|
1096
1096
|
transport.server = server
|
|
1097
1097
|
|
|
1098
|
-
|
|
1098
|
+
# If vector mode is enabled, we need to handle signals properly
|
|
1099
|
+
# because server.run() may not respond to KeyboardInterrupt
|
|
1100
|
+
if args.vector and vector_daemon_task:
|
|
1101
|
+
# Setup signal handling for graceful shutdown
|
|
1102
|
+
shutdown_event = asyncio.Event()
|
|
1103
|
+
|
|
1104
|
+
def signal_handler():
|
|
1105
|
+
logger.info("Shutdown signal received")
|
|
1106
|
+
shutdown_event.set()
|
|
1107
|
+
|
|
1108
|
+
# Register signal handlers
|
|
1109
|
+
loop = asyncio.get_running_loop()
|
|
1110
|
+
for sig in [signal.SIGTERM, signal.SIGINT]:
|
|
1111
|
+
loop.add_signal_handler(sig, signal_handler)
|
|
1112
|
+
|
|
1113
|
+
# Run server and wait for shutdown signal
|
|
1114
|
+
server_task = asyncio.create_task(server.run())
|
|
1115
|
+
shutdown_task = asyncio.create_task(shutdown_event.wait())
|
|
1116
|
+
|
|
1117
|
+
try:
|
|
1118
|
+
# Wait for either server completion or shutdown signal
|
|
1119
|
+
done, pending = await asyncio.wait(
|
|
1120
|
+
[server_task, shutdown_task],
|
|
1121
|
+
return_when=asyncio.FIRST_COMPLETED
|
|
1122
|
+
)
|
|
1123
|
+
|
|
1124
|
+
# Cancel remaining tasks
|
|
1125
|
+
for task in pending:
|
|
1126
|
+
task.cancel()
|
|
1127
|
+
try:
|
|
1128
|
+
await task
|
|
1129
|
+
except asyncio.CancelledError:
|
|
1130
|
+
pass
|
|
1131
|
+
|
|
1132
|
+
except Exception as e:
|
|
1133
|
+
logger.error(f"Error during server execution: {e}")
|
|
1134
|
+
raise
|
|
1135
|
+
else:
|
|
1136
|
+
# Normal mode - let server handle KeyboardInterrupt naturally
|
|
1137
|
+
await server.run()
|
|
1099
1138
|
|
|
1100
1139
|
except Exception as e:
|
|
1101
1140
|
error_handler.log_error(e, context={"phase": "startup"})
|
|
@@ -1129,6 +1168,19 @@ async def main() -> None:
|
|
|
1129
1168
|
)
|
|
1130
1169
|
except asyncio.TimeoutError:
|
|
1131
1170
|
logger.warning("Some tasks did not cancel within timeout")
|
|
1171
|
+
|
|
1172
|
+
# Force close any remaining connections and cleanup resources
|
|
1173
|
+
try:
|
|
1174
|
+
# Give a moment for final cleanup
|
|
1175
|
+
await asyncio.sleep(0.1)
|
|
1176
|
+
|
|
1177
|
+
# Shutdown the event loop executor to stop any background threads
|
|
1178
|
+
loop = asyncio.get_running_loop()
|
|
1179
|
+
if hasattr(loop, '_default_executor') and loop._default_executor:
|
|
1180
|
+
loop._default_executor.shutdown(wait=False)
|
|
1181
|
+
|
|
1182
|
+
except Exception as e:
|
|
1183
|
+
logger.warning(f"Error during final cleanup: {e}")
|
|
1132
1184
|
|
|
1133
1185
|
|
|
1134
1186
|
def cli_main() -> None:
|
|
@@ -1146,6 +1198,19 @@ def cli_main() -> None:
|
|
|
1146
1198
|
print(f"Server failed to start: {e}", file=sys.stderr)
|
|
1147
1199
|
print(f"Traceback: {traceback.format_exc()}", file=sys.stderr)
|
|
1148
1200
|
sys.exit(1)
|
|
1201
|
+
finally:
|
|
1202
|
+
# Force cleanup of any remaining resources to prevent hanging
|
|
1203
|
+
import threading
|
|
1204
|
+
import time
|
|
1205
|
+
|
|
1206
|
+
# Give main threads a moment to finish
|
|
1207
|
+
time.sleep(0.1)
|
|
1208
|
+
|
|
1209
|
+
# Force exit if daemon threads are preventing shutdown
|
|
1210
|
+
active_threads = threading.active_count()
|
|
1211
|
+
if active_threads > 1: # More than just the main thread
|
|
1212
|
+
import os
|
|
1213
|
+
os._exit(0)
|
|
1149
1214
|
|
|
1150
1215
|
|
|
1151
1216
|
if __name__ == "__main__":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: mcp-code-indexer
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.15
|
|
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
|
-
[](https://badge.fury.io/py/mcp-code-indexer)
|
|
52
|
+
[](https://pypi.org/project/mcp-code-indexer/)
|
|
53
53
|
[](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=
|
|
22
|
+
mcp_code_indexer/main.py,sha256=tHZqJJS6Vhhcy8hQ_XqefvFh30xmJtUypQkc7g0Rmh8,41020
|
|
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
|
|
@@ -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.
|
|
62
|
-
mcp_code_indexer-4.2.
|
|
63
|
-
mcp_code_indexer-4.2.
|
|
64
|
-
mcp_code_indexer-4.2.
|
|
65
|
-
mcp_code_indexer-4.2.
|
|
61
|
+
mcp_code_indexer-4.2.15.dist-info/LICENSE,sha256=JN9dyPPgYwH9C-UjYM7FLNZjQ6BF7kAzpF3_4PwY4rY,1086
|
|
62
|
+
mcp_code_indexer-4.2.15.dist-info/METADATA,sha256=uvw8cXzWPipiZZWhxopUfvJ3192lzdnC7ct5Nv_ApVo,27484
|
|
63
|
+
mcp_code_indexer-4.2.15.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
64
|
+
mcp_code_indexer-4.2.15.dist-info/entry_points.txt,sha256=UABj7HZ0mC6rvF22gxaz2LLNLGQShTrFmp5u00iUtvo,67
|
|
65
|
+
mcp_code_indexer-4.2.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|