db-connect-mcp 0.1.0__tar.gz → 0.1.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.

Potentially problematic release.


This version of db-connect-mcp might be problematic. Click here for more details.

Files changed (25) hide show
  1. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/PKG-INFO +44 -44
  2. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/README.md +39 -42
  3. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/pyproject.toml +9 -9
  4. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/adapters/base.py +11 -5
  5. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/.gitignore +0 -0
  6. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/LICENSE +0 -0
  7. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/__init__.py +0 -0
  8. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/__main__.py +0 -0
  9. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/adapters/__init__.py +0 -0
  10. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/adapters/clickhouse.py +0 -0
  11. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/adapters/mysql.py +0 -0
  12. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/adapters/postgresql.py +0 -0
  13. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/core/__init__.py +0 -0
  14. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/core/analyzer.py +0 -0
  15. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/core/connection.py +0 -0
  16. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/core/executor.py +0 -0
  17. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/core/inspector.py +0 -0
  18. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/models/__init__.py +0 -0
  19. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/models/capabilities.py +0 -0
  20. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/models/config.py +0 -0
  21. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/models/database.py +0 -0
  22. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/models/query.py +0 -0
  23. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/models/statistics.py +0 -0
  24. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/models/table.py +0 -0
  25. {db_connect_mcp-0.1.0 → db_connect_mcp-0.1.3}/src/db_connect_mcp/server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: db-connect-mcp
3
- Version: 0.1.0
3
+ Version: 0.1.3
4
4
  Summary: Multi-database MCP server for PostgreSQL, MySQL, and ClickHouse
5
5
  Project-URL: Homepage, https://github.com/yugui923/db-connect-mcp
6
6
  Project-URL: Repository, https://github.com/yugui923/db-connect-mcp
@@ -14,10 +14,13 @@ Classifier: Framework :: AsyncIO
14
14
  Classifier: Intended Audience :: Developers
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
17
20
  Classifier: Programming Language :: Python :: 3.13
18
21
  Classifier: Topic :: Database
19
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
- Requires-Python: >=3.13
23
+ Requires-Python: >=3.10
21
24
  Requires-Dist: aiomysql>=0.2.0
22
25
  Requires-Dist: asyncpg>=0.29.0
23
26
  Requires-Dist: clickhouse-connect>=0.7.0
@@ -57,8 +60,7 @@ A read-only MCP (Model Context Protocol) server for exploratory data analysis ac
57
60
  {
58
61
  "mcpServers": {
59
62
  "db-connect": {
60
- "command": "uv",
61
- "args": ["run", "python", "C:/path/to/db-connect-mcp/main.py"],
63
+ "command": "db-connect-mcp",
62
64
  "env": {
63
65
  "DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
64
66
  }
@@ -102,7 +104,7 @@ A read-only MCP (Model Context Protocol) server for exploratory data analysis ac
102
104
  ## Installation
103
105
 
104
106
  ### Prerequisites
105
- - Python 3.13 or higher
107
+ - Python 3.10 or higher
106
108
  - One or more of:
107
109
  - PostgreSQL database (9.6+)
108
110
  - MySQL/MariaDB database (5.7+/10.2+)
@@ -270,14 +272,13 @@ If installed from PyPI:
270
272
  db-connect-mcp
271
273
  ```
272
274
 
273
- If running from source:
275
+ If running from source (development):
274
276
  ```bash
275
- python main.py
276
- ```
277
+ # Using module approach (recommended)
278
+ python -m db_connect_mcp
277
279
 
278
- Or with uv:
279
- ```bash
280
- uv run python main.py
280
+ # Or using uv
281
+ uv run db-connect-mcp
281
282
  ```
282
283
 
283
284
  ### Using with Claude Desktop
@@ -299,14 +300,14 @@ Add the server to your Claude Desktop configuration (`claude_desktop_config.json
299
300
  }
300
301
  ```
301
302
 
302
- #### If installed from source:
303
+ #### If running from source (development):
303
304
 
304
305
  ```json
305
306
  {
306
307
  "mcpServers": {
307
308
  "db-connect": {
308
309
  "command": "python",
309
- "args": ["C:/path/to/db-connect-mcp/main.py"],
310
+ "args": ["-m", "db_connect_mcp"],
310
311
  "env": {
311
312
  "DATABASE_URL": "postgresql+asyncpg://user:pass@host:5432/db"
312
313
  }
@@ -315,14 +316,14 @@ Add the server to your Claude Desktop configuration (`claude_desktop_config.json
315
316
  }
316
317
  ```
317
318
 
318
- #### Or using uv (for source installation):
319
+ #### Or using uv (for development with dependencies):
319
320
 
320
321
  ```json
321
322
  {
322
323
  "mcpServers": {
323
324
  "db-connect": {
324
325
  "command": "uv",
325
- "args": ["run", "python", "C:/path/to/db-connect-mcp/main.py"],
326
+ "args": ["--directory", "C:/path/to/db-connect-mcp", "run", "db-connect-mcp"],
326
327
  "env": {
327
328
  "DATABASE_URL": "mysql+aiomysql://user:pass@host:3306/db"
328
329
  }
@@ -336,15 +337,13 @@ You can configure multiple database connections:
336
337
  {
337
338
  "mcpServers": {
338
339
  "postgres-prod": {
339
- "command": "uv",
340
- "args": ["run", "python", "C:/path/to/db-connect-mcp/main.py"],
340
+ "command": "db-connect-mcp",
341
341
  "env": {
342
342
  "DATABASE_URL": "postgresql+asyncpg://user:pass@pg-host:5432/db"
343
343
  }
344
344
  },
345
345
  "mysql-analytics": {
346
- "command": "uv",
347
- "args": ["run", "python", "C:/path/to/db-connect-mcp/main.py"],
346
+ "command": "db-connect-mcp",
348
347
  "env": {
349
348
  "DATABASE_URL": "mysql+aiomysql://user:pass@mysql-host:3306/analytics"
350
349
  }
@@ -470,35 +469,36 @@ Once configured, you can use the server in Claude:
470
469
  ```
471
470
  db-connect-mcp/
472
471
  ├── src/
473
- ├── adapters/ # Database-specific adapters
474
- ├── __init__.py
475
- │ ├── base.py # Base adapter interface
476
- │ ├── postgresql.py # PostgreSQL adapter
477
- │ ├── mysql.py # MySQL adapter
478
- └── clickhouse.py # ClickHouse adapter
479
- ├── core/ # Core functionality
480
- ├── __init__.py
481
- │ ├── connection.py # Database connection management
482
- │ ├── executor.py # Query execution
483
- │ ├── inspector.py # Metadata inspection
484
- └── analyzer.py # Statistical analysis
485
- ├── models/ # Data models
486
- ├── __init__.py
487
- │ ├── capabilities.py # Database capabilities
488
- │ ├── config.py # Configuration models
489
- │ ├── database.py # Database models
490
- │ ├── query.py # Query models
491
- │ ├── statistics.py # Statistics models
492
- └── table.py # Table metadata models
493
- ├── __init__.py
494
- ├── __main__.py
495
- └── server.py # Main MCP server implementation
472
+ └── db_connect_mcp/
473
+ ├── adapters/ # Database-specific adapters
474
+ │ ├── __init__.py
475
+ │ ├── base.py # Base adapter interface
476
+ │ ├── postgresql.py # PostgreSQL adapter
477
+ ├── mysql.py # MySQL adapter
478
+ └── clickhouse.py # ClickHouse adapter
479
+ ├── core/ # Core functionality
480
+ │ ├── __init__.py
481
+ │ ├── connection.py # Database connection management
482
+ │ ├── executor.py # Query execution
483
+ ├── inspector.py # Metadata inspection
484
+ └── analyzer.py # Statistical analysis
485
+ ├── models/ # Data models
486
+ │ ├── __init__.py
487
+ │ ├── capabilities.py # Database capabilities
488
+ │ ├── config.py # Configuration models
489
+ │ ├── database.py # Database models
490
+ │ ├── query.py # Query models
491
+ ├── statistics.py # Statistics models
492
+ └── table.py # Table metadata models
493
+ ├── __init__.py
494
+ ├── __main__.py # Module entry point
495
+ │ └── server.py # Main MCP server implementation
496
496
  ├── tests/
497
497
  │ ├── conftest.py # Test configuration
498
498
  │ └── test_server.py # Integration tests
499
499
  ├── .env.example # Example environment configuration
500
- ├── main.py # Entry point
501
- ├── pyproject.toml # Project dependencies
500
+ ├── main.py # Legacy entry point (optional)
501
+ ├── pyproject.toml # Project dependencies and console scripts
502
502
  └── README.md # This file
503
503
  ```
504
504
 
@@ -28,8 +28,7 @@ A read-only MCP (Model Context Protocol) server for exploratory data analysis ac
28
28
  {
29
29
  "mcpServers": {
30
30
  "db-connect": {
31
- "command": "uv",
32
- "args": ["run", "python", "C:/path/to/db-connect-mcp/main.py"],
31
+ "command": "db-connect-mcp",
33
32
  "env": {
34
33
  "DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
35
34
  }
@@ -73,7 +72,7 @@ A read-only MCP (Model Context Protocol) server for exploratory data analysis ac
73
72
  ## Installation
74
73
 
75
74
  ### Prerequisites
76
- - Python 3.13 or higher
75
+ - Python 3.10 or higher
77
76
  - One or more of:
78
77
  - PostgreSQL database (9.6+)
79
78
  - MySQL/MariaDB database (5.7+/10.2+)
@@ -241,14 +240,13 @@ If installed from PyPI:
241
240
  db-connect-mcp
242
241
  ```
243
242
 
244
- If running from source:
243
+ If running from source (development):
245
244
  ```bash
246
- python main.py
247
- ```
245
+ # Using module approach (recommended)
246
+ python -m db_connect_mcp
248
247
 
249
- Or with uv:
250
- ```bash
251
- uv run python main.py
248
+ # Or using uv
249
+ uv run db-connect-mcp
252
250
  ```
253
251
 
254
252
  ### Using with Claude Desktop
@@ -270,14 +268,14 @@ Add the server to your Claude Desktop configuration (`claude_desktop_config.json
270
268
  }
271
269
  ```
272
270
 
273
- #### If installed from source:
271
+ #### If running from source (development):
274
272
 
275
273
  ```json
276
274
  {
277
275
  "mcpServers": {
278
276
  "db-connect": {
279
277
  "command": "python",
280
- "args": ["C:/path/to/db-connect-mcp/main.py"],
278
+ "args": ["-m", "db_connect_mcp"],
281
279
  "env": {
282
280
  "DATABASE_URL": "postgresql+asyncpg://user:pass@host:5432/db"
283
281
  }
@@ -286,14 +284,14 @@ Add the server to your Claude Desktop configuration (`claude_desktop_config.json
286
284
  }
287
285
  ```
288
286
 
289
- #### Or using uv (for source installation):
287
+ #### Or using uv (for development with dependencies):
290
288
 
291
289
  ```json
292
290
  {
293
291
  "mcpServers": {
294
292
  "db-connect": {
295
293
  "command": "uv",
296
- "args": ["run", "python", "C:/path/to/db-connect-mcp/main.py"],
294
+ "args": ["--directory", "C:/path/to/db-connect-mcp", "run", "db-connect-mcp"],
297
295
  "env": {
298
296
  "DATABASE_URL": "mysql+aiomysql://user:pass@host:3306/db"
299
297
  }
@@ -307,15 +305,13 @@ You can configure multiple database connections:
307
305
  {
308
306
  "mcpServers": {
309
307
  "postgres-prod": {
310
- "command": "uv",
311
- "args": ["run", "python", "C:/path/to/db-connect-mcp/main.py"],
308
+ "command": "db-connect-mcp",
312
309
  "env": {
313
310
  "DATABASE_URL": "postgresql+asyncpg://user:pass@pg-host:5432/db"
314
311
  }
315
312
  },
316
313
  "mysql-analytics": {
317
- "command": "uv",
318
- "args": ["run", "python", "C:/path/to/db-connect-mcp/main.py"],
314
+ "command": "db-connect-mcp",
319
315
  "env": {
320
316
  "DATABASE_URL": "mysql+aiomysql://user:pass@mysql-host:3306/analytics"
321
317
  }
@@ -441,35 +437,36 @@ Once configured, you can use the server in Claude:
441
437
  ```
442
438
  db-connect-mcp/
443
439
  ├── src/
444
- ├── adapters/ # Database-specific adapters
445
- ├── __init__.py
446
- │ ├── base.py # Base adapter interface
447
- │ ├── postgresql.py # PostgreSQL adapter
448
- │ ├── mysql.py # MySQL adapter
449
- └── clickhouse.py # ClickHouse adapter
450
- ├── core/ # Core functionality
451
- ├── __init__.py
452
- │ ├── connection.py # Database connection management
453
- │ ├── executor.py # Query execution
454
- │ ├── inspector.py # Metadata inspection
455
- └── analyzer.py # Statistical analysis
456
- ├── models/ # Data models
457
- ├── __init__.py
458
- │ ├── capabilities.py # Database capabilities
459
- │ ├── config.py # Configuration models
460
- │ ├── database.py # Database models
461
- │ ├── query.py # Query models
462
- │ ├── statistics.py # Statistics models
463
- └── table.py # Table metadata models
464
- ├── __init__.py
465
- ├── __main__.py
466
- └── server.py # Main MCP server implementation
440
+ └── db_connect_mcp/
441
+ ├── adapters/ # Database-specific adapters
442
+ │ ├── __init__.py
443
+ │ ├── base.py # Base adapter interface
444
+ │ ├── postgresql.py # PostgreSQL adapter
445
+ ├── mysql.py # MySQL adapter
446
+ └── clickhouse.py # ClickHouse adapter
447
+ ├── core/ # Core functionality
448
+ │ ├── __init__.py
449
+ │ ├── connection.py # Database connection management
450
+ │ ├── executor.py # Query execution
451
+ ├── inspector.py # Metadata inspection
452
+ └── analyzer.py # Statistical analysis
453
+ ├── models/ # Data models
454
+ │ ├── __init__.py
455
+ │ ├── capabilities.py # Database capabilities
456
+ │ ├── config.py # Configuration models
457
+ │ ├── database.py # Database models
458
+ │ ├── query.py # Query models
459
+ ├── statistics.py # Statistics models
460
+ └── table.py # Table metadata models
461
+ ├── __init__.py
462
+ ├── __main__.py # Module entry point
463
+ │ └── server.py # Main MCP server implementation
467
464
  ├── tests/
468
465
  │ ├── conftest.py # Test configuration
469
466
  │ └── test_server.py # Integration tests
470
467
  ├── .env.example # Example environment configuration
471
- ├── main.py # Entry point
472
- ├── pyproject.toml # Project dependencies
468
+ ├── main.py # Legacy entry point (optional)
469
+ ├── pyproject.toml # Project dependencies and console scripts
473
470
  └── README.md # This file
474
471
  ```
475
472
 
@@ -4,14 +4,12 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "db-connect-mcp"
7
- version = "0.1.0"
7
+ version = "0.1.3"
8
8
  description = "Multi-database MCP server for PostgreSQL, MySQL, and ClickHouse"
9
9
  readme = "README.md"
10
- requires-python = ">=3.13"
11
- license = {text = "MIT"}
12
- authors = [
13
- {name = "Yuri Gui", email = "yugui923@users.noreply.github.com"}
14
- ]
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Yuri Gui", email = "yugui923@users.noreply.github.com" }]
15
13
  keywords = [
16
14
  "mcp",
17
15
  "database",
@@ -20,13 +18,16 @@ keywords = [
20
18
  "clickhouse",
21
19
  "claude",
22
20
  "analysis",
23
- "data-exploration"
21
+ "data-exploration",
24
22
  ]
25
23
  classifiers = [
26
24
  "Development Status :: 4 - Beta",
27
25
  "Intended Audience :: Developers",
28
26
  "License :: OSI Approved :: MIT License",
29
27
  "Programming Language :: Python :: 3",
28
+ "Programming Language :: Python :: 3.10",
29
+ "Programming Language :: Python :: 3.11",
30
+ "Programming Language :: Python :: 3.12",
30
31
  "Programming Language :: Python :: 3.13",
31
32
  "Topic :: Database",
32
33
  "Topic :: Software Development :: Libraries :: Python Modules",
@@ -67,8 +68,7 @@ dev = [
67
68
  only-include = ["src/db_connect_mcp"]
68
69
 
69
70
  [tool.hatch.build.targets.wheel]
70
- only-include = ["src/db_connect_mcp"]
71
- sources = ["src"]
71
+ packages = ["src/db_connect_mcp"]
72
72
 
73
73
  [tool.pytest.ini_options]
74
74
  asyncio_mode = "auto"
@@ -1,7 +1,7 @@
1
1
  """Base adapter abstract class for database-specific implementations."""
2
2
 
3
3
  from abc import ABC, abstractmethod
4
- from typing import Any, Optional
4
+ from typing import Any, Optional, Union, TYPE_CHECKING
5
5
 
6
6
  from sqlalchemy.ext.asyncio import AsyncConnection
7
7
 
@@ -10,6 +10,12 @@ from db_connect_mcp.models.database import SchemaInfo
10
10
  from db_connect_mcp.models.statistics import ColumnStats, Distribution
11
11
  from db_connect_mcp.models.table import TableInfo
12
12
 
13
+ if TYPE_CHECKING:
14
+ from db_connect_mcp.core.connection import AsyncConnectionWrapper
15
+
16
+ # Type alias for connection types
17
+ ConnectionType = Union[AsyncConnection, "AsyncConnectionWrapper"]
18
+
13
19
 
14
20
  class BaseAdapter(ABC):
15
21
  """Base adapter defining database-specific interface."""
@@ -22,7 +28,7 @@ class BaseAdapter(ABC):
22
28
 
23
29
  @abstractmethod
24
30
  async def enrich_schema_info(
25
- self, conn: AsyncConnection, schema_info: SchemaInfo
31
+ self, conn: ConnectionType, schema_info: SchemaInfo
26
32
  ) -> SchemaInfo:
27
33
  """
28
34
  Enrich schema info with database-specific metadata.
@@ -38,7 +44,7 @@ class BaseAdapter(ABC):
38
44
 
39
45
  @abstractmethod
40
46
  async def enrich_table_info(
41
- self, conn: AsyncConnection, table_info: TableInfo
47
+ self, conn: ConnectionType, table_info: TableInfo
42
48
  ) -> TableInfo:
43
49
  """
44
50
  Enrich table info with database-specific metadata.
@@ -55,7 +61,7 @@ class BaseAdapter(ABC):
55
61
  @abstractmethod
56
62
  async def get_column_statistics(
57
63
  self,
58
- conn: AsyncConnection,
64
+ conn: ConnectionType,
59
65
  table_name: str,
60
66
  column_name: str,
61
67
  schema: Optional[str],
@@ -77,7 +83,7 @@ class BaseAdapter(ABC):
77
83
  @abstractmethod
78
84
  async def get_value_distribution(
79
85
  self,
80
- conn: AsyncConnection,
86
+ conn: ConnectionType,
81
87
  table_name: str,
82
88
  column_name: str,
83
89
  schema: Optional[str],
File without changes