mcp-code-indexer 1.1.1__tar.gz → 1.1.2__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.
- {mcp_code_indexer-1.1.1/src/mcp_code_indexer.egg-info → mcp_code_indexer-1.1.2}/PKG-INFO +1 -1
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/pyproject.toml +1 -1
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/server/mcp_server.py +39 -27
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2/src/mcp_code_indexer.egg-info}/PKG-INFO +1 -1
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/LICENSE +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/MANIFEST.in +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/README.md +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/docs/api-reference.md +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/docs/architecture.md +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/docs/configuration.md +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/docs/contributing.md +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/migrations/001_initial.sql +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/migrations/002_performance_indexes.sql +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/requirements.txt +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/setup.cfg +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/setup.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/__init__.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/database/__init__.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/database/database.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/database/models.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/error_handler.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/file_scanner.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/logging_config.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/main.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/merge_handler.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/middleware/__init__.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/middleware/error_middleware.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/server/__init__.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/tiktoken_cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4 +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/token_counter.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/tools/__init__.py +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer.egg-info/SOURCES.txt +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer.egg-info/dependency_links.txt +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer.egg-info/entry_points.txt +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer.egg-info/requires.txt +0 -0
- {mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcp-code-indexer
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.2
|
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
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "mcp-code-indexer"
|
7
|
-
version = "1.1.
|
7
|
+
version = "1.1.2"
|
8
8
|
description = "MCP server that tracks file descriptions across codebases, enabling AI agents to efficiently navigate and understand code through searchable summaries and token-aware overviews."
|
9
9
|
readme = "README.md"
|
10
10
|
license = {text = "MIT"}
|
@@ -473,19 +473,28 @@ class MCPCodeIndexServer:
|
|
473
473
|
await self.db_manager.update_project(project)
|
474
474
|
logger.debug(f"Updated project metadata for {project.name}")
|
475
475
|
|
476
|
-
async def
|
476
|
+
async def _resolve_branch(self, project_id: str, requested_branch: str) -> str:
|
477
477
|
"""
|
478
|
-
|
479
|
-
|
478
|
+
Resolve the actual branch to use for operations.
|
479
|
+
|
480
|
+
For new projects or branches with no existing files, uses the requested branch.
|
481
|
+
For existing projects, tries to find a consistent branch to avoid data fragmentation.
|
482
|
+
|
483
|
+
Returns the resolved branch name.
|
480
484
|
"""
|
481
485
|
try:
|
482
486
|
# Get all branches and their file counts for this project
|
483
487
|
branch_counts = await self.db_manager.get_branch_file_counts(project_id)
|
484
488
|
|
489
|
+
# If no existing data, use the requested branch
|
485
490
|
if not branch_counts:
|
486
|
-
return
|
491
|
+
return requested_branch
|
492
|
+
|
493
|
+
# If requested branch has files, use it
|
494
|
+
if requested_branch in branch_counts and branch_counts[requested_branch] > 0:
|
495
|
+
return requested_branch
|
487
496
|
|
488
|
-
#
|
497
|
+
# Try common branch name variations to find existing data
|
489
498
|
common_variations = {
|
490
499
|
'main': ['master', 'develop', 'development', 'dev'],
|
491
500
|
'master': ['main', 'develop', 'development', 'dev'],
|
@@ -498,23 +507,31 @@ class MCPCodeIndexServer:
|
|
498
507
|
if requested_branch.lower() in common_variations:
|
499
508
|
for variation in common_variations[requested_branch.lower()]:
|
500
509
|
if variation in branch_counts and branch_counts[variation] > 0:
|
510
|
+
logger.info(f"Resolved branch '{requested_branch}' to existing branch '{variation}' with {branch_counts[variation]} files")
|
501
511
|
return variation
|
502
512
|
|
503
|
-
#
|
513
|
+
# If no variations found, check if we should use the main data branch
|
514
|
+
# (to avoid fragmenting data across multiple branches)
|
504
515
|
best_branch = max(branch_counts.items(), key=lambda x: x[1])
|
505
|
-
|
516
|
+
if best_branch[1] > 10: # Only if there's substantial existing data
|
517
|
+
logger.info(f"Using primary branch '{best_branch[0]}' instead of '{requested_branch}' to avoid data fragmentation")
|
518
|
+
return best_branch[0]
|
519
|
+
|
520
|
+
# Fall back to requested branch for new/small projects
|
521
|
+
return requested_branch
|
506
522
|
|
507
523
|
except Exception as e:
|
508
|
-
logger.warning(f"Error
|
509
|
-
return
|
524
|
+
logger.warning(f"Error resolving branch: {e}")
|
525
|
+
return requested_branch
|
510
526
|
|
511
527
|
async def _handle_get_file_description(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
512
528
|
"""Handle get_file_description tool calls."""
|
513
529
|
project_id = await self._get_or_create_project_id(arguments)
|
530
|
+
resolved_branch = await self._resolve_branch(project_id, arguments["branch"])
|
514
531
|
|
515
532
|
file_desc = await self.db_manager.get_file_description(
|
516
533
|
project_id=project_id,
|
517
|
-
branch=
|
534
|
+
branch=resolved_branch,
|
518
535
|
file_path=arguments["filePath"]
|
519
536
|
)
|
520
537
|
|
@@ -535,10 +552,11 @@ class MCPCodeIndexServer:
|
|
535
552
|
async def _handle_update_file_description(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
536
553
|
"""Handle update_file_description tool calls."""
|
537
554
|
project_id = await self._get_or_create_project_id(arguments)
|
555
|
+
resolved_branch = await self._resolve_branch(project_id, arguments["branch"])
|
538
556
|
|
539
557
|
file_desc = FileDescription(
|
540
558
|
project_id=project_id,
|
541
|
-
branch=
|
559
|
+
branch=resolved_branch,
|
542
560
|
file_path=arguments["filePath"],
|
543
561
|
description=arguments["description"],
|
544
562
|
file_hash=arguments.get("fileHash"),
|
@@ -558,24 +576,14 @@ class MCPCodeIndexServer:
|
|
558
576
|
async def _handle_check_codebase_size(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
559
577
|
"""Handle check_codebase_size tool calls."""
|
560
578
|
project_id = await self._get_or_create_project_id(arguments)
|
561
|
-
|
579
|
+
resolved_branch = await self._resolve_branch(project_id, arguments["branch"])
|
562
580
|
|
563
581
|
# Get file descriptions for this project/branch
|
564
582
|
file_descriptions = await self.db_manager.get_all_file_descriptions(
|
565
583
|
project_id=project_id,
|
566
|
-
branch=
|
584
|
+
branch=resolved_branch
|
567
585
|
)
|
568
586
|
|
569
|
-
# If no files found for requested branch, try to find the best available branch
|
570
|
-
if not file_descriptions:
|
571
|
-
available_branch = await self._find_best_branch(project_id, requested_branch)
|
572
|
-
if available_branch and available_branch != requested_branch:
|
573
|
-
file_descriptions = await self.db_manager.get_all_file_descriptions(
|
574
|
-
project_id=project_id,
|
575
|
-
branch=available_branch
|
576
|
-
)
|
577
|
-
logger.info(f"No files found for branch '{requested_branch}', using '{available_branch}' instead")
|
578
|
-
|
579
587
|
# Calculate total tokens
|
580
588
|
total_tokens = self.token_counter.calculate_codebase_tokens(file_descriptions)
|
581
589
|
is_large = self.token_counter.is_large_codebase(total_tokens)
|
@@ -592,12 +600,13 @@ class MCPCodeIndexServer:
|
|
592
600
|
async def _handle_find_missing_descriptions(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
593
601
|
"""Handle find_missing_descriptions tool calls."""
|
594
602
|
project_id = await self._get_or_create_project_id(arguments)
|
603
|
+
resolved_branch = await self._resolve_branch(project_id, arguments["branch"])
|
595
604
|
folder_path = Path(arguments["folderPath"])
|
596
605
|
|
597
606
|
# Get existing file descriptions
|
598
607
|
existing_descriptions = await self.db_manager.get_all_file_descriptions(
|
599
608
|
project_id=project_id,
|
600
|
-
branch=
|
609
|
+
branch=resolved_branch
|
601
610
|
)
|
602
611
|
existing_paths = {desc.file_path for desc in existing_descriptions}
|
603
612
|
|
@@ -631,12 +640,13 @@ class MCPCodeIndexServer:
|
|
631
640
|
async def _handle_search_descriptions(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
632
641
|
"""Handle search_descriptions tool calls."""
|
633
642
|
project_id = await self._get_or_create_project_id(arguments)
|
643
|
+
resolved_branch = await self._resolve_branch(project_id, arguments["branch"])
|
634
644
|
max_results = arguments.get("maxResults", 20)
|
635
645
|
|
636
646
|
# Perform search
|
637
647
|
search_results = await self.db_manager.search_file_descriptions(
|
638
648
|
project_id=project_id,
|
639
|
-
branch=
|
649
|
+
branch=resolved_branch,
|
640
650
|
query=arguments["query"],
|
641
651
|
max_results=max_results
|
642
652
|
)
|
@@ -660,11 +670,12 @@ class MCPCodeIndexServer:
|
|
660
670
|
async def _handle_get_codebase_overview(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
661
671
|
"""Handle get_codebase_overview tool calls."""
|
662
672
|
project_id = await self._get_or_create_project_id(arguments)
|
673
|
+
resolved_branch = await self._resolve_branch(project_id, arguments["branch"])
|
663
674
|
|
664
675
|
# Get all file descriptions
|
665
676
|
file_descriptions = await self.db_manager.get_all_file_descriptions(
|
666
677
|
project_id=project_id,
|
667
|
-
branch=
|
678
|
+
branch=resolved_branch
|
668
679
|
)
|
669
680
|
|
670
681
|
# Calculate total tokens
|
@@ -687,7 +698,8 @@ class MCPCodeIndexServer:
|
|
687
698
|
|
688
699
|
return {
|
689
700
|
"projectName": arguments["projectName"],
|
690
|
-
"branch":
|
701
|
+
"branch": resolved_branch,
|
702
|
+
"requestedBranch": arguments["branch"] if arguments["branch"] != resolved_branch else None,
|
691
703
|
"totalFiles": len(file_descriptions),
|
692
704
|
"totalTokens": total_tokens,
|
693
705
|
"isLarge": is_large,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcp-code-indexer
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.2
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer/middleware/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer.egg-info/dependency_links.txt
RENAMED
File without changes
|
{mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer.egg-info/entry_points.txt
RENAMED
File without changes
|
{mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer.egg-info/requires.txt
RENAMED
File without changes
|
{mcp_code_indexer-1.1.1 → mcp_code_indexer-1.1.2}/src/mcp_code_indexer.egg-info/top_level.txt
RENAMED
File without changes
|