/schemagate:schemagate-sqlfrom schemagate
Queries large SQL databases via the schemagate MCP server, which selects only relevant tables per question (≈91% fewer schema tokens) and enforces per-user read permissions. Use when a user asks a data question needing a SQL query.
Ships in schemagate. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
schemagate is not another database connector. Database MCP servers hand the model the whole schema, or let it browse table by table, and leave the hard part to the model: picking the few tables that matter out of hundreds, and never touching the ones this user must not see. schemagate is the selection layer that does that part.
run_query refuses writes, multiple statements
and any object outside the caller's scope.langchain-schemagate); also a LlamaIndex retriever and an entry in the
official MCP Registry. Apache-2.0.This plugin starts the server for you (uvx, from
schemagate[mcp,databases]==1.15.5). With no database URL it opens demo,
a bundled 42-table sample schema, so you can try it without credentials.
For a real database, set SCHEMAGATE_DATABASE_URL to its SQLAlchemy URL in
your shell before starting Claude Code (for example
postgresql+psycopg://user@host/db, mysql+pymysql://...,
oracle+oracledb://..., or sqlite:///path/app.db). Use a read-only
database user. Never paste the URL or password into the chat.
select_schema with the user's question.
Pass principal and roles when you know who is asking. A principal is
namespaced, for example okta:jdoe or db:APP_USER. Without them the
caller is anonymous and sees only unrestricted objects.ddl field and nothing else. If the DDL starts with a note that the
caller may read only part of the database and the question needs data that
is not shown, tell the user the answer is not available to them instead of
approximating it from other columns.run_query, passing the same principal and roles. It
accepts a single read-only SELECT and returns rows, capped by max_rows.not available to this caller means the query named something outside the caller's scope. Say so;
do not report it as "no results" and do not retry with other roles.describe_object: full DDL for one table or view when the compact DDL is
not enough. A restricted object and a missing one give the same error.list_objects: everything this caller may read. Long on a large database;
use select_schema to answer a question.refresh_catalog: re-read the structure after a migration or a grant change.health: server status, object count, and whether the catalog is stale.answer, semantic_query, deep_answer: need a model provider configured
on the server. Without one, answer returns the scoped schema for you to
write the SQL yourself, and the other two report that they are off.principal and roles the client sends.
It scopes what the model sees; it does not authenticate anyone.select_schema again with a
more specific question or use describe_object.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
SQL, PostgreSQL, MySQL, SQLite, SQL Server, Oracle, Snowflake, BigQuery
text-to-sql, schema-selection, database-querying, mcp-server
npx claudepluginhub ashishsinha1602/schemagate --plugin schemagateOther plugins' skills for the same job