Skip to main content
Glama

sql2odata-mcp

MCP server that translates SQL statements into OData v4 query syntax.

Use this as a tool in Claude Desktop, Cursor, Windsurf, or any MCP-compatible LLM client.

Install

npm install -g sql2odata-mcp

Related MCP server: Universal Database MCP Server

Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "sql2odata": {
      "command": "npx",
      "args": ["-y", "sql2odata-mcp"]
    }
  }
}

Claude Code

claude mcp add sql2odata -- npx -y sql2odata-mcp

Cursor

Add to Cursor MCP settings:

{
  "mcpServers": {
    "sql2odata": {
      "command": "npx",
      "args": ["-y", "sql2odata-mcp"]
    }
  }
}

Available Tools

translate-sql

Translate a single SQL statement to OData v4.

Parameters:

  • sql (string, required) — SQL statement (SELECT, INSERT, UPDATE, DELETE)

  • encode (boolean, optional) — URL-encode the output

Example:

translate-sql({ sql: "SELECT Name, Age FROM Users WHERE Country = 'Germany' ORDER BY Name LIMIT 10" })

Returns:

GET /Users?$select=Name,Age&$filter=Country eq 'Germany'&$orderby=Name asc&$top=10

Parameters:
  $select = Name,Age
  $filter = Country eq 'Germany'
  $orderby = Name asc
  $top = 10

translate-batch

Translate multiple SQL statements at once.

Parameters:

  • queries (string[], required) — Array of SQL statements

  • encode (boolean, optional) — URL-encode the output

sql-syntax-help

Show all supported SQL syntax and their OData v4 equivalents.

Parameters: none

Available Prompts

sql-to-odata

Pre-built prompt template that translates SQL and explains the result.

Parameters:

  • sql (string) — SQL statement to translate

Supported SQL

SQL

OData v4

SELECT col1, col2

$select=col1,col2

SELECT COUNT(*)

$count=true

FROM Table

/Table

WHERE col = 'val'

$filter=col eq 'val'

WHERE LIKE '%text%'

contains(col,'text')

WHERE IN ('a','b')

(col eq 'a' or col eq 'b')

WHERE BETWEEN 1 AND 10

col ge 1 and col le 10

IS NULL / IS NOT NULL

eq null / ne null

ORDER BY col ASC

$orderby=col asc

LIMIT n / OFFSET n

$top=n / $skip=n

JOIN Table ON ...

$expand=Table

GROUP BY + aggregates

$apply=groupby(...)

INSERT INTO ... VALUES

POST + JSON body

UPDATE ... SET ... WHERE

PATCH + JSON body

DELETE FROM ... WHERE

DELETE

License

MIT

Author

Ulrich Waldmannmoonraker@magenta.de

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A FastMCP-based server that enables executing Microsoft SQL Server data queries and table structure queries through a standardized MCP protocol interface.
    7
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A versatile MCP server that connects to multiple relational databases (MySQL, PostgreSQL, Oracle, SQL Server, SQLite) and enables secure read-only SQL query execution and metadata access.
    4
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A comprehensive MCP server for SQL Server database operations, enabling CRUD operations, schema exploration, and stored procedure execution through natural language.
    6 npm
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP server for SAP S/4HANA via the ADT API, enabling querying and reading SAP systems with production write protection.
    3 npm
    MIT