MCP server for MyBatis mapper XML file parsing and SQL statement extraction with parameter mocking and test execution capabilities
This MCP server exposes three tools for parsing MyBatis mapper XML files. All three tools suffer from severe definition quality issues: minimal descriptions that fail to explain when/why to use each tool, no visible input parameter descriptions beyond type declarations, no documented output schemas, and tool names that violate single-responsibility principles. The parse_mapper_and_run_test tool combines parsing, mocking, and test execution into one operation, which violates the composition pattern. Descriptions average 79 characters, well below the 194-char baseline for production tools. No error recovery guidance, no parameter constraints (e.g., valid file extensions, directory depth limits), and no explanation of the differences between the three similar tools. The naming convention 'parse_mapper*' creates ambiguity, why three variants instead of one tool with a 'mode' parameter? Code inspection of Mapper2SqlMcpService.java shows tool registration but no visible parameter annotations or output schema definitions in the provided source excerpt.
Parse MyBatis mapper XML files and extract SQL statements with placeholders (no parameter mocking)
Parse MyBatis mapper XML files and extract SQL statements and mock parameters
Parse MyBatis mapper XML files, extract SQL statements with parameter mocking, and test execution
No visible input parameter descriptions. Tools accept 'filePath' but lack any explanation of expected format, path constraints, or directory traversal limits. This invites invalid inputs and path injection attacks.
No documented output schemas. LLMs cannot plan downstream operations or extract relevant fields. The server must document what fields are returned (e.g., do results include execution times, SQL strings, parameter types, test outcomes?).
Three tools with overlapping functionality and names starting with 'parse_mapper'. Tool naming violates the single-responsibility principle. Consider: parse_mapper(mode='extract'|'mock'|'test'), or separate tools with distinct verbs (extract_sql, mock_parameters, test_execution).
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 32 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 19 | - | v1 |
Minimal tool descriptions (30 - 35 chars each). Descriptions do not explain when/why to choose each tool, what prerequisites exist, or what the output means. Baseline for production tools is 194 chars; these fall 79% short.
No input validation or constraint documentation. Parameter 'filePath' accepts any string; no mention of valid file extensions (.xml), directory depth limits, or handling of invalid paths. Baseline requires describing format, range, and allowed values.
parse_mapper_and_run_test combines three responsibilities (parsing, mocking, testing). This violates composition rules. Agent cannot parse without running tests, and cannot mock without testing. Split into separate tools: parse_mapper, mock_parameters, test_execution.
No error handling or recovery guidance. If parsing fails (invalid XML, missing file, unrecognized MyBatis syntax), what does the error response contain? How should an LLM retry or what should it ask the user?
Tool definitions appear inferred rather than directly visible in source code. Only tool names, descriptions, and one-level-deep input parameters are provided. Full parameter annotations, output schema definitions, and error structure are not shown.