mcp-code-indexer 3.5.3__py3-none-any.whl → 3.5.4__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/server/mcp_server.py +45 -23
- {mcp_code_indexer-3.5.3.dist-info → mcp_code_indexer-3.5.4.dist-info}/METADATA +3 -3
- {mcp_code_indexer-3.5.3.dist-info → mcp_code_indexer-3.5.4.dist-info}/RECORD +6 -6
- {mcp_code_indexer-3.5.3.dist-info → mcp_code_indexer-3.5.4.dist-info}/LICENSE +0 -0
- {mcp_code_indexer-3.5.3.dist-info → mcp_code_indexer-3.5.4.dist-info}/WHEEL +0 -0
- {mcp_code_indexer-3.5.3.dist-info → mcp_code_indexer-3.5.4.dist-info}/entry_points.txt +0 -0
@@ -850,8 +850,11 @@ class MCPCodeIndexServer:
|
|
850
850
|
if not current_basenames:
|
851
851
|
return False
|
852
852
|
|
853
|
+
# Get appropriate database manager for this folder
|
854
|
+
db_manager = await self.db_factory.get_database_manager(folder_path)
|
855
|
+
|
853
856
|
# Get files already indexed for this project
|
854
|
-
indexed_files = await
|
857
|
+
indexed_files = await db_manager.get_all_file_descriptions(project.id)
|
855
858
|
indexed_basenames = {Path(fd.file_path).name for fd in indexed_files}
|
856
859
|
|
857
860
|
if not indexed_basenames:
|
@@ -974,19 +977,21 @@ class MCPCodeIndexServer:
|
|
974
977
|
)
|
975
978
|
logger.info(f"Folder path: {arguments.get('folderPath', 'Unknown')}")
|
976
979
|
|
980
|
+
folder_path = arguments["folderPath"]
|
981
|
+
db_manager = await self.db_factory.get_database_manager(folder_path)
|
977
982
|
project_id = await self._get_or_create_project_id(arguments)
|
978
|
-
|
983
|
+
folder_path_obj = Path(folder_path)
|
979
984
|
|
980
985
|
logger.info(f"Resolved project_id: {project_id}")
|
981
986
|
|
982
987
|
# Run cleanup if needed (respects 30-minute cooldown)
|
983
988
|
cleaned_up_count = await self._run_cleanup_if_needed(
|
984
|
-
project_id=project_id, project_root=
|
989
|
+
project_id=project_id, project_root=folder_path_obj
|
985
990
|
)
|
986
991
|
|
987
992
|
# Get file descriptions for this project (after cleanup)
|
988
993
|
logger.info("Retrieving file descriptions...")
|
989
|
-
file_descriptions = await
|
994
|
+
file_descriptions = await db_manager.get_all_file_descriptions(
|
990
995
|
project_id=project_id
|
991
996
|
)
|
992
997
|
logger.info(f"Found {len(file_descriptions)} file descriptions")
|
@@ -1001,7 +1006,7 @@ class MCPCodeIndexServer:
|
|
1001
1006
|
)
|
1002
1007
|
|
1003
1008
|
# Get overview tokens if available
|
1004
|
-
overview = await
|
1009
|
+
overview = await db_manager.get_project_overview(project_id)
|
1005
1010
|
overview_tokens = 0
|
1006
1011
|
if overview and overview.overview:
|
1007
1012
|
overview_tokens = self.token_counter.count_tokens(overview.overview)
|
@@ -1041,26 +1046,28 @@ class MCPCodeIndexServer:
|
|
1041
1046
|
)
|
1042
1047
|
logger.info(f"Folder path: {arguments.get('folderPath', 'Unknown')}")
|
1043
1048
|
|
1049
|
+
folder_path = arguments["folderPath"]
|
1050
|
+
db_manager = await self.db_factory.get_database_manager(folder_path)
|
1044
1051
|
project_id = await self._get_or_create_project_id(arguments)
|
1045
|
-
|
1052
|
+
folder_path_obj = Path(folder_path)
|
1046
1053
|
|
1047
1054
|
logger.info(f"Resolved project_id: {project_id}")
|
1048
1055
|
|
1049
1056
|
# Get existing file descriptions
|
1050
1057
|
logger.info("Retrieving existing file descriptions...")
|
1051
|
-
existing_descriptions = await
|
1058
|
+
existing_descriptions = await db_manager.get_all_file_descriptions(
|
1052
1059
|
project_id=project_id
|
1053
1060
|
)
|
1054
1061
|
existing_paths = {desc.file_path for desc in existing_descriptions}
|
1055
1062
|
logger.info(f"Found {len(existing_paths)} existing descriptions")
|
1056
1063
|
|
1057
1064
|
# Scan directory for files
|
1058
|
-
logger.info(f"Scanning project directory: {
|
1059
|
-
scanner = FileScanner(
|
1065
|
+
logger.info(f"Scanning project directory: {folder_path_obj}")
|
1066
|
+
scanner = FileScanner(folder_path_obj)
|
1060
1067
|
if not scanner.is_valid_project_directory():
|
1061
|
-
logger.error(f"Invalid or inaccessible project directory: {
|
1068
|
+
logger.error(f"Invalid or inaccessible project directory: {folder_path_obj}")
|
1062
1069
|
return {
|
1063
|
-
"error": f"Invalid or inaccessible project directory: {
|
1070
|
+
"error": f"Invalid or inaccessible project directory: {folder_path_obj}"
|
1064
1071
|
}
|
1065
1072
|
|
1066
1073
|
missing_files = scanner.find_missing_files(existing_paths)
|
@@ -1097,11 +1104,13 @@ class MCPCodeIndexServer:
|
|
1097
1104
|
self, arguments: Dict[str, Any]
|
1098
1105
|
) -> Dict[str, Any]:
|
1099
1106
|
"""Handle search_descriptions tool calls."""
|
1107
|
+
folder_path = arguments["folderPath"]
|
1108
|
+
db_manager = await self.db_factory.get_database_manager(folder_path)
|
1100
1109
|
project_id = await self._get_or_create_project_id(arguments)
|
1101
1110
|
max_results = arguments.get("maxResults", 20)
|
1102
1111
|
|
1103
1112
|
# Perform search
|
1104
|
-
search_results = await
|
1113
|
+
search_results = await db_manager.search_file_descriptions(
|
1105
1114
|
project_id=project_id, query=arguments["query"], max_results=max_results
|
1106
1115
|
)
|
1107
1116
|
|
@@ -1127,10 +1136,12 @@ class MCPCodeIndexServer:
|
|
1127
1136
|
self, arguments: Dict[str, Any]
|
1128
1137
|
) -> Dict[str, Any]:
|
1129
1138
|
"""Handle get_codebase_overview tool calls."""
|
1139
|
+
folder_path = arguments["folderPath"]
|
1140
|
+
db_manager = await self.db_factory.get_database_manager(folder_path)
|
1130
1141
|
project_id = await self._get_or_create_project_id(arguments)
|
1131
1142
|
|
1132
1143
|
# Get all file descriptions
|
1133
|
-
file_descriptions = await
|
1144
|
+
file_descriptions = await db_manager.get_all_file_descriptions(
|
1134
1145
|
project_id=project_id
|
1135
1146
|
)
|
1136
1147
|
|
@@ -1195,10 +1206,12 @@ class MCPCodeIndexServer:
|
|
1195
1206
|
self, arguments: Dict[str, Any]
|
1196
1207
|
) -> Dict[str, Any]:
|
1197
1208
|
"""Handle get_codebase_overview tool calls for condensed overviews."""
|
1209
|
+
folder_path = arguments["folderPath"]
|
1210
|
+
db_manager = await self.db_factory.get_database_manager(folder_path)
|
1198
1211
|
project_id = await self._get_or_create_project_id(arguments)
|
1199
1212
|
|
1200
1213
|
# Try to get existing overview
|
1201
|
-
overview = await
|
1214
|
+
overview = await db_manager.get_project_overview(project_id)
|
1202
1215
|
|
1203
1216
|
if overview:
|
1204
1217
|
return {
|
@@ -1219,10 +1232,12 @@ class MCPCodeIndexServer:
|
|
1219
1232
|
self, arguments: Dict[str, Any]
|
1220
1233
|
) -> Dict[str, Any]:
|
1221
1234
|
"""Handle update_codebase_overview tool calls."""
|
1235
|
+
folder_path = arguments["folderPath"]
|
1236
|
+
db_manager = await self.db_factory.get_database_manager(folder_path)
|
1222
1237
|
project_id = await self._get_or_create_project_id(arguments)
|
1223
1238
|
|
1224
1239
|
# Get current file count and total tokens for context
|
1225
|
-
file_descriptions = await
|
1240
|
+
file_descriptions = await db_manager.get_all_file_descriptions(
|
1226
1241
|
project_id=project_id
|
1227
1242
|
)
|
1228
1243
|
|
@@ -1238,7 +1253,7 @@ class MCPCodeIndexServer:
|
|
1238
1253
|
total_tokens=total_tokens,
|
1239
1254
|
)
|
1240
1255
|
|
1241
|
-
await
|
1256
|
+
await db_manager.create_project_overview(overview)
|
1242
1257
|
|
1243
1258
|
return {
|
1244
1259
|
"success": True,
|
@@ -1252,11 +1267,13 @@ class MCPCodeIndexServer:
|
|
1252
1267
|
self, arguments: Dict[str, Any]
|
1253
1268
|
) -> Dict[str, Any]:
|
1254
1269
|
"""Handle get_word_frequency tool calls."""
|
1270
|
+
folder_path = arguments["folderPath"]
|
1271
|
+
db_manager = await self.db_factory.get_database_manager(folder_path)
|
1255
1272
|
project_id = await self._get_or_create_project_id(arguments)
|
1256
1273
|
limit = arguments.get("limit", 200)
|
1257
1274
|
|
1258
1275
|
# Analyze word frequency
|
1259
|
-
result = await
|
1276
|
+
result = await db_manager.analyze_word_frequency(
|
1260
1277
|
project_id=project_id, limit=limit
|
1261
1278
|
)
|
1262
1279
|
|
@@ -1273,11 +1290,13 @@ class MCPCodeIndexServer:
|
|
1273
1290
|
self, arguments: Dict[str, Any]
|
1274
1291
|
) -> Dict[str, Any]:
|
1275
1292
|
"""Handle search_codebase_overview tool calls."""
|
1293
|
+
folder_path = arguments["folderPath"]
|
1294
|
+
db_manager = await self.db_factory.get_database_manager(folder_path)
|
1276
1295
|
project_id = await self._get_or_create_project_id(arguments)
|
1277
1296
|
search_word = arguments["searchWord"].lower()
|
1278
1297
|
|
1279
1298
|
# Get the overview
|
1280
|
-
overview = await
|
1299
|
+
overview = await db_manager.get_project_overview(project_id)
|
1281
1300
|
|
1282
1301
|
if not overview or not overview.overview:
|
1283
1302
|
return {
|
@@ -1541,9 +1560,10 @@ class MCPCodeIndexServer:
|
|
1541
1560
|
total_cleaned = 0
|
1542
1561
|
|
1543
1562
|
if project_id and project_root:
|
1544
|
-
# Single project cleanup
|
1563
|
+
# Single project cleanup - use appropriate database for this project's folder
|
1545
1564
|
try:
|
1546
|
-
|
1565
|
+
folder_db_manager = await self.db_factory.get_database_manager(str(project_root))
|
1566
|
+
missing_files = await folder_db_manager.cleanup_missing_files(
|
1547
1567
|
project_id=project_id, project_root=project_root
|
1548
1568
|
)
|
1549
1569
|
total_cleaned = len(missing_files)
|
@@ -1561,7 +1581,7 @@ class MCPCodeIndexServer:
|
|
1561
1581
|
except Exception as e:
|
1562
1582
|
logger.error(f"Error during cleanup: {e}")
|
1563
1583
|
else:
|
1564
|
-
# All projects cleanup (for periodic task)
|
1584
|
+
# All projects cleanup (for periodic task) - start with global database
|
1565
1585
|
projects = await self.db_manager.get_all_projects()
|
1566
1586
|
|
1567
1587
|
for project in projects:
|
@@ -1574,8 +1594,10 @@ class MCPCodeIndexServer:
|
|
1574
1594
|
folder_path = Path(project.aliases[0])
|
1575
1595
|
if not folder_path.exists():
|
1576
1596
|
continue
|
1577
|
-
|
1578
|
-
|
1597
|
+
|
1598
|
+
# Get appropriate database manager for this project's folder
|
1599
|
+
project_db_manager = await self.db_factory.get_database_manager(str(folder_path))
|
1600
|
+
missing_files = await project_db_manager.cleanup_missing_files(
|
1579
1601
|
project_id=project.id, project_root=folder_path
|
1580
1602
|
)
|
1581
1603
|
total_cleaned += len(missing_files)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: mcp-code-indexer
|
3
|
-
Version: 3.5.
|
3
|
+
Version: 3.5.4
|
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
|
@@ -40,8 +40,8 @@ Description-Content-Type: text/markdown
|
|
40
40
|
|
41
41
|
# MCP Code Indexer 🚀
|
42
42
|
|
43
|
-
[](https://badge.fury.io/py/mcp-code-indexer)
|
44
|
+
[](https://pypi.org/project/mcp-code-indexer/)
|
45
45
|
[](https://opensource.org/licenses/MIT)
|
46
46
|
|
47
47
|
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.
|
@@ -29,12 +29,12 @@ mcp_code_indexer/migrations/004_remove_branch_dependency.sql,sha256=whZvj2qfba1-
|
|
29
29
|
mcp_code_indexer/migrations/005_remove_git_remotes.sql,sha256=vT84AaV1hyN4zq5W67hR14TgAwhW7_RNtBHrCoksxA4,1299
|
30
30
|
mcp_code_indexer/query_preprocessor.py,sha256=PLFR1T9mSn2Mkxw6-GB4GkxyfzjJ2ia3dgLPcziHfVA,5483
|
31
31
|
mcp_code_indexer/server/__init__.py,sha256=16xMcuriUOBlawRqWNBk6niwrvtv_JD5xvI36X1Vsmk,41
|
32
|
-
mcp_code_indexer/server/mcp_server.py,sha256=
|
32
|
+
mcp_code_indexer/server/mcp_server.py,sha256=H4Wf55sCFzbKuswUmTwQrxkN0mDRJFmranR_MdWbb5A,74126
|
33
33
|
mcp_code_indexer/tiktoken_cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4,sha256=Ijkht27pm96ZW3_3OFE-7xAPtR0YyTWXoRO8_-hlsqc,1681126
|
34
34
|
mcp_code_indexer/token_counter.py,sha256=e6WsyCEWMMSkMwLbcVtr5e8vEqh-kFqNmiJErCNdqHE,8220
|
35
35
|
mcp_code_indexer/tools/__init__.py,sha256=m01mxML2UdD7y5rih_XNhNSCMzQTz7WQ_T1TeOcYlnE,49
|
36
|
-
mcp_code_indexer-3.5.
|
37
|
-
mcp_code_indexer-3.5.
|
38
|
-
mcp_code_indexer-3.5.
|
39
|
-
mcp_code_indexer-3.5.
|
40
|
-
mcp_code_indexer-3.5.
|
36
|
+
mcp_code_indexer-3.5.4.dist-info/LICENSE,sha256=JN9dyPPgYwH9C-UjYM7FLNZjQ6BF7kAzpF3_4PwY4rY,1086
|
37
|
+
mcp_code_indexer-3.5.4.dist-info/METADATA,sha256=Gu4cBU4ayThBKQFPyGdkyhOqPI1HLYjtdKxlI2SV6jg,19359
|
38
|
+
mcp_code_indexer-3.5.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
39
|
+
mcp_code_indexer-3.5.4.dist-info/entry_points.txt,sha256=UABj7HZ0mC6rvF22gxaz2LLNLGQShTrFmp5u00iUtvo,67
|
40
|
+
mcp_code_indexer-3.5.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|