sql-query-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.
- {sql_query_mcp-0.1.2/sql_query_mcp.egg-info → sql_query_mcp-0.1.4}/PKG-INFO +40 -30
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/README.md +39 -29
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/pyproject.toml +1 -1
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/__init__.py +1 -1
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4/sql_query_mcp.egg-info}/PKG-INFO +40 -30
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/LICENSE +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/setup.cfg +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/__main__.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/adapters/__init__.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/adapters/mysql.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/adapters/postgres.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/app.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/audit.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/config.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/errors.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/executor.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/introspection.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/namespace.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/registry.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/release_metadata.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp/validator.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp.egg-info/SOURCES.txt +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp.egg-info/dependency_links.txt +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp.egg-info/entry_points.txt +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp.egg-info/requires.txt +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/sql_query_mcp.egg-info/top_level.txt +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/tests/test_audit.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/tests/test_config.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/tests/test_executor.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/tests/test_metadata.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/tests/test_namespace.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/tests/test_registry.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/tests/test_release_metadata.py +0 -0
- {sql_query_mcp-0.1.2 → sql_query_mcp-0.1.4}/tests/test_validator.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sql-query-mcp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Read-only SQL MCP server for PostgreSQL and MySQL.
|
|
5
5
|
Author: Andy Wang
|
|
6
6
|
License-Expression: MIT
|
|
@@ -102,51 +102,61 @@ implementation.
|
|
|
102
102
|
|
|
103
103
|
## Quick start
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
`sql-query-mcp` supports two official PyPI-based setup modes. Both are intended
|
|
106
|
+
for real usage, not just local testing.
|
|
107
107
|
|
|
108
|
-
1.
|
|
108
|
+
1. Choose how you want your MCP client to start the server.
|
|
109
|
+
|
|
110
|
+
Use installed command mode if you want a simple local command after one
|
|
111
|
+
install.
|
|
109
112
|
|
|
110
113
|
```bash
|
|
111
|
-
|
|
112
|
-
source .venv/bin/activate
|
|
113
|
-
python -m pip install --upgrade pip
|
|
114
|
-
pip install sql-query-mcp
|
|
114
|
+
pipx install sql-query-mcp
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
Release.
|
|
120
|
-
|
|
121
|
-
2. Copy the example connection config.
|
|
117
|
+
Use managed launch mode if you want the package source declared directly in
|
|
118
|
+
your MCP client config.
|
|
122
119
|
|
|
123
120
|
```bash
|
|
124
|
-
|
|
121
|
+
pipx run --spec sql-query-mcp sql-query-mcp
|
|
125
122
|
```
|
|
126
123
|
|
|
127
|
-
|
|
124
|
+
Pin a version with `pipx install 'sql-query-mcp==X.Y.Z'` or
|
|
125
|
+
`pipx run --spec 'sql-query-mcp==X.Y.Z' sql-query-mcp`. Upgrade installed
|
|
126
|
+
command mode with `pipx upgrade sql-query-mcp`.
|
|
128
127
|
|
|
129
|
-
|
|
128
|
+
2. Create a config file.
|
|
129
|
+
|
|
130
|
+
The server configuration should live outside the repository so the same file
|
|
131
|
+
works with either startup mode.
|
|
130
132
|
|
|
131
133
|
```bash
|
|
132
|
-
|
|
133
|
-
export MYSQL_CONN_CRM_PROD_MUQIAO_RO='mysql://user:password@host:3306/crm'
|
|
134
|
-
export SQL_QUERY_MCP_CONFIG='/absolute/path/to/sql-query-mcp/config/connections.json'
|
|
134
|
+
mkdir -p ~/.config/sql-query-mcp
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
Then save the example JSON later in this section as
|
|
138
|
+
`~/.config/sql-query-mcp/connections.json`.
|
|
139
|
+
|
|
140
|
+
3. Register the server in your MCP client.
|
|
138
141
|
|
|
139
142
|
- Codex: `docs/codex-setup.md` (Chinese)
|
|
140
143
|
- OpenCode: `docs/opencode-setup.md` (Chinese)
|
|
141
144
|
|
|
145
|
+
Installed command mode means your client runs `sql-query-mcp` directly.
|
|
146
|
+
Managed launch mode means your client starts the server through `pipx run`.
|
|
147
|
+
|
|
148
|
+
In both modes, put `SQL_QUERY_MCP_CONFIG` and your real database DSNs in the
|
|
149
|
+
MCP client's environment block instead of exporting them in your shell.
|
|
150
|
+
|
|
142
151
|
The console entry point is `sql-query-mcp`, which maps to
|
|
143
152
|
`sql_query_mcp.app:main`.
|
|
144
153
|
|
|
145
154
|
The PyPI install name is `sql-query-mcp`, and the Python package import path is
|
|
146
155
|
`sql_query_mcp`.
|
|
147
156
|
|
|
148
|
-
|
|
149
|
-
|
|
157
|
+
For `pipx install` and `pipx run`, set `SQL_QUERY_MCP_CONFIG` explicitly to
|
|
158
|
+
your config file path. The default `config/connections.json` path is mainly for
|
|
159
|
+
source checkouts and local development.
|
|
150
160
|
|
|
151
161
|
The example config looks like this.
|
|
152
162
|
|
|
@@ -159,24 +169,24 @@ The example config looks like this.
|
|
|
159
169
|
},
|
|
160
170
|
"connections": [
|
|
161
171
|
{
|
|
162
|
-
"connection_id": "
|
|
172
|
+
"connection_id": "crm_prod_main_ro",
|
|
163
173
|
"engine": "postgres",
|
|
164
|
-
"label": "CRM PostgreSQL production /
|
|
174
|
+
"label": "CRM PostgreSQL production / Main / read-only",
|
|
165
175
|
"env": "prod",
|
|
166
|
-
"tenant": "
|
|
176
|
+
"tenant": "main",
|
|
167
177
|
"role": "ro",
|
|
168
|
-
"dsn_env": "
|
|
178
|
+
"dsn_env": "PG_CONN_CRM_PROD_MAIN_RO",
|
|
169
179
|
"enabled": true,
|
|
170
180
|
"default_schema": "public"
|
|
171
181
|
},
|
|
172
182
|
{
|
|
173
|
-
"connection_id": "
|
|
183
|
+
"connection_id": "crm_mysql_prod_main_ro",
|
|
174
184
|
"engine": "mysql",
|
|
175
|
-
"label": "CRM MySQL production /
|
|
185
|
+
"label": "CRM MySQL production / Main / read-only",
|
|
176
186
|
"env": "prod",
|
|
177
|
-
"tenant": "
|
|
187
|
+
"tenant": "main",
|
|
178
188
|
"role": "ro",
|
|
179
|
-
"dsn_env": "
|
|
189
|
+
"dsn_env": "MYSQL_CONN_CRM_PROD_MAIN_RO",
|
|
180
190
|
"enabled": true,
|
|
181
191
|
"default_database": "crm"
|
|
182
192
|
}
|
|
@@ -72,51 +72,61 @@ implementation.
|
|
|
72
72
|
|
|
73
73
|
## Quick start
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
`sql-query-mcp` supports two official PyPI-based setup modes. Both are intended
|
|
76
|
+
for real usage, not just local testing.
|
|
77
77
|
|
|
78
|
-
1.
|
|
78
|
+
1. Choose how you want your MCP client to start the server.
|
|
79
|
+
|
|
80
|
+
Use installed command mode if you want a simple local command after one
|
|
81
|
+
install.
|
|
79
82
|
|
|
80
83
|
```bash
|
|
81
|
-
|
|
82
|
-
source .venv/bin/activate
|
|
83
|
-
python -m pip install --upgrade pip
|
|
84
|
-
pip install sql-query-mcp
|
|
84
|
+
pipx install sql-query-mcp
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Release.
|
|
90
|
-
|
|
91
|
-
2. Copy the example connection config.
|
|
87
|
+
Use managed launch mode if you want the package source declared directly in
|
|
88
|
+
your MCP client config.
|
|
92
89
|
|
|
93
90
|
```bash
|
|
94
|
-
|
|
91
|
+
pipx run --spec sql-query-mcp sql-query-mcp
|
|
95
92
|
```
|
|
96
93
|
|
|
97
|
-
|
|
94
|
+
Pin a version with `pipx install 'sql-query-mcp==X.Y.Z'` or
|
|
95
|
+
`pipx run --spec 'sql-query-mcp==X.Y.Z' sql-query-mcp`. Upgrade installed
|
|
96
|
+
command mode with `pipx upgrade sql-query-mcp`.
|
|
98
97
|
|
|
99
|
-
|
|
98
|
+
2. Create a config file.
|
|
99
|
+
|
|
100
|
+
The server configuration should live outside the repository so the same file
|
|
101
|
+
works with either startup mode.
|
|
100
102
|
|
|
101
103
|
```bash
|
|
102
|
-
|
|
103
|
-
export MYSQL_CONN_CRM_PROD_MUQIAO_RO='mysql://user:password@host:3306/crm'
|
|
104
|
-
export SQL_QUERY_MCP_CONFIG='/absolute/path/to/sql-query-mcp/config/connections.json'
|
|
104
|
+
mkdir -p ~/.config/sql-query-mcp
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Then save the example JSON later in this section as
|
|
108
|
+
`~/.config/sql-query-mcp/connections.json`.
|
|
109
|
+
|
|
110
|
+
3. Register the server in your MCP client.
|
|
108
111
|
|
|
109
112
|
- Codex: `docs/codex-setup.md` (Chinese)
|
|
110
113
|
- OpenCode: `docs/opencode-setup.md` (Chinese)
|
|
111
114
|
|
|
115
|
+
Installed command mode means your client runs `sql-query-mcp` directly.
|
|
116
|
+
Managed launch mode means your client starts the server through `pipx run`.
|
|
117
|
+
|
|
118
|
+
In both modes, put `SQL_QUERY_MCP_CONFIG` and your real database DSNs in the
|
|
119
|
+
MCP client's environment block instead of exporting them in your shell.
|
|
120
|
+
|
|
112
121
|
The console entry point is `sql-query-mcp`, which maps to
|
|
113
122
|
`sql_query_mcp.app:main`.
|
|
114
123
|
|
|
115
124
|
The PyPI install name is `sql-query-mcp`, and the Python package import path is
|
|
116
125
|
`sql_query_mcp`.
|
|
117
126
|
|
|
118
|
-
|
|
119
|
-
|
|
127
|
+
For `pipx install` and `pipx run`, set `SQL_QUERY_MCP_CONFIG` explicitly to
|
|
128
|
+
your config file path. The default `config/connections.json` path is mainly for
|
|
129
|
+
source checkouts and local development.
|
|
120
130
|
|
|
121
131
|
The example config looks like this.
|
|
122
132
|
|
|
@@ -129,24 +139,24 @@ The example config looks like this.
|
|
|
129
139
|
},
|
|
130
140
|
"connections": [
|
|
131
141
|
{
|
|
132
|
-
"connection_id": "
|
|
142
|
+
"connection_id": "crm_prod_main_ro",
|
|
133
143
|
"engine": "postgres",
|
|
134
|
-
"label": "CRM PostgreSQL production /
|
|
144
|
+
"label": "CRM PostgreSQL production / Main / read-only",
|
|
135
145
|
"env": "prod",
|
|
136
|
-
"tenant": "
|
|
146
|
+
"tenant": "main",
|
|
137
147
|
"role": "ro",
|
|
138
|
-
"dsn_env": "
|
|
148
|
+
"dsn_env": "PG_CONN_CRM_PROD_MAIN_RO",
|
|
139
149
|
"enabled": true,
|
|
140
150
|
"default_schema": "public"
|
|
141
151
|
},
|
|
142
152
|
{
|
|
143
|
-
"connection_id": "
|
|
153
|
+
"connection_id": "crm_mysql_prod_main_ro",
|
|
144
154
|
"engine": "mysql",
|
|
145
|
-
"label": "CRM MySQL production /
|
|
155
|
+
"label": "CRM MySQL production / Main / read-only",
|
|
146
156
|
"env": "prod",
|
|
147
|
-
"tenant": "
|
|
157
|
+
"tenant": "main",
|
|
148
158
|
"role": "ro",
|
|
149
|
-
"dsn_env": "
|
|
159
|
+
"dsn_env": "MYSQL_CONN_CRM_PROD_MAIN_RO",
|
|
150
160
|
"enabled": true,
|
|
151
161
|
"default_database": "crm"
|
|
152
162
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sql-query-mcp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Read-only SQL MCP server for PostgreSQL and MySQL.
|
|
5
5
|
Author: Andy Wang
|
|
6
6
|
License-Expression: MIT
|
|
@@ -102,51 +102,61 @@ implementation.
|
|
|
102
102
|
|
|
103
103
|
## Quick start
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
`sql-query-mcp` supports two official PyPI-based setup modes. Both are intended
|
|
106
|
+
for real usage, not just local testing.
|
|
107
107
|
|
|
108
|
-
1.
|
|
108
|
+
1. Choose how you want your MCP client to start the server.
|
|
109
|
+
|
|
110
|
+
Use installed command mode if you want a simple local command after one
|
|
111
|
+
install.
|
|
109
112
|
|
|
110
113
|
```bash
|
|
111
|
-
|
|
112
|
-
source .venv/bin/activate
|
|
113
|
-
python -m pip install --upgrade pip
|
|
114
|
-
pip install sql-query-mcp
|
|
114
|
+
pipx install sql-query-mcp
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
Release.
|
|
120
|
-
|
|
121
|
-
2. Copy the example connection config.
|
|
117
|
+
Use managed launch mode if you want the package source declared directly in
|
|
118
|
+
your MCP client config.
|
|
122
119
|
|
|
123
120
|
```bash
|
|
124
|
-
|
|
121
|
+
pipx run --spec sql-query-mcp sql-query-mcp
|
|
125
122
|
```
|
|
126
123
|
|
|
127
|
-
|
|
124
|
+
Pin a version with `pipx install 'sql-query-mcp==X.Y.Z'` or
|
|
125
|
+
`pipx run --spec 'sql-query-mcp==X.Y.Z' sql-query-mcp`. Upgrade installed
|
|
126
|
+
command mode with `pipx upgrade sql-query-mcp`.
|
|
128
127
|
|
|
129
|
-
|
|
128
|
+
2. Create a config file.
|
|
129
|
+
|
|
130
|
+
The server configuration should live outside the repository so the same file
|
|
131
|
+
works with either startup mode.
|
|
130
132
|
|
|
131
133
|
```bash
|
|
132
|
-
|
|
133
|
-
export MYSQL_CONN_CRM_PROD_MUQIAO_RO='mysql://user:password@host:3306/crm'
|
|
134
|
-
export SQL_QUERY_MCP_CONFIG='/absolute/path/to/sql-query-mcp/config/connections.json'
|
|
134
|
+
mkdir -p ~/.config/sql-query-mcp
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
Then save the example JSON later in this section as
|
|
138
|
+
`~/.config/sql-query-mcp/connections.json`.
|
|
139
|
+
|
|
140
|
+
3. Register the server in your MCP client.
|
|
138
141
|
|
|
139
142
|
- Codex: `docs/codex-setup.md` (Chinese)
|
|
140
143
|
- OpenCode: `docs/opencode-setup.md` (Chinese)
|
|
141
144
|
|
|
145
|
+
Installed command mode means your client runs `sql-query-mcp` directly.
|
|
146
|
+
Managed launch mode means your client starts the server through `pipx run`.
|
|
147
|
+
|
|
148
|
+
In both modes, put `SQL_QUERY_MCP_CONFIG` and your real database DSNs in the
|
|
149
|
+
MCP client's environment block instead of exporting them in your shell.
|
|
150
|
+
|
|
142
151
|
The console entry point is `sql-query-mcp`, which maps to
|
|
143
152
|
`sql_query_mcp.app:main`.
|
|
144
153
|
|
|
145
154
|
The PyPI install name is `sql-query-mcp`, and the Python package import path is
|
|
146
155
|
`sql_query_mcp`.
|
|
147
156
|
|
|
148
|
-
|
|
149
|
-
|
|
157
|
+
For `pipx install` and `pipx run`, set `SQL_QUERY_MCP_CONFIG` explicitly to
|
|
158
|
+
your config file path. The default `config/connections.json` path is mainly for
|
|
159
|
+
source checkouts and local development.
|
|
150
160
|
|
|
151
161
|
The example config looks like this.
|
|
152
162
|
|
|
@@ -159,24 +169,24 @@ The example config looks like this.
|
|
|
159
169
|
},
|
|
160
170
|
"connections": [
|
|
161
171
|
{
|
|
162
|
-
"connection_id": "
|
|
172
|
+
"connection_id": "crm_prod_main_ro",
|
|
163
173
|
"engine": "postgres",
|
|
164
|
-
"label": "CRM PostgreSQL production /
|
|
174
|
+
"label": "CRM PostgreSQL production / Main / read-only",
|
|
165
175
|
"env": "prod",
|
|
166
|
-
"tenant": "
|
|
176
|
+
"tenant": "main",
|
|
167
177
|
"role": "ro",
|
|
168
|
-
"dsn_env": "
|
|
178
|
+
"dsn_env": "PG_CONN_CRM_PROD_MAIN_RO",
|
|
169
179
|
"enabled": true,
|
|
170
180
|
"default_schema": "public"
|
|
171
181
|
},
|
|
172
182
|
{
|
|
173
|
-
"connection_id": "
|
|
183
|
+
"connection_id": "crm_mysql_prod_main_ro",
|
|
174
184
|
"engine": "mysql",
|
|
175
|
-
"label": "CRM MySQL production /
|
|
185
|
+
"label": "CRM MySQL production / Main / read-only",
|
|
176
186
|
"env": "prod",
|
|
177
|
-
"tenant": "
|
|
187
|
+
"tenant": "main",
|
|
178
188
|
"role": "ro",
|
|
179
|
-
"dsn_env": "
|
|
189
|
+
"dsn_env": "MYSQL_CONN_CRM_PROD_MAIN_RO",
|
|
180
190
|
"enabled": true,
|
|
181
191
|
"default_database": "crm"
|
|
182
192
|
}
|
|
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
|
|
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
|