Command Palette

Search for a command to run...

Browse all
MCP server № 27442

Mybatis Mapper2sql

mybatis-mapper2sql mcp server

Free
GitHubEmbed

Installing Mybatis Mapper2sql

Build from source

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 repository
github.com/handsomestWei/mybatis-mapper2sql-mcp-server

About

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并记录执行结果

核心优势

  1. 确定性解析: 基于 MyBatis 官方解析引擎,结果稳定可靠。
  2. AI 协作: 作为 AI 的"专家工具",提供精确的 SQL 解析能力。
  3. 服务化: 通过 MCP 协议提供标准化接口。
  4. 扩展性: 支持多种数据库类型。

可用工具

本项目提供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客户端配置

参考

使用示例

参考本地使用Trae 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"
  }
}

参考

from github.com/handsomestWei/mybatis-mapper2sql-mcp-server

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

№ 56430

Postgres

AnthropicAnthropic

Query your database in natural language

postgressqldatabase
Install now
№ 72083

wenb1n-dev/SmartDB_MCP

wenb1n-devwenb1n-dev

Connect to multiple databases at once (MySQL, PostgreSQL, SQL Server, MariaDB, Dameng, Oracle) for operations, health analysis and SQL optimization.

wenb1ndevsmartdb
Install now
№ 08825

Postgres Server

madhurprashmadhurprash

This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools

Install now
№ 29587

PostgreSQL

modelcontextprotocolmodelcontextprotocol

Read-only database access with schema inspection.

postgresqlarchived
VerifiedInstall now
№ 12820

Redis

modelcontextprotocolmodelcontextprotocol

Interact with Redis key-value stores.

redisarchived
VerifiedInstall now
№ 75813

SQLite

modelcontextprotocolmodelcontextprotocol

Database interaction and business intelligence capabilities.

sqlitearchived
VerifiedInstall now
№ 51499

mxcp

raw-labsraw-labs

Open-source framework for building enterprise-grade MCP servers using just YAML, SQL, and Python, with built-in auth, monitoring, ETL and policy enforcement.

mxcpforservers
VerifiedInstall now
№ 93433

julien040/anyquery

julien040julien040

Query apps with SQL from a single local-first binary; also connects to PostgreSQL, MySQL and SQLite-compatible databases.

julien040anyqueryname
Install now
№ 67869

drakonkat/wizzy-mcp-tmdb

drakonkatdrakonkat

Search and retrieve movie, TV show and person information from The Movie Database (TMDB) API.

drakonkatwizzymcp
Install now
№ 89447

longevity-genie/opengenes-mcp

longevity-genielongevity-genie

Query the OpenGenes database for aging and longevity research.

longevitygenieopengenes
Install now

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