aidancorrell avatar

Spark SQL

aidancorrell/spark-sql-mcp-server

Connects Claude to any HiveServer2-compatible system (Spark, EMR, Hive, Impala) over the Thrift protocol. Exposes four tools: list_databases, list_tables, describe_table, and execute_query for read-only SQL operations. Enforces safety by blocking non-SELECT statements and automatically limiting unbounded queries. Supports multiple auth methods including LDAP, Kerberos, and NOSASL. Built for AWS EMR workflows with SSH tunnel support, though it works with any Spark cluster exposing port 10000. Useful when you need Claude to explore schemas and run analytics queries against production data lakes without write access. Credentials stay local via environment variables. Ships with Docker Compose setup and sample data for local testing.

tools
4
auth
Secret needed
transport
STDIO
env vars
7
last updated
Feb 8, 2026

Tools

4 tools

Public tool metadata for what this MCP can expose to an agent.

list_databasesList all available databases

List all available databases

No parameter schema in public metadata yet.

list_tablesList tables in a database

List tables in a database

No parameter schema in public metadata yet.

describe_tableGet table schema (columns, types)

Get table schema (columns, types)

No parameter schema in public metadata yet.

execute_queryRun read-only SQL queries with formatted results

Run read-only SQL queries with formatted results

No parameter schema in public metadata yet.

Sponsors

Configuration

SPARK_HOST*

Hostname of the Spark Thrift Server

SPARK_PORT

Port of the Spark Thrift Server (default: 10000)

SPARK_DATABASE

Default database to use

SPARK_AUTH

Authentication method: NONE, LDAP, KERBEROS, CUSTOM, or NOSASL

SPARK_USERNAME

Username for LDAP authentication

SPARK_PASSWORDsecret

Password for LDAP authentication

SPARK_KERBEROS_SERVICE_NAME

Kerberos service name (default: hive)

Readme

Spark SQL MCP Server

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

Works with any HiveServer2-compatible system: Apache Spark, AWS EMR, Hive, Impala, Presto.

Features

  • 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

Installation

pip install spark-sql-mcp-server

Or run directly with uvx:

uvx spark-sql-mcp-server

Quick Start

1. Set Environment Variables


View the full README on GitHub

Details

Repository
github.com/aidancorrell/spark-sql-mcp-server
Category
Databases
Package
spark-sql-mcp-server
Transport
STDIO
Auth
Required
Registry
MCP registry, active

Related Databases MCP servers

View all
1infoinlet-marketplace avatarMcp Clickhouseinfoinlet-marketplace/marketplaceRead-only ClickHouse for AI agents — analytics queries, table inspection, sizes, health.0stars
2originchaindb avatarOriginChainDBoriginchaindb/mcp-serverConnect an MCP host to an OriginChainDB tenant through four tools: SQL, vector search, full-text search, and schema discovery.0stars
3bytebase avatarDBHubbytebase/dbhubToken-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite3.8Kstars
4runekaagaard avatarMCP Alchemy Serverrunekaagaard/mcp-alchemyA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, an403stars
5faucetdb avatarFaucetfaucetdb/faucetSQL database to MCP tools and REST API: PostgreSQL, MySQL, SQL Server, Oracle, SQLite, Snowflake.170stars
6hypequery avatarhypequery ClickHousehypequery/hypequeryGoverned ClickHouse analytics for agents: named datasets and metrics as tools, never raw SQL.104stars