MCP server implementation to work with SQL databases (MySQL, PostgreSQL, SQLite, SQL Server). Supports read-only queries, schema inspection, and PII detection/redaction.
Two well-documented tools with comprehensive descriptions and detailed parameter schemas. Naming is action-oriented (query, schema) and clear. Descriptions are thorough (500+ chars each) and include discovery workflows, constraints, and usage examples. Input parameters have types and descriptions. However, output schemas are not formally documented in the tool definitions, the descriptions reference return structure but no explicit JSON Schema output is visible in the source code. Error handling is described in usage guidance but not formalized as tool response contracts. Overall strong definition quality with the caveat that output documentation relies on implicit description text rather than explicit schema.
Runs read-only SQL queries against chosen database connection. Only SELECT queries are allowed. INSERT, UPDATE, DELETE, DROP, and other write operations are blocked. START HERE - REQUIRED DISCOVERY FLOW: - Before writing SQL, read db://{connection} to list available tables for the target connection. - Then read db://{connection}/{table} for the exact schema of tables you plan to query. - This avoids "table not found" and wrong-column errors. - Before querying information_schema/system catalogs for metadata/definitions, try database_schema with detail="full" (and includeRoutines/includeViews when needed). ROW LIMIT: - Default to LIMIT 10 when browsing or exploring data. Use TOP 10 on SQL Server. - Use a larger LIMIT or TOP only when the task requires a specific known row count, such as 31 daily buckets. - Keep the limit as small as the task allows. RULES: 1. SELECT without WHERE requires LIMIT or TOP, except for aggregate-only queries without GROUP BY, such as SELECT COUNT(*) FROM users. 2. Check the connection type before writing the query - use correct syntax for that database. 3. To browse beyond the first page, use pagination with OFFSET. 4. Large text columns (>200 chars) are truncated to "<TEXT>" in multi-row results. To view full text, Query MUST return exactly 1 row. Examples: MySQL/PostgreSQL/SQLite: SELECT * FROM users LIMIT 10; SQL Server: SELECT TOP 10 * FROM users; Aggregates (no LIMIT needed): SELECT COUNT(*) FROM users;
Inspect schema for a database connection. Use database_schema(detail="full", includeRoutines=true) as the default way to fetch trigger/function/procedure/view definitions. Prefer this over raw information_schema/system catalog queries. Detail levels: - summary (default): matching table names. - columns: matching tables with column types. - full: full table structures (columns, indexes, foreign keys, triggers, check constraints). Object coverage: - tables: columns/indexes/foreign keys/check constraints/triggers (with trigger definitions in full detail). - views: SQL definitions when includeViews=true. - routines: function/procedure definitions when includeRoutines=true and detail="full". Include flags: - includeViews=true adds view names for summary/columns. - includeRoutines=true adds stored_procedures, functions, sequences, and trigger names for summary/columns. - Triggers are included under each table for detail="full" and are not duplicated under routines. Definition preference: - If output already includes a definition field, do not re-query raw catalogs/system tables. Usage guidance: - detail="full" and detail="columns" should be used with a narrow filter whenever possible. - Large full/columns outputs are rejected with ToolUsageError; refine filter or use summary. Filter note: - filter is optional and matches object names (tables, views, procedures, functions, sequences, triggers). - In detail="full", matching routine/view/trigger objects include their definitions in output. - Omit filter (or use filter="") to include all object names. Examples: - Get trigger function body by name: connection="users", filter="trg_users_insert_fn", detail="full", includeRoutines=true - Get view SQL by view name: connection="users", filter="my_view", detail="full", includeViews=true - Get all routines in schema prefix: connection="users", filter="public.", matchMode="prefix", detail="full", includeRoutines=true Routine note: - In PostgreSQL, many routines are exposed as functions (not procedures). If detail="columns" or detail="full" output is too large, the tool returns ToolUsageError and asks for a narrower filter.
Output schemas not formally documented. Descriptions reference return structure (tables, rows, truncation rules) but no explicit JSON Schema output definition is visible in tool registration.
Error handling described in text guidance but not formalized as tool response contracts. LLM must infer recovery actions from description prose rather than structured error categories.
No tool annotations present (readOnlyHint, destructiveHint, idempotentHint). Both tools are read-only but this is not declared via protocol mechanism.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 66 | 2026-07-28+ | v2 |