Skip to main content
Glama
SQL-Transpiler MCP Tool

SQL-Transpiler MCP Tool

by Baronco

🚀 SQL-Transpiler MCP Tool

SQL-Transpiler is a MCP tool designed to transpile SQL queries between different dialects using the sqlglot library. This tool helps you convert SQL code from one dialect (e.g., MySQL) to another (e.g., PostgreSQL) with ease, ensuring compatibility across various database systems.


🛠️ Features

  • Dialect Support: Lists all SQL dialects supported by sqlglot.

  • SQL Transpilation: Converts SQL queries from one dialect to another.

  • Error Handling: Informs you if a dialect is unsupported or if there are syntax errors.


Related MCP server: TextQL MCP Server

📦 Library Used

  • sqlglot
    Version: Check your pyproject.toml or uv.lock for the exact version used in this project.


⚙️ Prerequisites

  • Python 3.13+ (if running locally)

  • UV package manager (for dependency management)

  • Docker (if running via container)


🚀 Installation

Option 1: Using UV (Locally)

  1. Clone the repository

    git clone https://github.com/Baronco/SQL-Transpiler-MCP-Tool.git
    cd sql-transpiler
  2. Install UV

    pip install uv
  3. Sync dependencies (using uv.lock)

    uv sync --frozen
  4. Run the server

    uv run server.py

Option 2: Using Docker

  1. Clone the repository

    git clone https://github.com/your-username/sql-transpiler.git
    cd sql-transpiler
  2. Build the Docker image

    docker build -t sql-transpiler .

📄 Usage

  • Use the Dialects tool to list all supported SQL dialects.

  • Use the Transpiler tool to convert SQL queries from one dialect to another.

For more details, see the instructions in src/instructions.md.

🖥️ Integration with Claude Desktop

To add the SQL-Transpiler MCP tool to your Claude Desktop configuration using the Docker image, update your claude_desktop_config.json as follows:

{
  "mcpServers": {
    "sql-transpiler": 
    {
      "command": "docker",
      "args": ["run", "-i", "--rm", "--init", "-e", "DOCKER_CONTAINER=true", "sql-transpiler"]
    }
  }
}

If you want to use your local environment with UV instead of Docker, configure your claude_desktop_config.json like this (adjust the path as needed):

{
  "mcpServers": {
    "sql-transpiler": 
    {
      "command": "uv",
      "args": [
        "--directory",
        "path/to/sql-transpiler",
        "run",
        "server.py"
      ]
    }
  }
}

📝 License

MIT License

Available Tools

2 tools
DialectsB

List all available SQL dialects supported by sqlglot.

Inputs: no named parameters.

TranspilerA

Transpile SQL queries from one dialect to another using sqlglot. First, run the Dialects tool to check if both the source and target dialects are supported.

Inputs: sql_query (required), from_dialect (required), to_dialect (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have perfectly distinct purposes: Dialects lists available SQL dialects, while Transpiler converts queries between dialects. There is no overlap in functionality, and the descriptions clearly differentiate their roles, making misselection impossible.

    Naming Consistency5/5

    Both tools use clear, descriptive noun-based names (Dialects and Transpiler) that align with their functions. While not following a strict verb_noun pattern, they are consistently styled and immediately understandable within the server's domain.

    Tool Count3/5

    With only two tools, the server feels thin for its stated purpose of SQL transpilation. While the tools cover core functionality (listing dialects and transpiling), additional tools for validation, parsing, or error handling could enhance completeness. The count is borderline but workable.

    Completeness3/5

    The tools cover the essential workflow of checking dialects and transpiling queries, but there are notable gaps. Missing operations include validating SQL syntax, optimizing queries, or handling errors during transpilation. The surface is functional but minimal, potentially requiring workarounds for advanced use cases.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables Language Models to interact with Microsoft SQL Server databases by inspecting table schemas, executing SQL queries, and reading table data through a standardized Model Context Protocol interface.
      27
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Translates natural language to SQL/GraphQL queries and executes them, enabling AI agents to interact with databases through the Model Context Protocol.
      1
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to query, analyze, and manage SQL Server databases through natural language via the Model Context Protocol.
      6
      1
      MIT
    • -
      license
      Not graded
      quality
      A
      maintenance
      Enables connecting to and querying SQL Server databases via the Model Context Protocol, with support for managing multiple named connections and automatic configuration of AI clients.
      -