
Installing Mybatis Mapper2sql
This server ships without a published npm/PyPI package — clone the repo and follow its README to build and run it, then add the resulting command to your client.
Open repositoryAbout
mybatis-mapper2sql mcp server
README
这是一个基于Model Context Protocol (MCP)的MyBatis Mapper XML SQL提取服务。
概述
本项目将原有的 MyBatis Mapper2SQL 工具,转型为 MCP (Model Context Protocol) 服务,使其能够在 AI 时代继续发挥价值,并与 AI 模型协作提供更强大的 SQL 提取和分析能力。
基于spring-ai, 提供stdio(stdin/stdout)模式,通过标准输入输出,进行进程间通信,适用于命令行工具集成。
功能特性
- SQL提取: 从MyBatis mapper XML文件中提取SQL语句
- 参数Mock: 自动生成SQL参数,支持基于resultMap和JDBC连接的类型推断
- SQL测试: 连接数据库执行SQL并记录执行结果
核心优势
- 确定性解析: 基于 MyBatis 官方解析引擎,结果稳定可靠。
- AI 协作: 作为 AI 的"专家工具",提供精确的 SQL 解析能力。
- 服务化: 通过 MCP 协议提供标准化接口。
- 扩展性: 支持多种数据库类型。
可用工具
本项目提供3个专业工具,满足不同场景的SQL提取需求:
1. parse_mapper
- 功能: 基础 SQL 提取,保留占位符(不进行参数模拟)
- 适用场景: 快速查看 SQL 结构,无需参数 mock
- 参数:
filePath(string): mapper XML文件或目录路径
2. parse_mapper_and_mock
- 功能: SQL 提取 + 参数自动 mock
- 适用场景: 需要可执行 SQL 进行测试或分析
- 参数:
filePath(string): mapper XML文件或目录路径
3. parse_mapper_and_run_test
- 功能: SQL 提取 + 参数 mock + 执行测试
- 适用场景: 验证 SQL 在真实数据库中的执行情况
- 参数:
filePath(string): mapper XML文件或目录路径
使用说明
编译运行
MCP客户端配置
使用示例
基本SQL提取
{
"name": "parse_mapper",
"arguments": {
"filePath": "/path/to/mapper.xml"
}
}
带参数Mock的SQL提取
{
"name": "parse_mapper_and_mock",
"arguments": {
"filePath": "/path/to/mapper.xml"
}
}
SQL测试
{
"name": "parse_mapper_and_run_test",
"arguments": {
"filePath": "/path/to/mapper.xml"
}
}
参考
FAQ
Is Mybatis Mapper2sql MCP free?
Yes, Mybatis Mapper2sql MCP is free — one-click install via Unyly at no cost.
Does Mybatis Mapper2sql need an API key?
No, Mybatis Mapper2sql runs without API keys or environment variables.
Is Mybatis Mapper2sql hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Mybatis Mapper2sql in Claude Desktop, Claude Code or Cursor?
Open Mybatis Mapper2sql on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Postgres
AnthropicQuery your database in natural language
wenb1n-dev/SmartDB_MCP
wenb1n-devConnect to multiple databases at once (MySQL, PostgreSQL, SQL Server, MariaDB, Dameng, Oracle) for operations, health analysis and SQL optimization.
Postgres Server
madhurprashThis server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
PostgreSQL
modelcontextprotocolRead-only database access with schema inspection.
Redis
modelcontextprotocolInteract with Redis key-value stores.
SQLite
modelcontextprotocolDatabase interaction and business intelligence capabilities.
mxcp
raw-labsOpen-source framework for building enterprise-grade MCP servers using just YAML, SQL, and Python, with built-in auth, monitoring, ETL and policy enforcement.
julien040/anyquery
julien040Query apps with SQL from a single local-first binary; also connects to PostgreSQL, MySQL and SQLite-compatible databases.
drakonkat/wizzy-mcp-tmdb
drakonkatSearch and retrieve movie, TV show and person information from The Movie Database (TMDB) API.
longevity-genie/opengenes-mcp
longevity-genieQuery the OpenGenes database for aging and longevity research.
Compare Mybatis Mapper2sql with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All data MCPs
