Skip to content

MCP: goforge_modernize_query converts a whole script - #12

Merged
swsarancodes merged 1 commit into
mainfrom
feat/mcp-script-conversion
Oct 25, 2026
Merged

swsarancodes merged 1 commit into
mainfrom
feat/mcp-script-conversion

Conversation

@swsarancodes

Copy link
Copy Markdown
Owner

What changed

The MCP tool goforge_modernize_query takes script (a whole legacy SQL file) as well as query (one statement); exactly one of the two is required. For a script it runs the same batch path as the Modernizer's script view: the file is split into statements (;, a lone /, GO, DELIMITER), every query is converted with the same rules, and each statement gets one status (converted, unchanged, review, failed, out-of-scope) with the facts behind it. Procedures, packages, schema statements and client commands are listed as out-of-scope, never converted.

Options: statements (attention by default, all or none), maxStatements (default 100, the summary always covers the whole file), includeConvertedScript (the converted file; what did not convert stays as comments) and includeReport (the Markdown migration report). A script over 5 MB is refused. Statements are checked with a PostgreSQL grammar only, and the answer says so: nothing here proves the converted SQL returns the same rows.

How it was checked

  • Two new tests in src/mcp/mcp.test.ts: a seven-statement Oracle script (one converted, one unchanged, one needing review, one failed, three out of scope; the default list, all, maxStatements, none, the converted script and the report) and the argument checks (neither or both of query and script, a script over 5 MB). The repo's MCP tests pass (10) and the type-check is clean.

Reviewer notes

  • The README already describes this tool under "Query Modernizer: converting a whole file".

The tool takes script as well as query. The file is split into statements (;, a lone /, GO, DELIMITER), every query is converted with the same rules, and each statement gets one status (converted, unchanged, review, failed, out-of-scope) with the facts behind it; procedures, packages, schema statements and client commands are listed as out-of-scope, never converted. It can list the statements that need attention, all of them or none, cap the list, and return the converted file and the Markdown migration report. Statements are checked with a PostgreSQL grammar only, and the answer says so.
@swsarancodes
swsarancodes merged commit e1a42b4 into main Oct 25, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant