sql-mcp 2.3.6__tar.gz → 2.3.7__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.6/sql_mcp.egg-info → sql_mcp-2.3.7}/PKG-INFO +12 -12
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/README.md +10 -10
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/pyproject.toml +6 -6
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/__init__.py +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/__main__.py +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/api/api_client_sql.py +4 -4
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/auth.py +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/kg_ingest.py +2 -2
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/mcp/mcp_sql.py +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/mcp_server.py +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/ontology/__init__.py +2 -2
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/ontology/certification.json +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-development/SKILL.md +2 -2
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-knowledge-graph-ingestion/SKILL.md +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-query-execution/SKILL.md +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-schema-inspection/SKILL.md +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7/sql_mcp.egg-info}/PKG-INFO +12 -12
- sql_mcp-2.3.7/sql_mcp.egg-info/entry_points.txt +8 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp.egg-info/requires.txt +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_identity_context_scoping.py +6 -6
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_kg_ingest.py +11 -11
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_sql_mcp_validation.py +1 -1
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_startup.py +2 -2
- sql_mcp-2.3.6/sql_mcp.egg-info/entry_points.txt +0 -8
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/LICENSE +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/setup.cfg +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/api/__init__.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/api_client.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/connector_sources.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/dialects.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/kg_pgwire.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/mcp/__init__.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/mcp_config.json +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/ontology/database.ttl +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/ontology/fixtures/records.json +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/ontology/mappings/source.yaml +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/ontology/migrations/manifest.json +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/ontology/shapes/connector.shacl.ttl +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/prompts/database_specialist.json +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/safety.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-knowledge-graph-ingestion/WORKFLOW.md +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-operations/SKILL.md +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-operations/agents/openai.yaml +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-operations/references/catalog.md +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-query-execution/WORKFLOW.md +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-schema-inspection/WORKFLOW.md +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/sql_input_models.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/sql_response_models.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp.egg-info/SOURCES.txt +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp.egg-info/dependency_links.txt +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp.egg-info/top_level.txt +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_api_wrapper.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_auth.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_dialect_paths.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_dialects.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_init_dynamics.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_kg_pgwire.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_package_getattr.py +0 -0
- {sql_mcp-2.3.6 → sql_mcp-2.3.7}/tests/test_safety.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sql-mcp
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.7
|
|
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:
|
|
15
|
+
Requires-Dist: scion-sdk[mcp]<0.7.0,>=0.6.3
|
|
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 (`
|
|
162
|
+
| `sql-mcp[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `epistemic-graph[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
|
|
@@ -186,7 +186,7 @@ agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
|
|
|
186
186
|
|
|
187
187
|
### Knowledge-graph database (`epistemic-graph`)
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
Scion SDK core dependency (`epistemic-graph[full]`). The `[mcp]` extra keeps
|
|
190
190
|
deployments can use the bundled engine. For production or shared state, run
|
|
191
191
|
**epistemic-graph as a dedicated database service** and configure the runtime to use it.
|
|
192
192
|
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
|
|
@@ -221,7 +221,7 @@ sql-mcp
|
|
|
221
221
|
## MCP config
|
|
222
222
|
|
|
223
223
|
> **Install the connector-focused `[mcp]` extra.** Examples use `sql-mcp[mcp]` to add
|
|
224
|
-
> FastMCP / FastAPI through `
|
|
224
|
+
> FastMCP / FastAPI through `scion-sdk`; the required Scion SDK core
|
|
225
225
|
> enables model orchestration.
|
|
226
226
|
> Combine it with the database-driver extras needed by the deployment.
|
|
227
227
|
|
|
@@ -285,15 +285,15 @@ python -m pytest # full suite against in-memory SQLite (no live DBs)
|
|
|
285
285
|
pre-commit run --all-files
|
|
286
286
|
```
|
|
287
287
|
|
|
288
|
-
<!-- BEGIN
|
|
288
|
+
<!-- BEGIN scion-sdk-deployment (generated; do not edit between markers) -->
|
|
289
289
|
|
|
290
|
-
## Deploy with `
|
|
290
|
+
## Deploy with `scion-sdk-deployment`
|
|
291
291
|
|
|
292
|
-
Provision this package with the consolidated **`
|
|
292
|
+
Provision this package with the consolidated **`scion-sdk-deployment`**
|
|
293
293
|
workflow. It selects an installed-package, editable-source, or immutable-container
|
|
294
294
|
path; records only runtime secret and TLS-profile references in `AgentConfig`; and
|
|
295
295
|
runs doctor, registration, policy, observability, and rollback gates. Ask your agent
|
|
296
|
-
to **"deploy `sql-mcp` with
|
|
296
|
+
to **"deploy `sql-mcp` with scion-sdk-deployment"**.
|
|
297
297
|
|
|
298
298
|
| Install mode | Command |
|
|
299
299
|
|------|---------|
|
|
@@ -304,7 +304,7 @@ The repository embeds no deployment profile, credential value, certificate path,
|
|
|
304
304
|
environment-specific endpoint. Supply those at runtime through `AgentConfig` and the
|
|
305
305
|
configured secret provider.
|
|
306
306
|
|
|
307
|
-
<!-- END
|
|
307
|
+
<!-- END scion-sdk-deployment -->
|
|
308
308
|
|
|
309
309
|
## Environment Variables
|
|
310
310
|
|
|
@@ -339,7 +339,7 @@ configured secret provider.
|
|
|
339
339
|
| `SQL_TIMEOUT_SECONDS` | `30` | |
|
|
340
340
|
| `SQLTOOL` | `True` | |
|
|
341
341
|
|
|
342
|
-
#### Inherited
|
|
342
|
+
#### Inherited scion-sdk variables (apply to every connector)
|
|
343
343
|
|
|
344
344
|
| Variable | Example | Description |
|
|
345
345
|
|----------|---------|-------------|
|
|
@@ -359,7 +359,7 @@ configured secret provider.
|
|
|
359
359
|
| `PROVIDER` | `openai` | LLM provider for the agent |
|
|
360
360
|
| `MODEL_ID` | `gpt-4o` | Model id for the agent |
|
|
361
361
|
|
|
362
|
-
_24 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared
|
|
362
|
+
_24 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared scion-sdk set — do not edit._
|
|
363
363
|
<!-- ENV-VARS-TABLE:END -->
|
|
364
364
|
|
|
365
365
|
<!-- GOVERNED-CAPABILITY:START -->
|
|
@@ -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 (`
|
|
128
|
+
| `sql-mcp[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `epistemic-graph[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
|
|
@@ -152,7 +152,7 @@ agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
|
|
|
152
152
|
|
|
153
153
|
### Knowledge-graph database (`epistemic-graph`)
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
Scion SDK core dependency (`epistemic-graph[full]`). The `[mcp]` extra keeps
|
|
156
156
|
deployments can use the bundled engine. For production or shared state, run
|
|
157
157
|
**epistemic-graph as a dedicated database service** and configure the runtime to use it.
|
|
158
158
|
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
|
|
@@ -187,7 +187,7 @@ sql-mcp
|
|
|
187
187
|
## MCP config
|
|
188
188
|
|
|
189
189
|
> **Install the connector-focused `[mcp]` extra.** Examples use `sql-mcp[mcp]` to add
|
|
190
|
-
> FastMCP / FastAPI through `
|
|
190
|
+
> FastMCP / FastAPI through `scion-sdk`; the required Scion SDK core
|
|
191
191
|
> enables model orchestration.
|
|
192
192
|
> Combine it with the database-driver extras needed by the deployment.
|
|
193
193
|
|
|
@@ -251,15 +251,15 @@ python -m pytest # full suite against in-memory SQLite (no live DBs)
|
|
|
251
251
|
pre-commit run --all-files
|
|
252
252
|
```
|
|
253
253
|
|
|
254
|
-
<!-- BEGIN
|
|
254
|
+
<!-- BEGIN scion-sdk-deployment (generated; do not edit between markers) -->
|
|
255
255
|
|
|
256
|
-
## Deploy with `
|
|
256
|
+
## Deploy with `scion-sdk-deployment`
|
|
257
257
|
|
|
258
|
-
Provision this package with the consolidated **`
|
|
258
|
+
Provision this package with the consolidated **`scion-sdk-deployment`**
|
|
259
259
|
workflow. It selects an installed-package, editable-source, or immutable-container
|
|
260
260
|
path; records only runtime secret and TLS-profile references in `AgentConfig`; and
|
|
261
261
|
runs doctor, registration, policy, observability, and rollback gates. Ask your agent
|
|
262
|
-
to **"deploy `sql-mcp` with
|
|
262
|
+
to **"deploy `sql-mcp` with scion-sdk-deployment"**.
|
|
263
263
|
|
|
264
264
|
| Install mode | Command |
|
|
265
265
|
|------|---------|
|
|
@@ -270,7 +270,7 @@ The repository embeds no deployment profile, credential value, certificate path,
|
|
|
270
270
|
environment-specific endpoint. Supply those at runtime through `AgentConfig` and the
|
|
271
271
|
configured secret provider.
|
|
272
272
|
|
|
273
|
-
<!-- END
|
|
273
|
+
<!-- END scion-sdk-deployment -->
|
|
274
274
|
|
|
275
275
|
## Environment Variables
|
|
276
276
|
|
|
@@ -305,7 +305,7 @@ configured secret provider.
|
|
|
305
305
|
| `SQL_TIMEOUT_SECONDS` | `30` | |
|
|
306
306
|
| `SQLTOOL` | `True` | |
|
|
307
307
|
|
|
308
|
-
#### Inherited
|
|
308
|
+
#### Inherited scion-sdk variables (apply to every connector)
|
|
309
309
|
|
|
310
310
|
| Variable | Example | Description |
|
|
311
311
|
|----------|---------|-------------|
|
|
@@ -325,7 +325,7 @@ configured secret provider.
|
|
|
325
325
|
| `PROVIDER` | `openai` | LLM provider for the agent |
|
|
326
326
|
| `MODEL_ID` | `gpt-4o` | Model id for the agent |
|
|
327
327
|
|
|
328
|
-
_24 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared
|
|
328
|
+
_24 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared scion-sdk set — do not edit._
|
|
329
329
|
<!-- ENV-VARS-TABLE:END -->
|
|
330
330
|
|
|
331
331
|
<!-- GOVERNED-CAPABILITY:START -->
|
|
@@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "sql-mcp"
|
|
7
|
-
version = "2.3.
|
|
7
|
+
version = "2.3.7"
|
|
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 = [ "
|
|
12
|
+
dependencies = [ "scion-sdk[mcp]>=0.6.3,<0.7.0", "python-dotenv>=1.2.4", "sqlalchemy>=2.1.5",]
|
|
13
13
|
[[project.authors]]
|
|
14
14
|
name = "Repository Maintainers"
|
|
15
15
|
email = "maintainers@knuckles.team"
|
|
@@ -26,13 +26,13 @@ all = [ "sql-mcp[postgres,mysql,mssql,oracle]>=1.0.0",]
|
|
|
26
26
|
test = [ "pytest-xdist>=3.8.0", "pytest>=9.1.1", "pytest-asyncio>=1.4.0", "pytest-cov>=7.1.0",]
|
|
27
27
|
|
|
28
28
|
[project.scripts]
|
|
29
|
-
sql-mcp = "
|
|
29
|
+
sql-mcp = "scion_sdk.cli:serve"
|
|
30
30
|
|
|
31
|
-
[project.entry-points."
|
|
31
|
+
[project.entry-points."scion_sdk.prompt_providers"]
|
|
32
32
|
sql-mcp = "sql_mcp.prompts"
|
|
33
33
|
|
|
34
|
-
# The one declared connector identity: the fleet name (
|
|
35
|
-
[project.entry-points."
|
|
34
|
+
# The one declared connector identity: the fleet name (SCION-CONNECTOR-CONTROL-R071).
|
|
35
|
+
[project.entry-points."scion_sdk.connector"]
|
|
36
36
|
sql-mcp = "sql_mcp:connector"
|
|
37
37
|
|
|
38
38
|
[tool.uv.workspace]
|
|
@@ -70,7 +70,7 @@ def __dir__() -> list[str]:
|
|
|
70
70
|
return sorted(list(globals().keys()) + __all__)
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
from
|
|
73
|
+
from scion_sdk.connector import Connector
|
|
74
74
|
|
|
75
75
|
from sql_mcp.api_client import Api
|
|
76
76
|
from sql_mcp.auth import get_api
|
|
@@ -316,17 +316,17 @@ class SqlApi:
|
|
|
316
316
|
def _entitled(self, namespace: str, names: list[str]) -> list[str]:
|
|
317
317
|
"""Filter a connection-name list to what the calling identity may reach.
|
|
318
318
|
|
|
319
|
-
Routes the names through
|
|
319
|
+
Routes the names through scion-sdk' shared identity-scoped
|
|
320
320
|
resolver (CONCEPT:AU-OS.identity.identity-scoped-resource-autoload): a
|
|
321
321
|
caller's Okta/Keycloak groups decide which named SQL connections
|
|
322
322
|
auto-load for them. The ambient ``SYSTEM_ACTOR``
|
|
323
323
|
(unauthenticated/local) holds ``admin`` → sees all, so behaviour is
|
|
324
324
|
unchanged until a real identity scopes it down. Degrades to the full
|
|
325
|
-
list if
|
|
325
|
+
list if scion-sdk predates the resolver.
|
|
326
326
|
"""
|
|
327
327
|
try:
|
|
328
|
-
from
|
|
329
|
-
from
|
|
328
|
+
from scion_sdk.entitlements import identity_scoped_resources
|
|
329
|
+
from scion_sdk.identity import IdentityRequiredError
|
|
330
330
|
except Exception:
|
|
331
331
|
return list(names)
|
|
332
332
|
try:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Epistemic-graph ingestion for reflected relational schemas.
|
|
2
2
|
|
|
3
|
-
Writes use ``
|
|
3
|
+
Writes use ``scion_sdk.ingest`` -- the generated ``SourceIngest`` client,
|
|
4
4
|
not a local ingestion helper. Nodes use canonical ``node_type`` and edges use
|
|
5
5
|
canonical ``relationship``; nodes and edges commit in one transaction. Missing
|
|
6
6
|
engine dependencies, rejected records, conflicts, and transaction failures
|
|
@@ -11,7 +11,7 @@ from __future__ import annotations
|
|
|
11
11
|
|
|
12
12
|
from typing import Any
|
|
13
13
|
|
|
14
|
-
from
|
|
14
|
+
from scion_sdk.ingest import (
|
|
15
15
|
ChangeSet,
|
|
16
16
|
Entity,
|
|
17
17
|
IngestBinding,
|
|
@@ -611,7 +611,7 @@ def register_sql_tools(mcp: FastMCP) -> None:
|
|
|
611
611
|
include_indexes=p.get("include_indexes", True),
|
|
612
612
|
max_objects=p.get("max_objects", 5_000),
|
|
613
613
|
)
|
|
614
|
-
# ingest_entities is async now (
|
|
614
|
+
# ingest_entities is async now (scion_sdk.ingest does its own
|
|
615
615
|
# non-blocking I/O), so it runs directly on the event loop rather than
|
|
616
616
|
# through _invoke_external's thread-pool offload: that offload exists
|
|
617
617
|
# for genuinely blocking work, and wrapping an async call in it would
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Data-only subpackage: it carries ``database.ttl`` (the ``owl:Ontology``
|
|
4
4
|
``http://knuckles.team/kg/database`` module — databases, schemas, tables,
|
|
5
|
-
columns and their relationships) which the
|
|
6
|
-
the ``
|
|
5
|
+
columns and their relationships) which the scion-sdk hub federates in via
|
|
6
|
+
the ``scion_sdk.ontology_providers`` entry-point. It holds no business
|
|
7
7
|
logic and no heavy imports so the hub can resolve it cheaply.
|
|
8
8
|
"""
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
license: MIT
|
|
10
10
|
tags: [sql, database, connector, development, testing, pages, specs]
|
|
11
11
|
metadata:
|
|
12
|
-
author:
|
|
12
|
+
author: Knuckles-Team
|
|
13
13
|
version: '0.1.0'
|
|
14
14
|
---
|
|
15
15
|
# SQL MCP Development
|
|
@@ -18,7 +18,7 @@ Use this skill for changes inside the `sql-mcp` package. The connector owns the
|
|
|
18
18
|
SQLAlchemy Core facade, named-connection configuration, dialect registry,
|
|
19
19
|
read-only safety gate, bounded result envelopes, knowledge-graph ingestion, and
|
|
20
20
|
the action-routed MCP tools. Shared transports and connector contracts belong
|
|
21
|
-
to `
|
|
21
|
+
to `scion-sdk`; admission, serving, and durable graph state belong to
|
|
22
22
|
their owning repositories.
|
|
23
23
|
|
|
24
24
|
## Repository map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sql-mcp
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.7
|
|
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:
|
|
15
|
+
Requires-Dist: scion-sdk[mcp]<0.7.0,>=0.6.3
|
|
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 (`
|
|
162
|
+
| `sql-mcp[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `epistemic-graph[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
|
|
@@ -186,7 +186,7 @@ agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
|
|
|
186
186
|
|
|
187
187
|
### Knowledge-graph database (`epistemic-graph`)
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
Scion SDK core dependency (`epistemic-graph[full]`). The `[mcp]` extra keeps
|
|
190
190
|
deployments can use the bundled engine. For production or shared state, run
|
|
191
191
|
**epistemic-graph as a dedicated database service** and configure the runtime to use it.
|
|
192
192
|
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
|
|
@@ -221,7 +221,7 @@ sql-mcp
|
|
|
221
221
|
## MCP config
|
|
222
222
|
|
|
223
223
|
> **Install the connector-focused `[mcp]` extra.** Examples use `sql-mcp[mcp]` to add
|
|
224
|
-
> FastMCP / FastAPI through `
|
|
224
|
+
> FastMCP / FastAPI through `scion-sdk`; the required Scion SDK core
|
|
225
225
|
> enables model orchestration.
|
|
226
226
|
> Combine it with the database-driver extras needed by the deployment.
|
|
227
227
|
|
|
@@ -285,15 +285,15 @@ python -m pytest # full suite against in-memory SQLite (no live DBs)
|
|
|
285
285
|
pre-commit run --all-files
|
|
286
286
|
```
|
|
287
287
|
|
|
288
|
-
<!-- BEGIN
|
|
288
|
+
<!-- BEGIN scion-sdk-deployment (generated; do not edit between markers) -->
|
|
289
289
|
|
|
290
|
-
## Deploy with `
|
|
290
|
+
## Deploy with `scion-sdk-deployment`
|
|
291
291
|
|
|
292
|
-
Provision this package with the consolidated **`
|
|
292
|
+
Provision this package with the consolidated **`scion-sdk-deployment`**
|
|
293
293
|
workflow. It selects an installed-package, editable-source, or immutable-container
|
|
294
294
|
path; records only runtime secret and TLS-profile references in `AgentConfig`; and
|
|
295
295
|
runs doctor, registration, policy, observability, and rollback gates. Ask your agent
|
|
296
|
-
to **"deploy `sql-mcp` with
|
|
296
|
+
to **"deploy `sql-mcp` with scion-sdk-deployment"**.
|
|
297
297
|
|
|
298
298
|
| Install mode | Command |
|
|
299
299
|
|------|---------|
|
|
@@ -304,7 +304,7 @@ The repository embeds no deployment profile, credential value, certificate path,
|
|
|
304
304
|
environment-specific endpoint. Supply those at runtime through `AgentConfig` and the
|
|
305
305
|
configured secret provider.
|
|
306
306
|
|
|
307
|
-
<!-- END
|
|
307
|
+
<!-- END scion-sdk-deployment -->
|
|
308
308
|
|
|
309
309
|
## Environment Variables
|
|
310
310
|
|
|
@@ -339,7 +339,7 @@ configured secret provider.
|
|
|
339
339
|
| `SQL_TIMEOUT_SECONDS` | `30` | |
|
|
340
340
|
| `SQLTOOL` | `True` | |
|
|
341
341
|
|
|
342
|
-
#### Inherited
|
|
342
|
+
#### Inherited scion-sdk variables (apply to every connector)
|
|
343
343
|
|
|
344
344
|
| Variable | Example | Description |
|
|
345
345
|
|----------|---------|-------------|
|
|
@@ -359,7 +359,7 @@ configured secret provider.
|
|
|
359
359
|
| `PROVIDER` | `openai` | LLM provider for the agent |
|
|
360
360
|
| `MODEL_ID` | `gpt-4o` | Model id for the agent |
|
|
361
361
|
|
|
362
|
-
_24 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared
|
|
362
|
+
_24 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared scion-sdk set — do not edit._
|
|
363
363
|
<!-- ENV-VARS-TABLE:END -->
|
|
364
364
|
|
|
365
365
|
<!-- GOVERNED-CAPABILITY:START -->
|
|
@@ -4,8 +4,8 @@ The caller's entitled SQL connections auto-load; a non-entitled named
|
|
|
4
4
|
connection is denied; the default falls to the first entitled when the
|
|
5
5
|
configured default is off-limits. Tests the resolution/enforcement logic with
|
|
6
6
|
the entitlement source mocked (the resolver itself is tested in
|
|
7
|
-
|
|
8
|
-
reference pattern: a fake ``
|
|
7
|
+
scion-sdk, per the container-manager-mcp/vector-mcp/documentdb-mcp
|
|
8
|
+
reference pattern: a fake ``scion_sdk.security.entitlements`` module
|
|
9
9
|
rather than reassigning ``SqlApi._entitled`` on the instance).
|
|
10
10
|
"""
|
|
11
11
|
|
|
@@ -18,20 +18,20 @@ from tests.conftest import build_api
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def _install_fake_entitlements(entitled_names) -> None:
|
|
21
|
-
"""Install a fake ``
|
|
22
|
-
module = types.ModuleType("
|
|
21
|
+
"""Install a fake ``scion_sdk.security.entitlements`` module."""
|
|
22
|
+
module = types.ModuleType("scion_sdk.entitlements")
|
|
23
23
|
setattr(
|
|
24
24
|
module,
|
|
25
25
|
"identity_scoped_resources",
|
|
26
26
|
lambda namespace, names: [n for n in names if n in entitled_names],
|
|
27
27
|
)
|
|
28
|
-
sys.modules["
|
|
28
|
+
sys.modules["scion_sdk.entitlements"] = module
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
@pytest.fixture(autouse=True)
|
|
32
32
|
def _cleanup_fake_module():
|
|
33
33
|
yield
|
|
34
|
-
sys.modules.pop("
|
|
34
|
+
sys.modules.pop("scion_sdk.entitlements", None)
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
def _api(entitled):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Epistemic-graph typed-node ingestion -- Wire-First coverage for sql-mcp.
|
|
2
2
|
|
|
3
3
|
Exercises the real ``ingest_entities`` seam against a fake
|
|
4
|
-
``
|
|
4
|
+
``scion_sdk.ingest`` transport (no engine required), plus the pure
|
|
5
5
|
``catalog_to_entities`` mapper (unaffected by the ingestion migration). The
|
|
6
|
-
real SDK request builder (``
|
|
6
|
+
real SDK request builder (``scion_sdk.ingest.request.build_request``)
|
|
7
7
|
still runs, so a malformed change set is still caught by the SDK's own
|
|
8
8
|
contract, not re-derived here; only the final network commit is faked.
|
|
9
9
|
CONCEPT:AU-KG.ingest.enterprise-source-extractor.
|
|
@@ -15,7 +15,7 @@ from types import SimpleNamespace
|
|
|
15
15
|
from typing import Any
|
|
16
16
|
|
|
17
17
|
import pytest
|
|
18
|
-
from
|
|
18
|
+
from scion_sdk.ingest import IngestError, KnowledgeIngest
|
|
19
19
|
from epistemic_graph.generated.source_ingestion import SourceIngestionRequest
|
|
20
20
|
|
|
21
21
|
from sql_mcp.kg_ingest import catalog_to_entities, ingest_entities
|
|
@@ -28,7 +28,9 @@ class _FakeTransport:
|
|
|
28
28
|
self.requests: list[SourceIngestionRequest] = []
|
|
29
29
|
|
|
30
30
|
async def source_status(self, _connector: str, _stream: str) -> Any:
|
|
31
|
-
return SimpleNamespace(
|
|
31
|
+
return SimpleNamespace(
|
|
32
|
+
connector=_connector, stream=_stream, accepted_checkpoint=None
|
|
33
|
+
)
|
|
32
34
|
|
|
33
35
|
async def submit(self, request: SourceIngestionRequest) -> Any:
|
|
34
36
|
self.requests.append(request)
|
|
@@ -65,9 +67,7 @@ def _catalog():
|
|
|
65
67
|
},
|
|
66
68
|
{"name": "org_id", "type": "INTEGER", "nullable": True},
|
|
67
69
|
],
|
|
68
|
-
"foreign_keys": [
|
|
69
|
-
{"columns": ["org_id"], "referred_table": "orgs"}
|
|
70
|
-
],
|
|
70
|
+
"foreign_keys": [{"columns": ["org_id"], "referred_table": "orgs"}],
|
|
71
71
|
"indexes": [
|
|
72
72
|
{
|
|
73
73
|
"name": "ix_users_org",
|
|
@@ -238,7 +238,9 @@ def test_catalog_to_entities_skips_non_dict_foreign_keys():
|
|
|
238
238
|
"target": "database:table:default.public.users",
|
|
239
239
|
"relationship": "referencesTable",
|
|
240
240
|
} in relationships
|
|
241
|
-
assert
|
|
241
|
+
assert (
|
|
242
|
+
len([r for r in relationships if r["relationship"] == "referencesTable"]) == 1
|
|
243
|
+
)
|
|
242
244
|
|
|
243
245
|
|
|
244
246
|
def test_catalog_to_entities_skips_invalid_columns_and_indexes():
|
|
@@ -266,9 +268,7 @@ def test_catalog_to_entities_caps_relationships_independently_of_entity_count():
|
|
|
266
268
|
# (max_objects * 4) while entities stays well under max_objects -- the
|
|
267
269
|
# only way to exercise add_relationship's own cap independently of
|
|
268
270
|
# entities_full().
|
|
269
|
-
foreign_keys = [
|
|
270
|
-
{"columns": [], "referred_table": f"ref_{i}"} for i in range(20)
|
|
271
|
-
]
|
|
271
|
+
foreign_keys = [{"columns": [], "referred_table": f"ref_{i}"} for i in range(20)]
|
|
272
272
|
catalog = {
|
|
273
273
|
"connection": "default",
|
|
274
274
|
"schema": "public",
|
|
@@ -155,7 +155,7 @@ async def test_action_models_reject_unknown_arguments(mcp):
|
|
|
155
155
|
async def test_sql_reflection_runs_off_loop_kg_ingest_runs_on_loop(mcp, monkeypatch):
|
|
156
156
|
"""SQL reflection still offloads to a worker thread (genuinely blocking
|
|
157
157
|
SQLAlchemy I/O via ``_invoke_external``). KG ingestion no longer needs that
|
|
158
|
-
offload: ``
|
|
158
|
+
offload: ``scion_sdk.ingest``'s ``KnowledgeIngest.submit()`` does
|
|
159
159
|
non-blocking async I/O, so ``sql_ingest_schema`` now awaits it directly on
|
|
160
160
|
the event loop rather than wrapping it in ``_invoke_external`` -- wrapping
|
|
161
161
|
an async call in a thread-pool offload would create-and-discard a
|
|
@@ -4,12 +4,12 @@ import json
|
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
6
|
|
|
7
|
-
pytest.importorskip("
|
|
7
|
+
pytest.importorskip("scion_sdk.mcp.action_dispatch")
|
|
8
8
|
|
|
9
9
|
from fastmcp import Client # noqa: E402
|
|
10
10
|
|
|
11
11
|
from sql_mcp import auth # noqa: E402
|
|
12
|
-
from
|
|
12
|
+
from scion_sdk.connector import build_server # noqa: E402
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
async def list_tool_names(mcp) -> set[str]:
|
|
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
|
{sql_mcp-2.3.6 → sql_mcp-2.3.7}/sql_mcp/skills/sql-mcp-knowledge-graph-ingestion/WORKFLOW.md
RENAMED
|
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
|