db-connect-mcp 0.1.3__tar.gz → 0.1.5__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.
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/PKG-INFO +27 -103
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/README.md +26 -102
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/pyproject.toml +2 -2
- db_connect_mcp-0.1.5/src/db_connect_mcp/__main__.py +6 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/server.py +18 -2
- db_connect_mcp-0.1.3/src/db_connect_mcp/__main__.py +0 -13
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/.gitignore +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/LICENSE +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/__init__.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/adapters/__init__.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/adapters/base.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/adapters/clickhouse.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/adapters/mysql.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/adapters/postgresql.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/core/__init__.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/core/analyzer.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/core/connection.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/core/executor.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/core/inspector.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/models/__init__.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/models/capabilities.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/models/config.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/models/database.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/models/query.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/src/db_connect_mcp/models/statistics.py +0 -0
- {db_connect_mcp-0.1.3 → db_connect_mcp-0.1.5}/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.
|
|
3
|
+
Version: 0.1.5
|
|
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
|
|
@@ -38,29 +38,16 @@ A read-only MCP (Model Context Protocol) server for exploratory data analysis ac
|
|
|
38
38
|
|
|
39
39
|
1. **Install:**
|
|
40
40
|
```bash
|
|
41
|
-
# Option 1: From PyPI (recommended)
|
|
42
41
|
pip install db-connect-mcp
|
|
43
|
-
|
|
44
|
-
# Option 2: From source
|
|
45
|
-
git clone https://github.com/yugui923/db-connect-mcp.git
|
|
46
|
-
cd db-connect-mcp
|
|
47
|
-
uv sync
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
2. **Configure** `.env`:
|
|
51
|
-
```env
|
|
52
|
-
DATABASE_URL=postgres://user:pass@localhost:5432/mydb
|
|
53
|
-
# Also supports: postgresql://, pg://, jdbc:postgresql://
|
|
54
|
-
# MariaDB: mariadb://, jdbc:mysql://, jdbc:mariadb://
|
|
55
|
-
# ClickHouse: ch://, jdbc:clickhouse://
|
|
56
42
|
```
|
|
57
43
|
|
|
58
|
-
|
|
44
|
+
2. **Add to Claude Desktop** `claude_desktop_config.json`:
|
|
59
45
|
```json
|
|
60
46
|
{
|
|
61
47
|
"mcpServers": {
|
|
62
48
|
"db-connect": {
|
|
63
|
-
"command": "
|
|
49
|
+
"command": "python",
|
|
50
|
+
"args": ["-m", "db_connect_mcp"],
|
|
64
51
|
"env": {
|
|
65
52
|
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
|
|
66
53
|
}
|
|
@@ -69,7 +56,9 @@ A read-only MCP (Model Context Protocol) server for exploratory data analysis ac
|
|
|
69
56
|
}
|
|
70
57
|
```
|
|
71
58
|
|
|
72
|
-
|
|
59
|
+
3. **Restart Claude Desktop** and start querying your database!
|
|
60
|
+
|
|
61
|
+
> **Note**: Using `python -m db_connect_mcp` ensures the command works even if Python's Scripts directory isn't in your PATH.
|
|
73
62
|
|
|
74
63
|
## Features
|
|
75
64
|
|
|
@@ -104,48 +93,18 @@ A read-only MCP (Model Context Protocol) server for exploratory data analysis ac
|
|
|
104
93
|
## Installation
|
|
105
94
|
|
|
106
95
|
### Prerequisites
|
|
107
|
-
- Python 3.10 or higher
|
|
108
|
-
-
|
|
109
|
-
- PostgreSQL database (9.6+)
|
|
110
|
-
- MySQL/MariaDB database (5.7+/10.2+)
|
|
111
|
-
- ClickHouse database
|
|
96
|
+
- **Python 3.10 or higher**
|
|
97
|
+
- **A database**: PostgreSQL (9.6+), MySQL/MariaDB (5.7+/10.2+), or ClickHouse
|
|
112
98
|
|
|
113
|
-
###
|
|
99
|
+
### Install via pip
|
|
114
100
|
|
|
115
101
|
```bash
|
|
116
102
|
pip install db-connect-mcp
|
|
117
103
|
```
|
|
118
104
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
For development or the latest features:
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
# Clone the repository
|
|
125
|
-
git clone https://github.com/yugui923/db-connect-mcp.git
|
|
126
|
-
cd db-connect-mcp
|
|
127
|
-
|
|
128
|
-
# Install with uv (recommended)
|
|
129
|
-
uv sync
|
|
130
|
-
|
|
131
|
-
# Or install with pip
|
|
132
|
-
pip install -e .
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Method 3: Install from GitHub
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
pip install git+https://github.com/yugui923/db-connect-mcp.git
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Configuration
|
|
142
|
-
|
|
143
|
-
After installation, configure your database connection:
|
|
105
|
+
That's it! The package is now ready to use.
|
|
144
106
|
|
|
145
|
-
|
|
146
|
-
cp .env.example .env
|
|
147
|
-
# Edit .env with your database connection string
|
|
148
|
-
```
|
|
107
|
+
> **For developers**: See [Development Guide](docs/DEVELOPMENT.md) for setting up a development environment.
|
|
149
108
|
|
|
150
109
|
## Configuration
|
|
151
110
|
|
|
@@ -267,41 +226,20 @@ DATABASE_URL=ch://user:pass@host:9000/db?timeout=60&max_threads=4
|
|
|
267
226
|
|
|
268
227
|
### Running the Server
|
|
269
228
|
|
|
270
|
-
If installed from PyPI:
|
|
271
|
-
```bash
|
|
272
|
-
db-connect-mcp
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
If running from source (development):
|
|
276
229
|
```bash
|
|
277
|
-
#
|
|
230
|
+
# Run the server (works everywhere, no PATH configuration needed)
|
|
278
231
|
python -m db_connect_mcp
|
|
279
232
|
|
|
280
|
-
#
|
|
281
|
-
|
|
233
|
+
# With environment variable
|
|
234
|
+
DATABASE_URL="postgresql://user:pass@host:5432/db" python -m db_connect_mcp
|
|
282
235
|
```
|
|
283
236
|
|
|
237
|
+
> **Note**: Using `python -m db_connect_mcp` works regardless of whether Python's Scripts directory is in your PATH.
|
|
238
|
+
|
|
284
239
|
### Using with Claude Desktop
|
|
285
240
|
|
|
286
241
|
Add the server to your Claude Desktop configuration (`claude_desktop_config.json`):
|
|
287
242
|
|
|
288
|
-
#### If installed from PyPI:
|
|
289
|
-
|
|
290
|
-
```json
|
|
291
|
-
{
|
|
292
|
-
"mcpServers": {
|
|
293
|
-
"db-connect": {
|
|
294
|
-
"command": "db-connect-mcp",
|
|
295
|
-
"env": {
|
|
296
|
-
"DATABASE_URL": "postgresql+asyncpg://user:pass@host:5432/db"
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
#### If running from source (development):
|
|
304
|
-
|
|
305
243
|
```json
|
|
306
244
|
{
|
|
307
245
|
"mcpServers": {
|
|
@@ -316,34 +254,21 @@ Add the server to your Claude Desktop configuration (`claude_desktop_config.json
|
|
|
316
254
|
}
|
|
317
255
|
```
|
|
318
256
|
|
|
319
|
-
|
|
257
|
+
**Multiple database connections:**
|
|
320
258
|
|
|
321
|
-
```json
|
|
322
|
-
{
|
|
323
|
-
"mcpServers": {
|
|
324
|
-
"db-connect": {
|
|
325
|
-
"command": "uv",
|
|
326
|
-
"args": ["--directory", "C:/path/to/db-connect-mcp", "run", "db-connect-mcp"],
|
|
327
|
-
"env": {
|
|
328
|
-
"DATABASE_URL": "mysql+aiomysql://user:pass@host:3306/db"
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
You can configure multiple database connections:
|
|
336
259
|
```json
|
|
337
260
|
{
|
|
338
261
|
"mcpServers": {
|
|
339
262
|
"postgres-prod": {
|
|
340
|
-
"command": "
|
|
263
|
+
"command": "python",
|
|
264
|
+
"args": ["-m", "db_connect_mcp"],
|
|
341
265
|
"env": {
|
|
342
266
|
"DATABASE_URL": "postgresql+asyncpg://user:pass@pg-host:5432/db"
|
|
343
267
|
}
|
|
344
268
|
},
|
|
345
269
|
"mysql-analytics": {
|
|
346
|
-
"command": "
|
|
270
|
+
"command": "python",
|
|
271
|
+
"args": ["-m", "db_connect_mcp"],
|
|
347
272
|
"env": {
|
|
348
273
|
"DATABASE_URL": "mysql+aiomysql://user:pass@mysql-host:3306/analytics"
|
|
349
274
|
}
|
|
@@ -352,6 +277,8 @@ You can configure multiple database connections:
|
|
|
352
277
|
}
|
|
353
278
|
```
|
|
354
279
|
|
|
280
|
+
> **For development**: See [Development Guide](docs/DEVELOPMENT.md) for running from source with uv.
|
|
281
|
+
|
|
355
282
|
## Database Feature Support
|
|
356
283
|
|
|
357
284
|
| Feature | PostgreSQL | MySQL | ClickHouse |
|
|
@@ -465,6 +392,8 @@ Once configured, you can use the server in Claude:
|
|
|
465
392
|
|
|
466
393
|
## Development
|
|
467
394
|
|
|
395
|
+
For detailed development setup, testing, and contribution guidelines, see the [Development Guide](docs/DEVELOPMENT.md).
|
|
396
|
+
|
|
468
397
|
### Project Structure
|
|
469
398
|
```
|
|
470
399
|
db-connect-mcp/
|
|
@@ -512,13 +441,8 @@ The server uses an adapter pattern to support multiple database systems:
|
|
|
512
441
|
- **Server**: MCP server implementation that routes requests to appropriate components
|
|
513
442
|
|
|
514
443
|
### Running Tests
|
|
515
|
-
```bash
|
|
516
|
-
# Run integration tests
|
|
517
|
-
uv run python tests/test_server.py
|
|
518
444
|
|
|
519
|
-
#
|
|
520
|
-
uv run pytest tests/
|
|
521
|
-
```
|
|
445
|
+
See the [Development Guide](docs/DEVELOPMENT.md#running-tests) and [Test Guide](tests/README.md) for detailed testing instructions.
|
|
522
446
|
|
|
523
447
|
## Troubleshooting
|
|
524
448
|
|
|
@@ -6,29 +6,16 @@ A read-only MCP (Model Context Protocol) server for exploratory data analysis ac
|
|
|
6
6
|
|
|
7
7
|
1. **Install:**
|
|
8
8
|
```bash
|
|
9
|
-
# Option 1: From PyPI (recommended)
|
|
10
9
|
pip install db-connect-mcp
|
|
11
|
-
|
|
12
|
-
# Option 2: From source
|
|
13
|
-
git clone https://github.com/yugui923/db-connect-mcp.git
|
|
14
|
-
cd db-connect-mcp
|
|
15
|
-
uv sync
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
2. **Configure** `.env`:
|
|
19
|
-
```env
|
|
20
|
-
DATABASE_URL=postgres://user:pass@localhost:5432/mydb
|
|
21
|
-
# Also supports: postgresql://, pg://, jdbc:postgresql://
|
|
22
|
-
# MariaDB: mariadb://, jdbc:mysql://, jdbc:mariadb://
|
|
23
|
-
# ClickHouse: ch://, jdbc:clickhouse://
|
|
24
10
|
```
|
|
25
11
|
|
|
26
|
-
|
|
12
|
+
2. **Add to Claude Desktop** `claude_desktop_config.json`:
|
|
27
13
|
```json
|
|
28
14
|
{
|
|
29
15
|
"mcpServers": {
|
|
30
16
|
"db-connect": {
|
|
31
|
-
"command": "
|
|
17
|
+
"command": "python",
|
|
18
|
+
"args": ["-m", "db_connect_mcp"],
|
|
32
19
|
"env": {
|
|
33
20
|
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
|
|
34
21
|
}
|
|
@@ -37,7 +24,9 @@ A read-only MCP (Model Context Protocol) server for exploratory data analysis ac
|
|
|
37
24
|
}
|
|
38
25
|
```
|
|
39
26
|
|
|
40
|
-
|
|
27
|
+
3. **Restart Claude Desktop** and start querying your database!
|
|
28
|
+
|
|
29
|
+
> **Note**: Using `python -m db_connect_mcp` ensures the command works even if Python's Scripts directory isn't in your PATH.
|
|
41
30
|
|
|
42
31
|
## Features
|
|
43
32
|
|
|
@@ -72,48 +61,18 @@ A read-only MCP (Model Context Protocol) server for exploratory data analysis ac
|
|
|
72
61
|
## Installation
|
|
73
62
|
|
|
74
63
|
### Prerequisites
|
|
75
|
-
- Python 3.10 or higher
|
|
76
|
-
-
|
|
77
|
-
- PostgreSQL database (9.6+)
|
|
78
|
-
- MySQL/MariaDB database (5.7+/10.2+)
|
|
79
|
-
- ClickHouse database
|
|
64
|
+
- **Python 3.10 or higher**
|
|
65
|
+
- **A database**: PostgreSQL (9.6+), MySQL/MariaDB (5.7+/10.2+), or ClickHouse
|
|
80
66
|
|
|
81
|
-
###
|
|
67
|
+
### Install via pip
|
|
82
68
|
|
|
83
69
|
```bash
|
|
84
70
|
pip install db-connect-mcp
|
|
85
71
|
```
|
|
86
72
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
For development or the latest features:
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
# Clone the repository
|
|
93
|
-
git clone https://github.com/yugui923/db-connect-mcp.git
|
|
94
|
-
cd db-connect-mcp
|
|
95
|
-
|
|
96
|
-
# Install with uv (recommended)
|
|
97
|
-
uv sync
|
|
98
|
-
|
|
99
|
-
# Or install with pip
|
|
100
|
-
pip install -e .
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Method 3: Install from GitHub
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
pip install git+https://github.com/yugui923/db-connect-mcp.git
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Configuration
|
|
110
|
-
|
|
111
|
-
After installation, configure your database connection:
|
|
73
|
+
That's it! The package is now ready to use.
|
|
112
74
|
|
|
113
|
-
|
|
114
|
-
cp .env.example .env
|
|
115
|
-
# Edit .env with your database connection string
|
|
116
|
-
```
|
|
75
|
+
> **For developers**: See [Development Guide](docs/DEVELOPMENT.md) for setting up a development environment.
|
|
117
76
|
|
|
118
77
|
## Configuration
|
|
119
78
|
|
|
@@ -235,41 +194,20 @@ DATABASE_URL=ch://user:pass@host:9000/db?timeout=60&max_threads=4
|
|
|
235
194
|
|
|
236
195
|
### Running the Server
|
|
237
196
|
|
|
238
|
-
If installed from PyPI:
|
|
239
|
-
```bash
|
|
240
|
-
db-connect-mcp
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
If running from source (development):
|
|
244
197
|
```bash
|
|
245
|
-
#
|
|
198
|
+
# Run the server (works everywhere, no PATH configuration needed)
|
|
246
199
|
python -m db_connect_mcp
|
|
247
200
|
|
|
248
|
-
#
|
|
249
|
-
|
|
201
|
+
# With environment variable
|
|
202
|
+
DATABASE_URL="postgresql://user:pass@host:5432/db" python -m db_connect_mcp
|
|
250
203
|
```
|
|
251
204
|
|
|
205
|
+
> **Note**: Using `python -m db_connect_mcp` works regardless of whether Python's Scripts directory is in your PATH.
|
|
206
|
+
|
|
252
207
|
### Using with Claude Desktop
|
|
253
208
|
|
|
254
209
|
Add the server to your Claude Desktop configuration (`claude_desktop_config.json`):
|
|
255
210
|
|
|
256
|
-
#### If installed from PyPI:
|
|
257
|
-
|
|
258
|
-
```json
|
|
259
|
-
{
|
|
260
|
-
"mcpServers": {
|
|
261
|
-
"db-connect": {
|
|
262
|
-
"command": "db-connect-mcp",
|
|
263
|
-
"env": {
|
|
264
|
-
"DATABASE_URL": "postgresql+asyncpg://user:pass@host:5432/db"
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
#### If running from source (development):
|
|
272
|
-
|
|
273
211
|
```json
|
|
274
212
|
{
|
|
275
213
|
"mcpServers": {
|
|
@@ -284,34 +222,21 @@ Add the server to your Claude Desktop configuration (`claude_desktop_config.json
|
|
|
284
222
|
}
|
|
285
223
|
```
|
|
286
224
|
|
|
287
|
-
|
|
225
|
+
**Multiple database connections:**
|
|
288
226
|
|
|
289
|
-
```json
|
|
290
|
-
{
|
|
291
|
-
"mcpServers": {
|
|
292
|
-
"db-connect": {
|
|
293
|
-
"command": "uv",
|
|
294
|
-
"args": ["--directory", "C:/path/to/db-connect-mcp", "run", "db-connect-mcp"],
|
|
295
|
-
"env": {
|
|
296
|
-
"DATABASE_URL": "mysql+aiomysql://user:pass@host:3306/db"
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
You can configure multiple database connections:
|
|
304
227
|
```json
|
|
305
228
|
{
|
|
306
229
|
"mcpServers": {
|
|
307
230
|
"postgres-prod": {
|
|
308
|
-
"command": "
|
|
231
|
+
"command": "python",
|
|
232
|
+
"args": ["-m", "db_connect_mcp"],
|
|
309
233
|
"env": {
|
|
310
234
|
"DATABASE_URL": "postgresql+asyncpg://user:pass@pg-host:5432/db"
|
|
311
235
|
}
|
|
312
236
|
},
|
|
313
237
|
"mysql-analytics": {
|
|
314
|
-
"command": "
|
|
238
|
+
"command": "python",
|
|
239
|
+
"args": ["-m", "db_connect_mcp"],
|
|
315
240
|
"env": {
|
|
316
241
|
"DATABASE_URL": "mysql+aiomysql://user:pass@mysql-host:3306/analytics"
|
|
317
242
|
}
|
|
@@ -320,6 +245,8 @@ You can configure multiple database connections:
|
|
|
320
245
|
}
|
|
321
246
|
```
|
|
322
247
|
|
|
248
|
+
> **For development**: See [Development Guide](docs/DEVELOPMENT.md) for running from source with uv.
|
|
249
|
+
|
|
323
250
|
## Database Feature Support
|
|
324
251
|
|
|
325
252
|
| Feature | PostgreSQL | MySQL | ClickHouse |
|
|
@@ -433,6 +360,8 @@ Once configured, you can use the server in Claude:
|
|
|
433
360
|
|
|
434
361
|
## Development
|
|
435
362
|
|
|
363
|
+
For detailed development setup, testing, and contribution guidelines, see the [Development Guide](docs/DEVELOPMENT.md).
|
|
364
|
+
|
|
436
365
|
### Project Structure
|
|
437
366
|
```
|
|
438
367
|
db-connect-mcp/
|
|
@@ -480,13 +409,8 @@ The server uses an adapter pattern to support multiple database systems:
|
|
|
480
409
|
- **Server**: MCP server implementation that routes requests to appropriate components
|
|
481
410
|
|
|
482
411
|
### Running Tests
|
|
483
|
-
```bash
|
|
484
|
-
# Run integration tests
|
|
485
|
-
uv run python tests/test_server.py
|
|
486
412
|
|
|
487
|
-
#
|
|
488
|
-
uv run pytest tests/
|
|
489
|
-
```
|
|
413
|
+
See the [Development Guide](docs/DEVELOPMENT.md#running-tests) and [Test Guide](tests/README.md) for detailed testing instructions.
|
|
490
414
|
|
|
491
415
|
## Troubleshooting
|
|
492
416
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "db-connect-mcp"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.5"
|
|
8
8
|
description = "Multi-database MCP server for PostgreSQL, MySQL, and ClickHouse"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -50,7 +50,7 @@ Repository = "https://github.com/yugui923/db-connect-mcp"
|
|
|
50
50
|
Issues = "https://github.com/yugui923/db-connect-mcp/issues"
|
|
51
51
|
|
|
52
52
|
[project.scripts]
|
|
53
|
-
db-connect-mcp = "db_connect_mcp.server:
|
|
53
|
+
db-connect-mcp = "db_connect_mcp.server:cli_entry"
|
|
54
54
|
|
|
55
55
|
[dependency-groups]
|
|
56
56
|
dev = [
|
|
@@ -488,9 +488,25 @@ async def main() -> None:
|
|
|
488
488
|
await mcp_server.cleanup()
|
|
489
489
|
|
|
490
490
|
|
|
491
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|