sql-explorer-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sql-explorer-mcp list tables in the sales schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sql-explorer-mcp
Personal, read-only MCP server for browsing/querying a SQL Server database from Claude Code (or any MCP client). Built for local dev use — not intended to be exposed over a network or shared with other people.
Tools exposed
list_schemas— list all schemaslist_tables— list tables, optionally filtered by schemalist_views— list views, optionally filtered by schemalist_procedures— list stored procedures, optionally filtered by schemalist_functions— list functions (with return type), optionally filtered by schemadescribe_table— columns, types, nullability, primary key for a tabledescribe_view— columns and theCREATE VIEWdefinition for a viewdescribe_procedure— parameters and theCREATE PROCEDUREdefinition (metadata only — never executes it)describe_function— parameters, return type, and theCREATE FUNCTIONdefinition (metadata only — never executes it)browse_table—SELECT TOP N * FROM schema.table(no filter)query_table— same as above with one validatedWHERE column op valueconditionjoin_tables—SELECTacross multiple tables/views with explicit join conditions; every table, alias, and column is validated the same way as the single-table toolsrun_query— arbitrary read-only SQL: CTEs (WITH ...), subqueries,GROUP BY/aggregates, window functions,UNION,ORDER BY— anything a singleSELECTstatement can express. See safety notes below.find_similar_names— Jaro-Winkler fuzzy search over table/view/column/procedure/function names, for when you don't remember the exact spellingfuzzy_search_column— Jaro-Winkler fuzzy search over the distinct values of a single text column
Related MCP server: SQL Query Tools MCP Server
Safety notes
Point this at a read-only login. Create a SQL login scoped to
db_datareader(or equivalent) on whatever database you connect it to. The tool code itself never issues writes, but the real safety boundary should be the DB permission, not the app logic.Every schema/table/column name used in a query is checked against a live
INFORMATION_SCHEMAlookup before being used — the server never interpolates an unverified identifier into SQL.Filter values in
query_tableandjoin_tablesare always passed as parameters (@value), never string-concatenated.join_tablesaccepts no raw SQL — table/column names are whitelisted per the rule above, and join aliases (which aren't real DB identifiers) are restricted to a safe[A-Za-z_][A-Za-z0-9_]*pattern before being quoted in.run_queryis the one tool that accepts raw SQL text, so it doesn't get the whitelist treatment — it gets two layers instead. First, a text-level guard rejects anything but a singleSELECT/WITH ... SELECTstatement and rejects the query outright if it contains a second;-separated statement or any ofINSERT/UPDATE/DELETE/MERGE/EXEC/EXECUTE/DROP/ALTER/CREATE/ TRUNCATE/GRANT/REVOKE/DENY/OPENROWSET/OPENDATASOURCE/OPENQUERY/BULK/INTO/ sp_executesql. Second, even after passing that check, the query runs inside a transaction that is unconditionally rolled back afterwards — so a write that somehow slips past the text filter still can't persist. Neither layer is a parser, and neither is a substitute for the read-only DB login recommended above — they're defense in depth on top of it, not instead of it.describe_procedure/describe_functiononly ever read metadata (INFORMATION_SCHEMA.PARAMETERS,OBJECT_DEFINITION()) — there is no tool that callsEXEC, since running a procedure could itself be a write.The fuzzy-search tools (
find_similar_names,fuzzy_search_column) compute Jaro-Winkler similarity in-process after a normal validatedSELECT; the search term never becomes part of the SQL text.Row limits are capped server-side at 200 regardless of what's requested.
Setup
npm install
npm run buildEnvironment variables
Variable | Required | Notes |
| yes | e.g. |
| yes | database name |
| yes | read-only SQL login |
| yes | |
| no | defaults to |
| no | set |
Claude Code configuration
Add to your MCP config (project-level .mcp.json or global config):
{
"mcpServers": {
"sql-browser": {
"command": "node",
"args": ["/absolute/path/to/sql-mcp-server/dist/index.js"],
"env": {
"DB_SERVER": "your-server.database.windows.net",
"DB_NAME": "your-db",
"DB_USER": "readonly_user",
"DB_PASSWORD": "your-password",
"DB_ENCRYPT": "true"
}
}
}
}Don't commit real credentials into .mcp.json if the repo is shared — use a
local, gitignored config, or reference environment variables already set on
your machine.
Extending
The query_table tool intentionally supports only a single WHERE condition
to keep the validation surface small. If you need multiple conditions later,
extend the input schema to accept an array of { column, operator, value }
and validate each one against getValidColumns() the same way — resist the
temptation to accept a raw SQL fragment.
Available Tools
15 toolsbrowse_tableBrowse tableA
Preview rows from a table (SELECT TOP N *). Max 200 rows, no filtering — use query_table for filtered results.
Inputs: table (required), schema (required), limit.
describe_functionDescribe functionA
Get parameters, return type, and the SQL definition (CREATE FUNCTION body) for a function. This tool only reads the function's metadata — it never executes it.
Inputs: schema (required), function (required).
describe_procedureDescribe stored procedureA
Get parameters and the SQL definition (CREATE PROCEDURE body) for a stored procedure. This tool only reads the procedure's metadata — it never executes it.
Inputs: schema (required), procedure (required).
describe_tableDescribe tableA
Get column names, data types, nullability, and primary key info for a table.
Inputs: table (required), schema (required).
describe_viewDescribe viewA
Get column names/types for a view, plus its SQL definition (CREATE VIEW body).
Inputs: view (required), schema (required).
find_similar_namesFind similar names (fuzzy)A
Jaro-Winkler fuzzy search over table/view/column/procedure/function names — use this when you don't remember the exact spelling of an object.
Inputs: searchTerm (required), kinds, limit.
fuzzy_search_columnFuzzy search column valuesA
Jaro-Winkler fuzzy search over the distinct values of a single text column — use this to find rows whose value is close to (but not an exact match for) a search term. Samples up to sampleSize distinct values server-side, then ranks them client-side.
Inputs: table (required), column (required), schema (required), searchTerm (required), +2 more.
join_tablesJoin tablesA
Select across multiple tables/views with explicit join conditions. Every table and column is validated against the real schema (same as browse_table/query_table) — no raw SQL fragments are accepted. Max 200 rows, up to 6 joins.
Inputs: base (required), joins (required), limit, where, +1 more.
list_functionsList functionsA
List functions in the database, optionally filtered to a single schema. Includes the return data type.
Inputs: schema.
list_proceduresList stored proceduresA
List stored procedures in the database, optionally filtered to a single schema.
Inputs: schema.
list_schemasList schemasA
List all schemas in the connected database.
Inputs: no named parameters.
list_tablesList tablesA
List tables in the database, optionally filtered to a single schema. Returns table_schema and table_name for each.
Inputs: schema.
list_viewsList viewsA
List views in the database, optionally filtered to a single schema. Returns table_schema and table_name for each.
Inputs: schema.
query_tableQuery table with filterA
Select rows from a table with a single WHERE condition (column, operator, value). Column and operator are validated against the real schema. Max 200 rows.
Inputs: table (required), value (required), column (required), schema (required), +2 more.
run_queryRun raw SQL query (read-only)A
Run an arbitrary read-only query — CTEs (WITH ...), subqueries, GROUP BY/aggregates, window functions, UNION, ORDER BY, anything a single SELECT statement can express. Only one SELECT (optionally led by a WITH clause) statement is allowed: the query is rejected before it reaches the database if it contains a second statement or any write/DDL/EXEC keyword, and it additionally always runs inside a transaction that gets rolled back afterwards regardless of outcome, as a second line of defense. Results are capped at 500 rows.
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool targets a distinct aspect of SQL exploration: listing metadata, describing specific object types, browsing/querying/joining data, running arbitrary read-only queries, and fuzzy-searching names vs column values. Even the query tools have clear boundaries (browse=unfiltered preview, query=single condition, join=multi-table validated, run=arbitrary SQL).
All tool names follow a consistent snake_case verb_noun pattern (list_*, describe_*, browse_table, query_table, join_tables, run_query, find_similar_names, fuzzy_search_column). The verb accurately reflects the operation and the noun indicates the target object.
15 tools is at the upper end of a well-scoped server, but each tool serves a unique and justified purpose—covering listing, describing, querying, joining, arbitrary read-only execution, and fuzzy search. No redundant or trivial tools are present.
The tool set provides comprehensive coverage for a SQL schema/data explorer: complete metadata listing (schemas, tables, views, procedures, functions), detailed descriptions (columns, definitions, parameters), multiple data retrieval methods (browse/query/join/run_query), and fuzzy search for both object names and column values. No significant gaps are apparent.
Maintenance
Related MCP Connectors
2,000+ MCP servers read at source level. Know what one does before you connect. Free, no key.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceRead-only SQL Server MCP server enabling safe database queries, table listing, and schema inspection with built-in security protections.MIT
- AlicenseAqualityDmaintenanceMCP server for connecting to SQL Server in readonly mode. Allows any MCP client to explore the schema and run SELECT queries against a SQL Server database.6MIT
- AlicenseNot gradedqualityDmaintenanceA read-only, schema-aware MCP server that connects to SQL databases and provides tools for refining questions, browsing schema, validating, explaining, and running SELECT statements with safety guards.MIT
- FlicenseNot gradedqualityDmaintenanceA read-only MCP server for exploring and querying Oracle schemas safely. Provides tools for table listing, schema description, column search, and validated SELECT execution.2-