sql-mcp 2.3.8__tar.gz → 2.4.0__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_mcp-2.3.8/sql_mcp.egg-info → sql_mcp-2.4.0}/PKG-INFO +8 -8
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/README.md +6 -6
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/pyproject.toml +2 -2
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/__init__.py +3 -3
- sql_mcp-2.4.0/sql_mcp/api_client.py +41 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/auth.py +1 -1
- sql_mcp-2.4.0/sql_mcp/connector_contracts.py +630 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/connector_sources.py +17 -1
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/kg_ingest.py +1 -1
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/kg_pgwire.py +5 -5
- sql_mcp-2.4.0/sql_mcp/mcp/mcp_sql.py +112 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/ontology/__init__.py +1 -1
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/ontology/certification.json +3 -3
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/ontology/database.ttl +8 -7
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/ontology/shapes/connector.shacl.ttl +2 -2
- sql_mcp-2.4.0/sql_mcp/prompts/sql-mcp-data-analyst.json +52 -0
- sql_mcp-2.4.0/sql_mcp/prompts/sql-mcp-data-steward.json +50 -0
- sql_mcp-2.4.0/sql_mcp/prompts/sql-mcp-database-administrator.json +70 -0
- sql_mcp-2.4.0/sql_mcp/prompts/sql-mcp-operator.json +74 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/skills/sql-mcp-development/SKILL.md +2 -2
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/skills/sql-mcp-knowledge-graph-ingestion/SKILL.md +17 -24
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/skills/sql-mcp-knowledge-graph-ingestion/WORKFLOW.md +14 -21
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/skills/sql-mcp-operations/SKILL.md +1 -1
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/skills/sql-mcp-operations/references/catalog.md +1 -1
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/skills/sql-mcp-query-execution/SKILL.md +15 -24
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/skills/sql-mcp-query-execution/WORKFLOW.md +16 -25
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/skills/sql-mcp-schema-inspection/SKILL.md +18 -30
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/skills/sql-mcp-schema-inspection/WORKFLOW.md +18 -30
- {sql_mcp-2.3.8 → sql_mcp-2.4.0/sql_mcp.egg-info}/PKG-INFO +8 -8
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp.egg-info/SOURCES.txt +6 -2
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp.egg-info/requires.txt +1 -1
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_api_wrapper.py +1 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_identity_context_scoping.py +1 -5
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_kg_ingest.py +3 -3
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_kg_pgwire.py +1 -1
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_package_getattr.py +0 -8
- sql_mcp-2.4.0/tests/test_scion_sdk_0_10_imports.py +59 -0
- sql_mcp-2.4.0/tests/test_sql_mcp_validation.py +278 -0
- sql_mcp-2.3.8/sql_mcp/api_client.py +0 -9
- sql_mcp-2.3.8/sql_mcp/mcp/mcp_sql.py +0 -625
- sql_mcp-2.3.8/sql_mcp/prompts/database_specialist.json +0 -42
- sql_mcp-2.3.8/sql_mcp/sql_input_models.py +0 -129
- sql_mcp-2.3.8/tests/test_sql_mcp_validation.py +0 -406
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/LICENSE +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/setup.cfg +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/__main__.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/api/__init__.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/api/api_client_sql.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/dialects.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/mcp/__init__.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/mcp_config.json +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/mcp_server.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/ontology/fixtures/records.json +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/ontology/mappings/source.yaml +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/ontology/migrations/manifest.json +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/safety.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/skills/sql-mcp-operations/agents/openai.yaml +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp/sql_response_models.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp.egg-info/dependency_links.txt +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp.egg-info/entry_points.txt +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/sql_mcp.egg-info/top_level.txt +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_auth.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_dialect_paths.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_dialects.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_init_dynamics.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_safety.py +0 -0
- {sql_mcp-2.3.8 → sql_mcp-2.4.0}/tests/test_startup.py +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sql-mcp
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: Generic SQL database (Postgres, MySQL/MariaDB, MSSQL, Oracle, SQLite) API + MCP Server for Agentic AI!
|
|
5
5
|
Author-email: Repository Maintainers <maintainers@knuckles.team>
|
|
6
6
|
License: MIT
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Requires-Python: <3.15,>=3.12
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: scion-sdk[mcp]<0.
|
|
15
|
+
Requires-Dist: scion-sdk[mcp]<0.12,>=0.11.0
|
|
16
16
|
Requires-Dist: python-dotenv>=1.2.4
|
|
17
17
|
Requires-Dist: sqlalchemy>=2.1.5
|
|
18
18
|
Provides-Extra: postgres
|
|
@@ -159,7 +159,7 @@ Pick the extra that matches what the operator want to run. DB-driver extras
|
|
|
159
159
|
|
|
160
160
|
| Extra | Installs | Use when |
|
|
161
161
|
|-------|----------|----------|
|
|
162
|
-
| `sql-mcp[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `
|
|
162
|
+
| `sql-mcp[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `medulla[full]`) | The operator only run the **MCP server** (smallest install / image) |
|
|
163
163
|
| `sql-mcp[all]` | Everything (`mcp` + `agent` + **every** DB driver + `logfire`) | Development / both surfaces |
|
|
164
164
|
|
|
165
165
|
```bash
|
|
@@ -175,7 +175,7 @@ One multi-stage `docker/Dockerfile` builds the MCP-only image (`--target mcp`):
|
|
|
175
175
|
|
|
176
176
|
| Image tag | Build target | Contents | Entrypoint |
|
|
177
177
|
|-----------|--------------|----------|------------|
|
|
178
|
-
| `example/sql-mcp:mcp` | `--target mcp` | `sql-mcp[mcp]` — **connector-focused**, includes `
|
|
178
|
+
| `example/sql-mcp:mcp` | `--target mcp` | `sql-mcp[mcp]` — **connector-focused**, includes `medulla[full]`; no model-orchestration stack | `sql-mcp` |
|
|
179
179
|
|
|
180
180
|
```bash
|
|
181
181
|
docker pull example/sql-mcp:mcp # connector-focused MCP server
|
|
@@ -184,14 +184,14 @@ docker build --target mcp -t example/sql-mcp:mcp docker/ # build MCP se
|
|
|
184
184
|
|
|
185
185
|
agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
|
|
186
186
|
|
|
187
|
-
### Knowledge-graph database (`
|
|
187
|
+
### Knowledge-graph database (`medulla`)
|
|
188
188
|
|
|
189
|
-
Scion SDK core dependency (`
|
|
189
|
+
Scion SDK core dependency (`medulla[full]`). The `[mcp]` extra keeps
|
|
190
190
|
deployments can use the bundled engine. For production or shared state, run
|
|
191
|
-
**
|
|
191
|
+
**medulla as a dedicated database service** and configure the runtime to use it.
|
|
192
192
|
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
|
|
193
193
|
diagrams are documented in the
|
|
194
|
-
[
|
|
194
|
+
[medulla deployment guide](https://knuckles-team.github.io/medulla/deployment/).
|
|
195
195
|
|
|
196
196
|
## Usage
|
|
197
197
|
|
|
@@ -125,7 +125,7 @@ Pick the extra that matches what the operator want to run. DB-driver extras
|
|
|
125
125
|
|
|
126
126
|
| Extra | Installs | Use when |
|
|
127
127
|
|-------|----------|----------|
|
|
128
|
-
| `sql-mcp[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `
|
|
128
|
+
| `sql-mcp[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `medulla[full]`) | The operator only run the **MCP server** (smallest install / image) |
|
|
129
129
|
| `sql-mcp[all]` | Everything (`mcp` + `agent` + **every** DB driver + `logfire`) | Development / both surfaces |
|
|
130
130
|
|
|
131
131
|
```bash
|
|
@@ -141,7 +141,7 @@ One multi-stage `docker/Dockerfile` builds the MCP-only image (`--target mcp`):
|
|
|
141
141
|
|
|
142
142
|
| Image tag | Build target | Contents | Entrypoint |
|
|
143
143
|
|-----------|--------------|----------|------------|
|
|
144
|
-
| `example/sql-mcp:mcp` | `--target mcp` | `sql-mcp[mcp]` — **connector-focused**, includes `
|
|
144
|
+
| `example/sql-mcp:mcp` | `--target mcp` | `sql-mcp[mcp]` — **connector-focused**, includes `medulla[full]`; no model-orchestration stack | `sql-mcp` |
|
|
145
145
|
|
|
146
146
|
```bash
|
|
147
147
|
docker pull example/sql-mcp:mcp # connector-focused MCP server
|
|
@@ -150,14 +150,14 @@ docker build --target mcp -t example/sql-mcp:mcp docker/ # build MCP se
|
|
|
150
150
|
|
|
151
151
|
agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
|
|
152
152
|
|
|
153
|
-
### Knowledge-graph database (`
|
|
153
|
+
### Knowledge-graph database (`medulla`)
|
|
154
154
|
|
|
155
|
-
Scion SDK core dependency (`
|
|
155
|
+
Scion SDK core dependency (`medulla[full]`). The `[mcp]` extra keeps
|
|
156
156
|
deployments can use the bundled engine. For production or shared state, run
|
|
157
|
-
**
|
|
157
|
+
**medulla as a dedicated database service** and configure the runtime to use it.
|
|
158
158
|
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
|
|
159
159
|
diagrams are documented in the
|
|
160
|
-
[
|
|
160
|
+
[medulla deployment guide](https://knuckles-team.github.io/medulla/deployment/).
|
|
161
161
|
|
|
162
162
|
## Usage
|
|
163
163
|
|
|
@@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "sql-mcp"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.4.0"
|
|
8
8
|
description = "Generic SQL database (Postgres, MySQL/MariaDB, MSSQL, Oracle, SQLite) API + MCP Server for Agentic AI!"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
classifiers = [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Environment :: Console", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3",]
|
|
11
11
|
requires-python = ">=3.12, <3.15"
|
|
12
|
-
dependencies = [ "scion-sdk[mcp]>=0.
|
|
12
|
+
dependencies = [ "scion-sdk[mcp]>=0.11.0,<0.12", "python-dotenv>=1.2.4", "sqlalchemy>=2.1.5",]
|
|
13
13
|
[[project.authors]]
|
|
14
14
|
name = "Repository Maintainers"
|
|
15
15
|
email = "maintainers@knuckles.team"
|
|
@@ -72,13 +72,13 @@ def __dir__() -> list[str]:
|
|
|
72
72
|
|
|
73
73
|
from scion_sdk.connector import Connector
|
|
74
74
|
|
|
75
|
-
from sql_mcp.api_client import
|
|
75
|
+
from sql_mcp.api_client import OperationApi
|
|
76
76
|
from sql_mcp.auth import get_api
|
|
77
77
|
from sql_mcp.mcp_server import readiness
|
|
78
78
|
|
|
79
79
|
connector = Connector(
|
|
80
|
-
api=
|
|
81
|
-
get_client=get_api,
|
|
80
|
+
api=OperationApi,
|
|
81
|
+
get_client=lambda: OperationApi(get_api()),
|
|
82
82
|
tools="sql_mcp.mcp_server",
|
|
83
83
|
instructions="Generic SQL database MCP Server - read-only queries, gated DML/DDL, schema reflection, and connection admin over SQLAlchemy 2.x Core (SQLite, Postgres, MySQL/MariaDB, MSSQL, Oracle) with named multi-connection support.",
|
|
84
84
|
readiness=readiness,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Public client facade for sql_mcp."""
|
|
2
|
+
|
|
3
|
+
import functools
|
|
4
|
+
import inspect
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from sql_mcp.api.api_client_sql import SqlApi
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Api(SqlApi):
|
|
11
|
+
"""Multi-connection SQL client (SQLAlchemy 2.x Core) for the fleet."""
|
|
12
|
+
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
#: Plumbing on ``Api`` that is not a database operation: the SQLAlchemy engine
|
|
17
|
+
#: handle, pool teardown and the internal dialect record. They stay on ``Api``
|
|
18
|
+
#: for in-process callers but are never served as MCP tools.
|
|
19
|
+
_NOT_OPERATIONS = frozenset({"engine", "dispose", "dialect_spec"})
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _delegate(name: str):
|
|
23
|
+
original = getattr(Api, name)
|
|
24
|
+
|
|
25
|
+
@functools.wraps(original)
|
|
26
|
+
def call(self: "OperationApi", *args: Any, **kwargs: Any) -> Any:
|
|
27
|
+
return getattr(self._api, name)(*args, **kwargs)
|
|
28
|
+
|
|
29
|
+
return call
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class OperationApi:
|
|
33
|
+
"""The operations of ``Api`` that the MCP server serves, one tool each."""
|
|
34
|
+
|
|
35
|
+
def __init__(self, api: Api) -> None:
|
|
36
|
+
self._api = api
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
for _name, _member in inspect.getmembers(Api, inspect.isfunction):
|
|
40
|
+
if not _name.startswith("_") and _name not in _NOT_OPERATIONS:
|
|
41
|
+
setattr(OperationApi, _name, _delegate(_name))
|
|
@@ -205,7 +205,7 @@ def allow_writes() -> bool:
|
|
|
205
205
|
|
|
206
206
|
|
|
207
207
|
def allow_kg_ingest() -> bool:
|
|
208
|
-
"""Whether SQL schema writes into
|
|
208
|
+
"""Whether SQL schema writes into Medulla are enabled."""
|
|
209
209
|
return bool(setting("SQL_ALLOW_KG_INGEST", False))
|
|
210
210
|
|
|
211
211
|
|