mcp-code-indexer 1.0.7__py3-none-any.whl → 1.0.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.
@@ -189,6 +189,27 @@ class DatabaseManager:
189
189
  )
190
190
  await db.commit()
191
191
 
192
+ async def update_project(self, project: Project) -> None:
193
+ """Update an existing project record."""
194
+ async with self.get_connection() as db:
195
+ await db.execute(
196
+ """
197
+ UPDATE projects
198
+ SET name = ?, remote_origin = ?, upstream_origin = ?, aliases = ?, last_accessed = ?
199
+ WHERE id = ?
200
+ """,
201
+ (
202
+ project.name,
203
+ project.remote_origin,
204
+ project.upstream_origin,
205
+ json.dumps(project.aliases),
206
+ project.last_accessed,
207
+ project.id
208
+ )
209
+ )
210
+ await db.commit()
211
+ logger.debug(f"Updated project: {project.id}")
212
+
192
213
  # File description operations
193
214
 
194
215
  async def create_file_description(self, file_desc: FileDescription) -> None:
@@ -283,10 +283,11 @@ class MCPCodeIndexServer:
283
283
  folder_path = arguments["folderPath"]
284
284
  branch = arguments.get("branch", "main")
285
285
 
286
- # Create project ID from identifiers (normalize None values for consistent hashing)
287
- remote_key = remote_origin or ""
288
- upstream_key = upstream_origin or ""
289
- id_source = f"{project_name}:{remote_key}:{upstream_key}:{folder_path}"
286
+ # Create project ID from stable identifiers only (name + folder path)
287
+ # Normalize project name to lowercase for case-insensitive matching
288
+ # This ensures consistent project IDs regardless of case variations
289
+ normalized_name = project_name.lower()
290
+ id_source = f"{normalized_name}:{folder_path}"
290
291
  project_id = hashlib.sha256(id_source.encode()).hexdigest()[:16]
291
292
 
292
293
  # Check if project exists, create if not
@@ -294,7 +295,7 @@ class MCPCodeIndexServer:
294
295
  if not project:
295
296
  project = Project(
296
297
  id=project_id,
297
- name=project_name,
298
+ name=normalized_name, # Store normalized name for consistency
298
299
  remote_origin=remote_origin,
299
300
  upstream_origin=upstream_origin,
300
301
  aliases=[folder_path],
@@ -315,6 +316,19 @@ class MCPCodeIndexServer:
315
316
  # Update last accessed time
316
317
  await self.db_manager.update_project_access_time(project_id)
317
318
 
319
+ # Update remote/upstream origins if provided and different from existing
320
+ should_update = False
321
+ if remote_origin and project.remote_origin != remote_origin:
322
+ project.remote_origin = remote_origin
323
+ should_update = True
324
+ if upstream_origin and project.upstream_origin != upstream_origin:
325
+ project.upstream_origin = upstream_origin
326
+ should_update = True
327
+
328
+ if should_update:
329
+ await self.db_manager.update_project(project)
330
+ logger.debug(f"Updated project metadata for {project_name}")
331
+
318
332
  # Check if upstream inheritance is needed for existing project
319
333
  if upstream_origin and await self.db_manager.check_upstream_inheritance_needed(project):
320
334
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-code-indexer
3
- Version: 1.0.7
3
+ Version: 1.0.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
  Author: MCP Code Indexer Contributors
6
6
  Maintainer: MCP Code Indexer Contributors
@@ -6,17 +6,17 @@ 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
9
- mcp_code_indexer/database/database.py,sha256=rmQ30CguudV70sC5ledRwjc7dKvxJ4TjwcDZpReFDVE,17973
9
+ mcp_code_indexer/database/database.py,sha256=ROGdosQSADI7EytNkdC4RauPD9zLtHTO1mQ8SxsmPVo,18755
10
10
  mcp_code_indexer/database/models.py,sha256=3wOxHKb6j3zKPWFSwB5g1TLpI507vLNZcqsxZR4VuRs,5528
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=UVdHlQA39wH3BjleHDjEdesZcGcxSAzTYe-4Vbe_e3o,37253
14
+ mcp_code_indexer/server/mcp_server.py,sha256=QhN34Ue6jKzwRvCIxYRYrb9v3_fEVsuIUmmMP-woRqI,38023
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.7.dist-info/licenses/LICENSE,sha256=JN9dyPPgYwH9C-UjYM7FLNZjQ6BF7kAzpF3_4PwY4rY,1086
18
- mcp_code_indexer-1.0.7.dist-info/METADATA,sha256=JlErebjwDPFkFJEB5Ofn2kjiqFBn37ihNgG7z5Dnge8,11930
19
- mcp_code_indexer-1.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- mcp_code_indexer-1.0.7.dist-info/entry_points.txt,sha256=8HqWOw1Is7jOP1bvIgaSwouvT9z_Boe-9hd4NzyJOhY,68
21
- mcp_code_indexer-1.0.7.dist-info/top_level.txt,sha256=yKYCM-gMGt-cnupGfAhnZaoEsROLB6DQ1KFUuyKx4rw,17
22
- mcp_code_indexer-1.0.7.dist-info/RECORD,,
17
+ mcp_code_indexer-1.0.9.dist-info/licenses/LICENSE,sha256=JN9dyPPgYwH9C-UjYM7FLNZjQ6BF7kAzpF3_4PwY4rY,1086
18
+ mcp_code_indexer-1.0.9.dist-info/METADATA,sha256=uMXk1E3Hp0PY3yykMfBa1YyZSRPPnDW2GFYxcR9r2K8,11930
19
+ mcp_code_indexer-1.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ mcp_code_indexer-1.0.9.dist-info/entry_points.txt,sha256=8HqWOw1Is7jOP1bvIgaSwouvT9z_Boe-9hd4NzyJOhY,68
21
+ mcp_code_indexer-1.0.9.dist-info/top_level.txt,sha256=yKYCM-gMGt-cnupGfAhnZaoEsROLB6DQ1KFUuyKx4rw,17
22
+ mcp_code_indexer-1.0.9.dist-info/RECORD,,