Spark SQL MCP Server

Query Spark SQL clusters via Thrift/HiveServer2. Works with Spark, EMR, Hive, Impala.

Local serverstdio

What is the Spark SQL MCP server?

Connect Spark SQL to Claude, Cursor or any other MCP client and it stops being a tab you switch to. Query Spark SQL clusters via Thrift/HiveServer2. Works with Spark, EMR, Hive, Impala. The spark sql mcp server is what makes that connection.

What the server does

An MCP server that enables AI assistants to query Spark SQL clusters via the Thrift/HiveServer2 protocol.

  • Query Spark SQL — — Execute read-only SQL queries against your Spark cluster
  • Schema Discovery — — List databases, tables, and describe table structures
  • Multiple Auth Methods — — NONE, LDAP, NOSASL, CUSTOM, and Kerberos authentication
  • EMR Compatible — — Works with AWS EMR clusters out of the box
  • Read-Only Enforcement — — Only SELECT, SHOW, DESCRIBE, EXPLAIN, and WITH statements are allowed
  • Safety Defaults — — Automatic LIMIT clause on unbounded queries, sanitized error messages

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • list_databases — List all available databases
  • list_tables — List tables in a database
  • describe_table — Get table schema (columns, types)
  • execute_query — Run read-only SQL queries with formatted results
  • LDAP — The LDAP tool exposed by this server
  • Kerberos — The Kerberos tool exposed by this server

Credentials and setup notes

Configuration is passed through the environment: SPARK_HOST, SPARK_PORT, SPARK_AUTH, SPARK_DATABASE, SPARK_USERNAME, SPARK_PASSWORD, SPARK_KERBEROS_SERVICE_NAME. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Installation

The server ships on PyPI as spark-sql-mcp-server, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

Where it fits

Plenty of database access servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Spark SQL's toolset — list_databases, list_tables, describe_table and 3 more — is a fair guide to whether it matches your workflow. It is maintained by aidancorrell; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
list_databasesList all available databases
list_tablesList tables in a database
describe_tableGet table schema (columns, types)
execute_queryRun read-only SQL queries with formatted results
LDAPThe LDAP tool exposed by this server.
KerberosThe Kerberos tool exposed by this server.

How to install the Spark SQL MCP server

{
  "mcpServers": {
    "spark-sql": {
      "command": "uvx",
      "args": ["spark-sql-mcp-server"],
      "env": {
        "SPARK_HOST": "your-value",
        "SPARK_PORT": "your-value",
        "SPARK_AUTH": "your-value",
        "SPARK_DATABASE": "your-value",
        "SPARK_USERNAME": "your-value",
        "SPARK_PASSWORD": "your-value",
        "SPARK_KERBEROS_SERVICE_NAME": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
SPARK_HOSTEndpoint or connection string the server talks to.Optional
SPARK_PORTConfiguration value read at startup.Optional
SPARK_AUTHConfiguration value read at startup.Optional
SPARK_DATABASEConfiguration value read at startup.Optional
SPARK_USERNAMEConfiguration value read at startup.Optional
SPARK_PASSWORDConfiguration value read at startup.Optional
SPARK_KERBEROS_SERVICE_NAMEConfiguration value read at startup.Optional

Example prompts to try

  • Use Spark SQL to list databases.
  • Use Spark SQL to list tables.
  • Use Spark SQL to describe table.

Frequently asked questions

It connects Spark SQL to MCP-compatible AI assistants such as Claude and Cursor, exposing 6 tools (list_databases, list_tables, describe_table, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Spark SQL directly.