Atlas / MCP servers / ashishsinha1602 / schemagate

schemagateBLOCK

mcp/ashishsinha1602/schemagate

Text-to-SQL access control: schema selection that gives the LLM only the tables the caller is allowed to read. Row-level-security-aware table pruning for LangChain, MCP and any SQL agent. Postgres, Oracle, MySQL, SQL Server. 75% fewer prompt tokens.

Verdict
BLOCK
Grade
D
Trust score
62 /100
Exposed tools
—
Transport
stdio · streamable-http
License
Apache-2.0
Stars
102
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

[](https://pypi.org/project/schemagate/) [](https://pypi.org/project/schemagate/) [](https://github.com/ashishsinha1602/schemagate/actions/workflows/ci.yml) [](LICENSE) [](https://www.bestpractices.dev/projects/15353) [](https://api.reuse.software/info/github.com/ashishsinha1602/schemagate) [](https://pepy.tech/projects/schemagate) [](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.ashishsinha1602/schemagate) [](https://ashishsinha1602.github.io/schemagate/)

Your text-to-SQL agent picks which tables to show the model before anyone checks what the caller is allowed to read. schemagate does the check first: it filters the schema by the caller's grants, so restricted tables are absent from the prompt rather than ranked low. Works with LangChain, MCP, or any SQL agent, on Postgres, Oracle, MySQL, SQL Server and SQLite.

If it keeps a table out of a prompt it should never have reached, a ⭐ helps oth

Read from source at commit c3869f7631d6OBSERVED · 2026-10-12
02

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.

claude-code (pypi)
claude mcp add schemagate --env SCHEMAGATE_DATABASE_URL=${SCHEMAGATE_DATABASE_URL} -- python schemagate==1.4.1 -m schemagate.mcp_server
03

Trust audit

BLOCKgrade D · trust 62/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeFAIL
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
declared (4 observation(s))
Network
declared (5 observation(s))
Shell
declared (1 observation(s))
Dependencies
pinned
Secrets in source
found

Findings (20)

HIGHHard-coded secrets · secret.db_uri · CWE-798, CWE-321
src/schemagate/cli.py:9
schemagate certify postgresql://user:pw@host/db  # end-to-end check on your engine
MEDIUMCode injection · code.dynamic_import · CWE-78, CWE-94, CWE-95
studio/build_answers.py:55
mod = __import__(mods[key])
MEDIUMNetwork egress · net.raw_ip · CWE-200, CWE-319
Dockerfile:52
CMD curl -fsS "http://127.0.0.1:${SCHEMAGATE_STUDIO_PORT}/api/health" || exit 1
MEDIUMNetwork egress · net.raw_ip · CWE-200, CWE-319
oci/stack/cloud-init.yaml:316
# then http://127.0.0.1:8770 in your own browser. `--no-connect` is
MEDIUMHard-coded secrets · secret.db_uri · CWE-798, CWE-321
benchmarks/fixture_1200.py:530
PG_URL_DEFAULT = "postgresql://postgres:[email protected]:5433/sgbench"
MEDIUMHard-coded secrets · secret.db_uri · CWE-798, CWE-321
tests/test_groups_live.py:9
SGBENCH_PG_URL=postgresql://postgres:[email protected]:5434/sgbench   pytest tests/test_groups_live.py
MEDIUMHard-coded secrets · secret.db_uri · CWE-798, CWE-321
tests/test_groups_live_server.py:10
SGBENCH_PG_URL=postgresql://postgres:[email protected]:5434/sgbench   pytest tests/test_groups_live_server.py
MEDIUMHard-coded secrets · secret.db_uri · CWE-798, CWE-321
tests/test_rls_live.py:4
SCHEMAGATE_PG_URL=postgresql://postgres:[email protected]:5432/app  pytest tests/test_rls_live.py
LOWCode injection · code.deserialize · CWE-78, CWE-94, CWE-95
benchmarks/complex_sql_1200.py:113
cat.add_all(pickle.loads(cache.read_bytes()))
Why it matters. deserialises untrusted bytes into live objects
Fix. use json or yaml.safe_load
LOWCode injection · code.deserialize · CWE-78, CWE-94, CWE-95
benchmarks/fixture_1200.py:749
cat.add_all(pickle.loads(cache.read_bytes()))
Why it matters. deserialises untrusted bytes into live objects
Fix. use json or yaml.safe_load
LOWCode injection · code.dynamic_import · CWE-78, CWE-94, CWE-95
tests/test_no_restricted_names.py:101
mod = importlib.import_module(fixture)
LOWCode injection · code.eval_exec · CWE-78, CWE-94, CWE-95
tests/test_dialect_mssql_live.py:37
f"IF SCHEMA_ID('{SCHEMA}') IS NULL EXEC('CREATE SCHEMA {SCHEMA}')",
Why it matters. evaluates text as code
Fix. remove; use a parser or a dispatch table
LOWNetwork egress · net.metadata_ip · CWE-200, CWE-319
oci/stack/README.md:136
local process on that VM can read at `169.254.169.254`. It is also in
Why it matters. cloud metadata endpoint: the classic SSRF credential grab
LOWNetwork egress · net.raw_ip · CWE-200, CWE-319
README.md:208
schemagate                        # opens http://127.0.0.1:8770 on the 42-object demo
LOWNetwork egress · net.raw_ip · CWE-200, CWE-319
oci/README.md:63
then open <http://127.0.0.1:8770>. See `stack/README.md` for why it is not public.
LOWNetwork egress · net.raw_ip · CWE-200, CWE-319
oci/stack/README.md:206
Then open <http://127.0.0.1:8770>. It is already pointed at the database the
LOWObfuscation / stealth · obf.decode_call · CWE-506, CWE-94
src/schemagate/pq.py:258
sig = base64.b64decode(rec["sig"], validate=True)
LOWInventory / provenance · mcp.no_tools_extracted · CWE-1104
server.json
Why it matters. the tool list is enumerated at runtime by tools/list, not declared in source
Fix. the page says so rather than showing an empty table
INFOPrompt injection · prompt.credential_read · CWE-94, CWE-1427
CHANGELOG.md:723
and access control lists while the answer is a password.
Why it matters. asks the agent to read credentials
INFOPrompt injection · prompt.credential_read · CWE-94, CWE-1427
oci/stack/ORACLE-TEST.md:71
for line in open("/etc/schemagate.env"):
Why it matters. asks the agent to read credentials

Gates applied: no_behavioural_pass.

Audited 2026-10-12 · audit v0.4.1 · source sha c3869f7631d6full audit observations/trust-audit/mcp-server/ashishsinha1602__schemagate.json · Report an issue / request a re-scan
04

Audit history

Every audit this server has had. A grade with a past is a grade somebody is still checking.

DateSourceVerdictGradeScoreChange
2026-10-12c3869f7631d6BLOCKD62first audit
05

Questions

What is the schemagate MCP server?

Text-to-SQL access control: schema selection that gives the LLM only the tables the caller is allowed to read. Row-level-security-aware table pruning for LangChain, MCP and any SQL agent. Postgres, Oracle, MySQL, SQL Server. 75% fewer prompt tokens.

Is schemagate safe to connect to an agent?

No — not without reading the findings first. The audit graded it D (62/100) and found 1 critical or high issue in the source. Each one is listed on this page with the file and line it is on.

What credentials does schemagate need?

It reads ADMIN_PASSWORD, ANTHROPIC_API_KEY, GEMINI_API_KEY, GOOGLE_API_KEY, HF_TOKEN, OCI_CLI_AUTH, OPENAI_API_KEY, SCHEMAGATE_DATABASE_URL, SCHEMAGATE_ORACLE_PASSWORD, SGBENCH_PASSWORD and WALLET_PASSWORD from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.

How does schemagate run?

It speaks stdio and streamable-http, so it runs as a local process your client starts. It is published on PyPI as ashiq.

How current is this page?

The grade is for one exact copy of the source (c3869f7631d6), read on 2026-10-12. The repository is watched and re-audited when it changes.

Advertisement