mcp-code-indexer 1.0.2__py3-none-any.whl → 1.0.3__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.
@@ -6,7 +6,7 @@ intelligent codebase navigation through searchable file descriptions,
6
6
  token-aware overviews, and advanced merge capabilities.
7
7
  """
8
8
 
9
- __version__ = "1.0.2"
9
+ __version__ = "1.0.3"
10
10
  __author__ = "MCP Code Indexer Contributors"
11
11
  __email__ = ""
12
12
  __license__ = "MIT"
mcp_code_indexer/main.py CHANGED
@@ -124,7 +124,9 @@ def cli_main():
124
124
  pass
125
125
  except Exception as e:
126
126
  # Log critical errors to stderr, not stdout
127
+ import traceback
127
128
  print(f"Server failed to start: {e}", file=sys.stderr)
129
+ print(f"Traceback: {traceback.format_exc()}", file=sys.stderr)
128
130
  sys.exit(1)
129
131
 
130
132
 
@@ -75,6 +75,9 @@ class MCPCodeIndexServer:
75
75
  # Register handlers
76
76
  self._register_handlers()
77
77
 
78
+ # Add debug logging for server events
79
+ self.logger.debug("MCP server instance created and handlers registered")
80
+
78
81
  self.logger.info(
79
82
  "MCP Code Index Server initialized",
80
83
  extra={"structured_data": {"initialization": {"token_limit": token_limit}}}
@@ -650,16 +653,49 @@ class MCPCodeIndexServer:
650
653
 
651
654
  async def run(self) -> None:
652
655
  """Run the MCP server."""
656
+ logger.info("Starting server initialization...")
653
657
  await self.initialize()
658
+ logger.info("Server initialization completed, starting MCP protocol...")
654
659
 
655
660
  try:
656
661
  async with stdio_server() as (read_stream, write_stream):
662
+ logger.info("stdio_server context established")
657
663
  initialization_options = self.server.create_initialization_options()
658
- await self.server.run(
659
- read_stream,
660
- write_stream,
661
- initialization_options
662
- )
664
+ logger.debug(f"Initialization options: {initialization_options}")
665
+
666
+ try:
667
+ logger.info("Starting MCP server protocol session...")
668
+ await self.server.run(
669
+ read_stream,
670
+ write_stream,
671
+ initialization_options
672
+ )
673
+ logger.info("MCP server session completed normally")
674
+ except Exception as e:
675
+ # Log the error with full traceback for debugging
676
+ import traceback
677
+ logger.error(f"MCP server session error: {e}", extra={
678
+ "structured_data": {
679
+ "error_type": type(e).__name__,
680
+ "error_message": str(e),
681
+ "traceback": traceback.format_exc()
682
+ }
683
+ })
684
+ # Re-raise to let the MCP framework handle protocol-level errors
685
+ raise
686
+
687
+ except KeyboardInterrupt:
688
+ logger.info("Server stopped by user interrupt")
689
+ except Exception as e:
690
+ import traceback
691
+ logger.error(f"Fatal server error: {e}", extra={
692
+ "structured_data": {
693
+ "error_type": type(e).__name__,
694
+ "error_message": str(e),
695
+ "traceback": traceback.format_exc()
696
+ }
697
+ })
698
+ raise
663
699
  finally:
664
700
  # Clean shutdown
665
701
  await self.shutdown()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-code-indexer
3
- Version: 1.0.2
3
+ Version: 1.0.3
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
  Author: MCP Code Indexer Contributors
6
6
  Maintainer: MCP Code Indexer Contributors
@@ -30,7 +30,7 @@ Requires-Python: >=3.9
30
30
  Description-Content-Type: text/markdown
31
31
  License-File: LICENSE
32
32
  Requires-Dist: tiktoken>=0.9.0
33
- Requires-Dist: mcp==1.0.0
33
+ Requires-Dist: mcp>=1.9.0
34
34
  Requires-Dist: gitignore_parser==0.1.11
35
35
  Requires-Dist: pydantic>=2.8.0
36
36
  Requires-Dist: aiofiles==23.2.0
@@ -1,8 +1,8 @@
1
- mcp_code_indexer/__init__.py,sha256=SqtCXmJGZ4zdPgDrCETFKwiyVSEH6W4EOApSFwdTAY0,473
1
+ mcp_code_indexer/__init__.py,sha256=ofXDjKUt-BX9vnnbzqbW-ocPaO9dDlkSb55Atk7uzA0,473
2
2
  mcp_code_indexer/error_handler.py,sha256=cNSUFFrGBMLDv4qa78c7495L1wSl_dXCRbzCJOidx-Q,11590
3
3
  mcp_code_indexer/file_scanner.py,sha256=1Z6wq7H14V1OMAHIF4v9G7SY8hC1puDmU5IXsCKH4kU,11442
4
4
  mcp_code_indexer/logging_config.py,sha256=5L1cYIG8IAX91yCjc5pzkbO_KPt0bvm_ABHB53LBZjI,5184
5
- mcp_code_indexer/main.py,sha256=TJHyXc0mchaIyF5ABo24kcT8Sv1PsJibHVZoznGbrxo,3619
5
+ mcp_code_indexer/main.py,sha256=Rou-mAN9-12PPP8jC7dIs2_UNambJuC2F8BF--j-0m8,3715
6
6
  mcp_code_indexer/merge_handler.py,sha256=lJR8eVq2qSrF6MW9mR3Fy8UzrNAaQ7RsI2FMNXne3vQ,14692
7
7
  mcp_code_indexer/token_counter.py,sha256=WrifOkbF99nWWHlRlhCHAB2KN7qr83GOHl7apE-hJcE,8460
8
8
  mcp_code_indexer/database/__init__.py,sha256=aPq_aaRp0aSwOBIq9GkuMNjmLxA411zg2vhdrAuHm-w,38
@@ -11,12 +11,12 @@ mcp_code_indexer/database/models.py,sha256=3wOxHKb6j3zKPWFSwB5g1TLpI507vLNZcqsxZ
11
11
  mcp_code_indexer/middleware/__init__.py,sha256=p-mP0pMsfiU2yajCPvokCUxUEkh_lu4XJP1LyyMW2ug,220
12
12
  mcp_code_indexer/middleware/error_middleware.py,sha256=v6jaHmPxf3qerYdb85X1tHIXLxgcbybpitKVakFLQTA,10109
13
13
  mcp_code_indexer/server/__init__.py,sha256=16xMcuriUOBlawRqWNBk6niwrvtv_JD5xvI36X1Vsmk,41
14
- mcp_code_indexer/server/mcp_server.py,sha256=6wm4XKfTLSpfHP9GpCqwWsekQFwwo9ngqM-ZXiJidx4,33424
14
+ mcp_code_indexer/server/mcp_server.py,sha256=tdBORkihjnWrAXXQVidwq9JNB9hrvR3brym0qfdNgvQ,35132
15
15
  mcp_code_indexer/tiktoken_cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4,sha256=Ijkht27pm96ZW3_3OFE-7xAPtR0YyTWXoRO8_-hlsqc,1681126
16
16
  mcp_code_indexer/tools/__init__.py,sha256=m01mxML2UdD7y5rih_XNhNSCMzQTz7WQ_T1TeOcYlnE,49
17
- mcp_code_indexer-1.0.2.dist-info/licenses/LICENSE,sha256=JN9dyPPgYwH9C-UjYM7FLNZjQ6BF7kAzpF3_4PwY4rY,1086
18
- mcp_code_indexer-1.0.2.dist-info/METADATA,sha256=u-yHVXuTl_y5Qkrb4vWMBkQWmuS6OUB2RtrzwvsnimU,11930
19
- mcp_code_indexer-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- mcp_code_indexer-1.0.2.dist-info/entry_points.txt,sha256=8HqWOw1Is7jOP1bvIgaSwouvT9z_Boe-9hd4NzyJOhY,68
21
- mcp_code_indexer-1.0.2.dist-info/top_level.txt,sha256=yKYCM-gMGt-cnupGfAhnZaoEsROLB6DQ1KFUuyKx4rw,17
22
- mcp_code_indexer-1.0.2.dist-info/RECORD,,
17
+ mcp_code_indexer-1.0.3.dist-info/licenses/LICENSE,sha256=JN9dyPPgYwH9C-UjYM7FLNZjQ6BF7kAzpF3_4PwY4rY,1086
18
+ mcp_code_indexer-1.0.3.dist-info/METADATA,sha256=yASw5zg4MI23XClkWmle327l1Sm6M_L2QDfGS5Km7M8,11930
19
+ mcp_code_indexer-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ mcp_code_indexer-1.0.3.dist-info/entry_points.txt,sha256=8HqWOw1Is7jOP1bvIgaSwouvT9z_Boe-9hd4NzyJOhY,68
21
+ mcp_code_indexer-1.0.3.dist-info/top_level.txt,sha256=yKYCM-gMGt-cnupGfAhnZaoEsROLB6DQ1KFUuyKx4rw,17
22
+ mcp_code_indexer-1.0.3.dist-info/RECORD,,