mcp-code-indexer 3.0.0__tar.gz → 3.0.3__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-3.0.0 → mcp_code_indexer-3.0.3}/MANIFEST.in +1 -1
- {mcp_code_indexer-3.0.0/src/mcp_code_indexer.egg-info → mcp_code_indexer-3.0.3}/PKG-INFO +3 -3
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/README.md +2 -2
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/pyproject.toml +1 -1
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/database/database.py +43 -8
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/error_handler.py +3 -1
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3/src/mcp_code_indexer}/migrations/004_remove_branch_dependency.sql +20 -2
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3/src/mcp_code_indexer.egg-info}/PKG-INFO +3 -3
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer.egg-info/SOURCES.txt +4 -4
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/LICENSE +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/docs/api-reference.md +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/docs/architecture.md +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/docs/configuration.md +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/docs/contributing.md +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/docs/database-resilience.md +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/docs/git-hook-setup.md +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/docs/monitoring.md +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/docs/performance-tuning.md +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/requirements.txt +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/setup.cfg +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/setup.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/__init__.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/__main__.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/ask_handler.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/claude_api_handler.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/cleanup_manager.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/data/stop_words_english.txt +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/database/__init__.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/database/connection_health.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/database/exceptions.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/database/models.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/database/retry_executor.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/deepask_handler.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/file_scanner.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/git_hook_handler.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/logging_config.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/main.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/merge_handler.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/middleware/__init__.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/middleware/error_middleware.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3/src/mcp_code_indexer}/migrations/001_initial.sql +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3/src/mcp_code_indexer}/migrations/002_performance_indexes.sql +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3/src/mcp_code_indexer}/migrations/003_project_overviews.sql +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/query_preprocessor.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/server/__init__.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/server/mcp_server.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/tiktoken_cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4 +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/token_counter.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/tools/__init__.py +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer.egg-info/dependency_links.txt +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer.egg-info/entry_points.txt +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer.egg-info/requires.txt +0 -0
- {mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer.egg-info/top_level.txt +0 -0
@@ -3,7 +3,7 @@ include LICENSE
|
|
3
3
|
include pyproject.toml
|
4
4
|
include requirements.txt
|
5
5
|
recursive-include src/mcp_code_indexer/tiktoken_cache *
|
6
|
-
recursive-include migrations *.sql
|
6
|
+
recursive-include src/mcp_code_indexer/migrations *.sql
|
7
7
|
recursive-include docs *.md
|
8
8
|
recursive-exclude tests *
|
9
9
|
recursive-exclude venv *
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcp-code-indexer
|
3
|
-
Version: 3.0.
|
3
|
+
Version: 3.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
|
@@ -59,8 +59,8 @@ Dynamic: requires-python
|
|
59
59
|
|
60
60
|
# MCP Code Indexer 🚀
|
61
61
|
|
62
|
-
[](https://badge.fury.io/py/mcp-code-indexer)
|
63
|
+
[](https://pypi.org/project/mcp-code-indexer/)
|
64
64
|
[](https://opensource.org/licenses/MIT)
|
65
65
|
|
66
66
|
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.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# MCP Code Indexer 🚀
|
2
2
|
|
3
|
-
[](https://badge.fury.io/py/mcp-code-indexer)
|
4
|
+
[](https://pypi.org/project/mcp-code-indexer/)
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
6
6
|
|
7
7
|
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.
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "mcp-code-indexer"
|
7
|
-
version = "3.0.
|
7
|
+
version = "3.0.3"
|
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"}
|
@@ -110,7 +110,10 @@ class DatabaseManager:
|
|
110
110
|
# Database initialization now uses the modern retry executor directly
|
111
111
|
|
112
112
|
# Apply migrations in order
|
113
|
-
|
113
|
+
# Migrations are now bundled with the package
|
114
|
+
migrations_dir = Path(__file__).parent.parent / "migrations"
|
115
|
+
if not migrations_dir.exists():
|
116
|
+
raise RuntimeError(f"Could not find migrations directory at {migrations_dir}")
|
114
117
|
migration_files = sorted(migrations_dir.glob("*.sql"))
|
115
118
|
|
116
119
|
async with aiosqlite.connect(self.db_path) as db:
|
@@ -120,16 +123,48 @@ class DatabaseManager:
|
|
120
123
|
# Configure WAL mode and optimizations for concurrent access
|
121
124
|
await self._configure_database_optimizations(db, include_wal_mode=self.enable_wal_mode)
|
122
125
|
|
123
|
-
#
|
126
|
+
# Create migrations tracking table
|
127
|
+
await db.execute('''
|
128
|
+
CREATE TABLE IF NOT EXISTS migrations (
|
129
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
130
|
+
filename TEXT UNIQUE NOT NULL,
|
131
|
+
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
132
|
+
)
|
133
|
+
''')
|
134
|
+
await db.commit()
|
135
|
+
|
136
|
+
# Get list of already applied migrations
|
137
|
+
cursor = await db.execute('SELECT filename FROM migrations')
|
138
|
+
applied_migrations = {row[0] for row in await cursor.fetchall()}
|
139
|
+
|
140
|
+
# Apply each migration that hasn't been applied yet
|
124
141
|
for migration_file in migration_files:
|
125
|
-
|
126
|
-
|
127
|
-
|
142
|
+
migration_name = migration_file.name
|
143
|
+
if migration_name in applied_migrations:
|
144
|
+
logger.info(f"Skipping already applied migration: {migration_name}")
|
145
|
+
continue
|
146
|
+
|
147
|
+
logger.info(f"Applying migration: {migration_name}")
|
148
|
+
try:
|
149
|
+
migration_sql = migration_file.read_text(encoding='utf-8')
|
150
|
+
except AttributeError:
|
151
|
+
# Fallback for regular file objects
|
152
|
+
with open(migration_file, 'r', encoding='utf-8') as f:
|
153
|
+
migration_sql = f.read()
|
128
154
|
|
129
|
-
|
130
|
-
|
155
|
+
try:
|
156
|
+
await db.executescript(migration_sql)
|
157
|
+
|
158
|
+
# Record that migration was applied
|
159
|
+
await db.execute('INSERT INTO migrations (filename) VALUES (?)', (migration_name,))
|
160
|
+
await db.commit()
|
161
|
+
logger.info(f"Successfully applied migration: {migration_name}")
|
162
|
+
except Exception as e:
|
163
|
+
logger.error(f"Failed to apply migration {migration_name}: {e}")
|
164
|
+
await db.rollback()
|
165
|
+
raise
|
131
166
|
|
132
|
-
logger.info(f"Database initialized at {self.db_path} with {len(migration_files)} migrations")
|
167
|
+
logger.info(f"Database initialized at {self.db_path} with {len(migration_files)} total migrations")
|
133
168
|
|
134
169
|
async def _configure_database_optimizations(self, db: aiosqlite.Connection, include_wal_mode: bool = True) -> None:
|
135
170
|
"""
|
@@ -254,6 +254,7 @@ class StructuredFormatter(logging.Formatter):
|
|
254
254
|
def format(self, record: logging.LogRecord) -> str:
|
255
255
|
"""Format log record as structured JSON."""
|
256
256
|
import json
|
257
|
+
from . import __version__
|
257
258
|
|
258
259
|
log_data = {
|
259
260
|
"timestamp": datetime.utcnow().isoformat(),
|
@@ -262,7 +263,8 @@ class StructuredFormatter(logging.Formatter):
|
|
262
263
|
"message": record.getMessage(),
|
263
264
|
"module": record.module,
|
264
265
|
"function": record.funcName,
|
265
|
-
"line": record.lineno
|
266
|
+
"line": record.lineno,
|
267
|
+
"version": __version__
|
266
268
|
}
|
267
269
|
|
268
270
|
# Add structured data if present
|
@@ -5,8 +5,8 @@
|
|
5
5
|
-- Ensure WAL mode is enabled for safe migrations
|
6
6
|
PRAGMA journal_mode=WAL;
|
7
7
|
|
8
|
-
--
|
9
|
-
PRAGMA foreign_keys=
|
8
|
+
-- Temporarily disable foreign key constraints for migration
|
9
|
+
PRAGMA foreign_keys=OFF;
|
10
10
|
|
11
11
|
-- Start transaction for atomic migration
|
12
12
|
BEGIN TRANSACTION;
|
@@ -33,6 +33,17 @@ CREATE INDEX idx_file_descriptions_new_file_hash ON file_descriptions_new(file_h
|
|
33
33
|
CREATE INDEX idx_file_descriptions_new_last_modified ON file_descriptions_new(last_modified);
|
34
34
|
CREATE INDEX idx_file_descriptions_new_to_be_cleaned ON file_descriptions_new(to_be_cleaned);
|
35
35
|
|
36
|
+
-- Clean up orphaned data before consolidation
|
37
|
+
-- Remove file_descriptions that reference non-existent projects
|
38
|
+
DELETE FROM file_descriptions
|
39
|
+
WHERE project_id NOT IN (SELECT id FROM projects);
|
40
|
+
|
41
|
+
-- Remove file_descriptions with invalid source_project_id
|
42
|
+
UPDATE file_descriptions
|
43
|
+
SET source_project_id = NULL
|
44
|
+
WHERE source_project_id IS NOT NULL
|
45
|
+
AND source_project_id NOT IN (SELECT id FROM projects);
|
46
|
+
|
36
47
|
-- Consolidate data from old table - keep most recent description per file
|
37
48
|
-- This handles multi-branch scenarios by selecting the newest data
|
38
49
|
INSERT INTO file_descriptions_new (
|
@@ -76,6 +87,10 @@ CREATE TABLE project_overviews_new (
|
|
76
87
|
-- Create indexes for the new table
|
77
88
|
CREATE INDEX idx_project_overviews_new_last_modified ON project_overviews_new(last_modified);
|
78
89
|
|
90
|
+
-- Clean up orphaned project overviews
|
91
|
+
DELETE FROM project_overviews
|
92
|
+
WHERE project_id NOT IN (SELECT id FROM projects);
|
93
|
+
|
79
94
|
-- Consolidate project overviews - keep the one with most tokens (most comprehensive)
|
80
95
|
INSERT INTO project_overviews_new (
|
81
96
|
project_id, overview, last_modified, total_files, total_tokens
|
@@ -162,5 +177,8 @@ END;
|
|
162
177
|
DROP INDEX IF EXISTS idx_merge_conflicts_project;
|
163
178
|
CREATE INDEX idx_merge_conflicts_project ON merge_conflicts(project_id, created);
|
164
179
|
|
180
|
+
-- Re-enable foreign key constraints
|
181
|
+
PRAGMA foreign_keys=ON;
|
182
|
+
|
165
183
|
-- Commit the migration
|
166
184
|
COMMIT;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcp-code-indexer
|
3
|
-
Version: 3.0.
|
3
|
+
Version: 3.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
|
@@ -59,8 +59,8 @@ Dynamic: requires-python
|
|
59
59
|
|
60
60
|
# MCP Code Indexer 🚀
|
61
61
|
|
62
|
-
[](https://badge.fury.io/py/mcp-code-indexer)
|
63
|
+
[](https://pypi.org/project/mcp-code-indexer/)
|
64
64
|
[](https://opensource.org/licenses/MIT)
|
65
65
|
|
66
66
|
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.
|
@@ -12,10 +12,6 @@ docs/database-resilience.md
|
|
12
12
|
docs/git-hook-setup.md
|
13
13
|
docs/monitoring.md
|
14
14
|
docs/performance-tuning.md
|
15
|
-
migrations/001_initial.sql
|
16
|
-
migrations/002_performance_indexes.sql
|
17
|
-
migrations/003_project_overviews.sql
|
18
|
-
migrations/004_remove_branch_dependency.sql
|
19
15
|
src/mcp_code_indexer/__init__.py
|
20
16
|
src/mcp_code_indexer/__main__.py
|
21
17
|
src/mcp_code_indexer/ask_handler.py
|
@@ -45,6 +41,10 @@ src/mcp_code_indexer/database/models.py
|
|
45
41
|
src/mcp_code_indexer/database/retry_executor.py
|
46
42
|
src/mcp_code_indexer/middleware/__init__.py
|
47
43
|
src/mcp_code_indexer/middleware/error_middleware.py
|
44
|
+
src/mcp_code_indexer/migrations/001_initial.sql
|
45
|
+
src/mcp_code_indexer/migrations/002_performance_indexes.sql
|
46
|
+
src/mcp_code_indexer/migrations/003_project_overviews.sql
|
47
|
+
src/mcp_code_indexer/migrations/004_remove_branch_dependency.sql
|
48
48
|
src/mcp_code_indexer/server/__init__.py
|
49
49
|
src/mcp_code_indexer/server/mcp_server.py
|
50
50
|
src/mcp_code_indexer/tiktoken_cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4
|
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-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/claude_api_handler.py
RENAMED
File without changes
|
File without changes
|
{mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/data/stop_words_english.txt
RENAMED
File without changes
|
File without changes
|
{mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/database/connection_health.py
RENAMED
File without changes
|
{mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/database/exceptions.py
RENAMED
File without changes
|
File without changes
|
{mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/database/retry_executor.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-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/middleware/__init__.py
RENAMED
File without changes
|
File without changes
|
{mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3/src/mcp_code_indexer}/migrations/001_initial.sql
RENAMED
File without changes
|
File without changes
|
File without changes
|
{mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer/query_preprocessor.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer.egg-info/dependency_links.txt
RENAMED
File without changes
|
{mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer.egg-info/entry_points.txt
RENAMED
File without changes
|
{mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer.egg-info/requires.txt
RENAMED
File without changes
|
{mcp_code_indexer-3.0.0 → mcp_code_indexer-3.0.3}/src/mcp_code_indexer.egg-info/top_level.txt
RENAMED
File without changes
|