
Spark SQL
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 toolsPublic 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_PORTPort of the Spark Thrift Server (default: 10000)
SPARK_DATABASEDefault database to use
SPARK_AUTHAuthentication method: NONE, LDAP, KERBEROS, CUSTOM, or NOSASL
SPARK_USERNAMEUsername for LDAP authentication
SPARK_PASSWORDsecretPassword for LDAP authentication
SPARK_KERBEROS_SERVICE_NAMEKerberos 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
Details
- Repository
- github.com/aidancorrell/spark-sql-mcp-server
- Category
- Databases
- Package
spark-sql-mcp-server- Transport
- STDIO
- Auth
- Required
- Registry
- MCP registry, active