Mybatis Mapper2sql
@handsomestWei
关于 Mybatis Mapper2sql
Automatically extract SQL statements from MyBatis mapper XML files. Support automatic mocking of SQL parameters, and support automatic connection to the database to execute SQL tests and output results.
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"mapper2sql": {
"command": "java",
"args": [
"-DdbType=mysql",
"-DjdbcDriver=com.mysql.cj.jdbc.Driver",
"-DjdbcDriverJar=/path/to/mysql-connector-java-8.0.33.jar",
"-DjdbcUrl=jdbc:mysql://localhost:3306/testdb",
"-DuserName=root",
"-Dpassword=your_password_here",
"-jar",
"mapper2sql-mcp-server-1.0.0.jar"
],
"env": {
"JAVA_HOME": "/path/to/jdk17",
"PATH": "/path/to/jdk17/bin;${PATH}"
}
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is Mybatis Mapper2sql?
A Model Context Protocol (MCP) service that extracts SQL statements from MyBatis mapper XML files, optionally mocks parameters using resultMap and JDBC type inference, and tests SQL against a database. It is aimed at developers who need deterministic SQL analysis and AI collaboration.
How to use Mybatis Mapper2sql?
—
Key features of Mybatis Mapper2sql
- Extracts SQL from MyBatis mapper XML files
- Automatically mocks SQL parameters based on type inference
- Tests extracted SQL by connecting to a real database
- Uses MyBatis’s official parsing engine for deterministic results
- Supports multiple database types
Use cases of Mybatis Mapper2sql
- Quickly reviewing SQL structure from mapper files without parameter details
- Generating executable SQL with mocked parameters for offline analysis
- Validating SQL correctness by running it against a live database
FAQ from Mybatis Mapper2sql
What databases does Mybatis Mapper2sql support?
It supports multiple database types through JDBC connections.
What input does Mybatis Mapper2sql require?
The server expects a file path to a mapper XML file or a directory containing such files.
What tools does Mybatis Mapper2sql provide?
Three tools: parse_mapper (basic extraction), parse_mapper_and_mock (extraction with parameter mocking), and parse_mapper_and_run_test (extraction, mocking, and execution).
How does Mybatis Mapper2sql mock parameters?
It automatically generates SQL parameters based on resultMap definitions and JDBC type inference.
数据库 分类下的更多 MCP 服务器
Sail MCP Server for Spark SQL
lakehqDrop-in Apache Spark replacement written in Rust, unifying batch processing, stream processing, and compute-intensive AI workloads.
mcp_mysql_server
xwb602625136Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
Chroma MCP Server
chroma-coreA Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
评论