{"at":"2026-11-23T01:33:56.513Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T01:33:57.635Z","dir":"received","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","result":{"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"mysql-audit","version":"0.3.3"}},"cacheScope":"private","capabilities":{"prompts":{"listChanged":true},"resources":{"listChanged":true,"subscribe":true},"tools":{"listChanged":true}},"instructions":"Call review_migration before running any MySQL DDL, migration file, or bulk UPDATE/DELETE, review_query for queries you add to application code, and review_code for code that builds SQL. If the verdict is 'block', do not run or commit it; rewrite it using each finding's fix and review again. If it is 'review', tell the user about the findings. For exact results pass the CREATE TABLE statements as schema, row counts from information_schema.tables as stats, and the server's version as mysql_version. A .mysql-audit.toml in the project supplies any of these you leave out. Before a migration on existing tables is deployed, give the user preflight_checks. Never tell the user an online ALTER (ALGORITHM=INPLACE, LOCK=NONE) does not block: it takes an exclusive metadata lock at its start and end, and queries queue behind it while it waits.","resultType":"complete","supportedVersions":["2026-07-28"],"ttlMs":0}}}
{"at":"2026-11-23T01:33:57.635Z","dir":"sent","era":"server_discover","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T01:33:57.636Z","dir":"received","era":"server_discover","message":{"id":2,"jsonrpc":"2.0","result":{"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"mysql-audit","version":"0.3.3"}},"cacheScope":"private","resultType":"complete","tools":[{"description":"Review MySQL DDL or a migration script for locking, data-loss and replication risks.\n\nArgs:\n    sql: The SQL to run, one or more statements separated by semicolons.\n    schema: Optional CREATE TABLE statements for the tables involved (e.g. from\n        SHOW CREATE TABLE). Makes column-type and index checks exact.\n    stats: Optional size per table from information_schema.tables: a row count\n        ({\"orders\": 25000000}) or {\"orders\": {\"rows\": 25000000, \"data_bytes\":\n        <data_length>, \"index_bytes\": <index_length>}}. Large = 1M rows or 5 GB.\n    mysql_version: Optional target server version, e.g. \"8.0.28\", \"8.4.3\" or\n        \"aurora-3.04\" (SELECT VERSION()). Older servers copy the table for more\n        column changes. Without it, 8.0.29 or later is assumed.\n    free_disk_gb: Optional free space on the server's data volume, in GB. With\n        byte sizes in stats, a table rebuild that does not fit is blocked.\n    rollback_sql: Optional down migration kept in a separate file (e.g. a\n        golang-migrate .down.sql or Flyway U__ file). Down sections and\n        --rollback lines inside sql are found without it.\n\nReturns a verdict (safe / review / block) and findings with line, impact and fix.\n","inputSchema":{"properties":{"free_disk_gb":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Free Disk Gb"},"mysql_version":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Mysql Version"},"rollback_sql":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Rollback Sql"},"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Schema"},"sql":{"title":"Sql","type":"string"},"stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"title":"Stats"}},"required":["sql"],"title":"review_migrationArguments","type":"object"},"name":"review_migration"},{"description":"Review queries an application will run (SELECT / UPDATE / DELETE / INSERT) for missing\nindexes, unbatched writes and unsafe UPDATE/DELETE. Pass schema for index checks.\n\nReturns a verdict (safe / review / block) and findings with line, impact and fix.\n","inputSchema":{"properties":{"mysql_version":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Mysql Version"},"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Schema"},"sql":{"title":"Sql","type":"string"},"stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"title":"Stats"}},"required":["sql"],"title":"review_queryArguments","type":"object"},"name":"review_query"},{"description":"Check application source code (Python, JS/TS, PHP, Go, Java) for SQL built by string\ninterpolation or concatenation, i.e. SQL injection.\n\nReturns a verdict (safe / block) and findings with line and the parameterized fix.\n","inputSchema":{"properties":{"code":{"title":"Code","type":"string"}},"required":["code"],"title":"review_codeArguments","type":"object"},"name":"review_code"},{"description":"SQL for the user (or DBA) to run on the primary right before deploying a migration:\nlong transactions, long queries and metadata locks on the tables it touches, current\ntable sizes, and how to check replica lag. Each query returns rows only when the deploy\nshould wait. This tool does not connect to the database; hand the SQL to the user.\n\nArgs:\n    sql: The migration that is about to run.\n    mysql_version: Optional server version, e.g. \"5.7.44\"; picks SHOW SLAVE / REPLICA STATUS.\n","inputSchema":{"properties":{"mysql_version":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Mysql Version"},"sql":{"title":"Sql","type":"string"}},"required":["sql"],"title":"preflight_checksArguments","type":"object"},"name":"preflight_checks"},{"description":"Explain one rule (e.g. \"L02\"): why it matters and a safe example.","inputSchema":{"properties":{"rule_id":{"title":"Rule Id","type":"string"}},"required":["rule_id"],"title":"explain_ruleArguments","type":"object"},"name":"explain_rule"},{"description":"List every rule this server checks, with its id, title and default severity.","inputSchema":{"properties":{},"title":"list_rulesArguments","type":"object"},"name":"list_rules","outputSchema":{"properties":{"result":{"items":{"additionalProperties":true,"type":"object"},"title":"Result","type":"array"}},"required":["result"],"title":"list_rulesOutput","type":"object"}}],"ttlMs":0}}}
{"at":"2026-11-23T01:33:57.837Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T01:33:58.899Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"prompts":{"listChanged":false},"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},"instructions":"Call review_migration before running any MySQL DDL, migration file, or bulk UPDATE/DELETE, review_query for queries you add to application code, and review_code for code that builds SQL. If the verdict is 'block', do not run or commit it; rewrite it using each finding's fix and review again. If it is 'review', tell the user about the findings. For exact results pass the CREATE TABLE statements as schema, row counts from information_schema.tables as stats, and the server's version as mysql_version. A .mysql-audit.toml in the project supplies any of these you leave out. Before a migration on existing tables is deployed, give the user preflight_checks. Never tell the user an online ALTER (ALGORITHM=INPLACE, LOCK=NONE) does not block: it takes an exclusive metadata lock at its start and end, and queries queue behind it while it waits.","protocolVersion":"2025-11-25","serverInfo":{"name":"mysql-audit","version":"0.3.3"}}}}
{"at":"2026-11-23T01:33:58.899Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T01:33:58.899Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T01:33:58.901Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Review MySQL DDL or a migration script for locking, data-loss and replication risks.\n\nArgs:\n    sql: The SQL to run, one or more statements separated by semicolons.\n    schema: Optional CREATE TABLE statements for the tables involved (e.g. from\n        SHOW CREATE TABLE). Makes column-type and index checks exact.\n    stats: Optional size per table from information_schema.tables: a row count\n        ({\"orders\": 25000000}) or {\"orders\": {\"rows\": 25000000, \"data_bytes\":\n        <data_length>, \"index_bytes\": <index_length>}}. Large = 1M rows or 5 GB.\n    mysql_version: Optional target server version, e.g. \"8.0.28\", \"8.4.3\" or\n        \"aurora-3.04\" (SELECT VERSION()). Older servers copy the table for more\n        column changes. Without it, 8.0.29 or later is assumed.\n    free_disk_gb: Optional free space on the server's data volume, in GB. With\n        byte sizes in stats, a table rebuild that does not fit is blocked.\n    rollback_sql: Optional down migration kept in a separate file (e.g. a\n        golang-migrate .down.sql or Flyway U__ file). Down sections and\n        --rollback lines inside sql are found without it.\n\nReturns a verdict (safe / review / block) and findings with line, impact and fix.\n","inputSchema":{"properties":{"free_disk_gb":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Free Disk Gb"},"mysql_version":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Mysql Version"},"rollback_sql":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Rollback Sql"},"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Schema"},"sql":{"title":"Sql","type":"string"},"stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"title":"Stats"}},"required":["sql"],"title":"review_migrationArguments","type":"object"},"name":"review_migration"},{"description":"Review queries an application will run (SELECT / UPDATE / DELETE / INSERT) for missing\nindexes, unbatched writes and unsafe UPDATE/DELETE. Pass schema for index checks.\n\nReturns a verdict (safe / review / block) and findings with line, impact and fix.\n","inputSchema":{"properties":{"mysql_version":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Mysql Version"},"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Schema"},"sql":{"title":"Sql","type":"string"},"stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"title":"Stats"}},"required":["sql"],"title":"review_queryArguments","type":"object"},"name":"review_query"},{"description":"Check application source code (Python, JS/TS, PHP, Go, Java) for SQL built by string\ninterpolation or concatenation, i.e. SQL injection.\n\nReturns a verdict (safe / block) and findings with line and the parameterized fix.\n","inputSchema":{"properties":{"code":{"title":"Code","type":"string"}},"required":["code"],"title":"review_codeArguments","type":"object"},"name":"review_code"},{"description":"SQL for the user (or DBA) to run on the primary right before deploying a migration:\nlong transactions, long queries and metadata locks on the tables it touches, current\ntable sizes, and how to check replica lag. Each query returns rows only when the deploy\nshould wait. This tool does not connect to the database; hand the SQL to the user.\n\nArgs:\n    sql: The migration that is about to run.\n    mysql_version: Optional server version, e.g. \"5.7.44\"; picks SHOW SLAVE / REPLICA STATUS.\n","inputSchema":{"properties":{"mysql_version":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Mysql Version"},"sql":{"title":"Sql","type":"string"}},"required":["sql"],"title":"preflight_checksArguments","type":"object"},"name":"preflight_checks"},{"description":"Explain one rule (e.g. \"L02\"): why it matters and a safe example.","inputSchema":{"properties":{"rule_id":{"title":"Rule Id","type":"string"}},"required":["rule_id"],"title":"explain_ruleArguments","type":"object"},"name":"explain_rule"},{"description":"List every rule this server checks, with its id, title and default severity.","inputSchema":{"properties":{},"title":"list_rulesArguments","type":"object"},"name":"list_rules","outputSchema":{"properties":{"result":{"items":{"additionalProperties":true,"type":"object"},"title":"Result","type":"array"}},"required":["result"],"title":"list_rulesOutput","type":"object"}}]}}}
