db-connect-mcp 0.1.2__tar.gz → 0.1.4__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 (26) hide show
  1. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/PKG-INFO +44 -44
  2. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/README.md +39 -42
  3. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/pyproject.toml +6 -3
  4. db_connect_mcp-0.1.4/src/db_connect_mcp/__main__.py +6 -0
  5. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/server.py +18 -2
  6. db_connect_mcp-0.1.2/src/db_connect_mcp/__main__.py +0 -13
  7. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/.gitignore +0 -0
  8. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/LICENSE +0 -0
  9. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/__init__.py +0 -0
  10. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/adapters/__init__.py +0 -0
  11. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/adapters/base.py +0 -0
  12. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/adapters/clickhouse.py +0 -0
  13. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/adapters/mysql.py +0 -0
  14. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/adapters/postgresql.py +0 -0
  15. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/core/__init__.py +0 -0
  16. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/core/analyzer.py +0 -0
  17. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/core/connection.py +0 -0
  18. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/core/executor.py +0 -0
  19. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/core/inspector.py +0 -0
  20. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/models/__init__.py +0 -0
  21. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/models/capabilities.py +0 -0
  22. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/models/config.py +0 -0
  23. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/models/database.py +0 -0
  24. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/models/query.py +0 -0
  25. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/models/statistics.py +0 -0
  26. {db_connect_mcp-0.1.2 → db_connect_mcp-0.1.4}/src/db_connect_mcp/models/table.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: db-connect-mcp
3
- Version: 0.1.2
3
+ Version: 0.1.4
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,10 +4,10 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "db-connect-mcp"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  description = "Multi-database MCP server for PostgreSQL, MySQL, and ClickHouse"
9
9
  readme = "README.md"
10
- requires-python = ">=3.13"
10
+ requires-python = ">=3.10"
11
11
  license = { text = "MIT" }
12
12
  authors = [{ name = "Yuri Gui", email = "yugui923@users.noreply.github.com" }]
13
13
  keywords = [
@@ -25,6 +25,9 @@ classifiers = [
25
25
  "Intended Audience :: Developers",
26
26
  "License :: OSI Approved :: MIT License",
27
27
  "Programming Language :: Python :: 3",
28
+ "Programming Language :: Python :: 3.10",
29
+ "Programming Language :: Python :: 3.11",
30
+ "Programming Language :: Python :: 3.12",
28
31
  "Programming Language :: Python :: 3.13",
29
32
  "Topic :: Database",
30
33
  "Topic :: Software Development :: Libraries :: Python Modules",
@@ -47,7 +50,7 @@ Repository = "https://github.com/yugui923/db-connect-mcp"
47
50
  Issues = "https://github.com/yugui923/db-connect-mcp/issues"
48
51
 
49
52
  [project.scripts]
50
- db-connect-mcp = "db_connect_mcp.server:main"
53
+ db-connect-mcp = "db_connect_mcp.server:cli_entry"
51
54
 
52
55
  [dependency-groups]
53
56
  dev = [
@@ -0,0 +1,6 @@
1
+ """Entry point for running db_connect_mcp as a module."""
2
+
3
+ from db_connect_mcp.server import cli_entry
4
+
5
+ if __name__ == "__main__":
6
+ cli_entry()
@@ -488,9 +488,25 @@ async def main() -> None:
488
488
  await mcp_server.cleanup()
489
489
 
490
490
 
491
- if __name__ == "__main__":
491
+ def cli_entry() -> None:
492
+ """
493
+ Synchronous entry point for console script.
494
+
495
+ This function is called by the 'db-connect-mcp' console script.
496
+ It sets up the event loop and runs the async main() function.
497
+ """
492
498
  # Windows-specific event loop policy
493
499
  if os.name == "nt":
494
500
  asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy()) # type: ignore[attr-defined]
495
501
 
496
- asyncio.run(main())
502
+ try:
503
+ asyncio.run(main())
504
+ except KeyboardInterrupt:
505
+ logger.info("Server stopped by user")
506
+ except Exception as e:
507
+ logger.error(f"Server error: {e}", exc_info=True)
508
+ raise
509
+
510
+
511
+ if __name__ == "__main__":
512
+ cli_entry()
@@ -1,13 +0,0 @@
1
- """Entry point for running db_connect_mcp as a module."""
2
-
3
- import asyncio
4
- import sys
5
-
6
- from db_connect_mcp.server import main
7
-
8
- if __name__ == "__main__":
9
- # Windows-specific event loop policy
10
- if sys.platform == "win32":
11
- asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy()) # type: ignore[attr-defined]
12
-
13
- asyncio.run(main())
File without changes