原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

Spark SQL

作者:aidancorrell版本 0.1.2i★ –i在你的电脑上运行
注册名称io.github.aidancorrell/spark-sql-mcp-server

安装

概览

作者提供的说明(英文原文)

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

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 数据库与数据集
  • 你需要填写:SPARK_HOST, SPARK_PASSWORD

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 需要你自己填写: SPARK_HOST, SPARK_PORT, SPARK_DATABASE, SPARK_AUTH, SPARK_USERNAME, SPARK_PASSWORD, SPARK_KERBEROS_SERVICE_NAME

标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。

你需要

  • PyPI已安装 Python 的 uv(用于 uvx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

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

在终端中运行这条命令

claude mcp add spark-sql --env SPARK_HOST=your-value --env SPARK_PORT=your-value --env SPARK_DATABASE=your-value --env SPARK_AUTH=your-value --env SPARK_USERNAME=your-value --env SPARK_PASSWORD=your-value --env SPARK_KERBEROS_SERVICE_NAME=your-value -- uvx spark-sql-mcp-server

运行前请先填写空着的值。

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

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

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

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

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

需要你填写的值

  • SPARK_HOST 必填 env
    Hostname of the Spark Thrift Server
  • SPARK_PORT env
    Port of the Spark Thrift Server (default: 10000)
  • SPARK_DATABASE env
    Default database to use
  • SPARK_AUTH env
    Authentication method: NONE, LDAP, KERBEROS, CUSTOM, or NOSASL
  • SPARK_USERNAME env
    Username for LDAP authentication
  • SPARK_PASSWORD 机密 env
    Password for LDAP authentication
  • SPARK_KERBEROS_SERVICE_NAME env
    Kerberos service name (default: hive)

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 aidancorrell 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“数据库与数据集”中的其他服务器比较i

  • 星标数多于此分类中其他 953 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 953 个服务器的 4% 更新
  • 基础检查结果等于或优于此分类中其他 953 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

Spark SQL 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

你需要填写:SPARK_HOST, SPARK_PASSWORD

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(0.1.2)于9个月前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。

有什么可以替代它?

同一分类中有:Supabase, MongoDB MCP Server, Elasticsearch MCP Server

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Supabase

作者:supabase

MCP server for interacting with the Supabase platform

电脑或云端★ 2,993Apache-2.0今天更新
安装

MongoDB MCP Server

作者:mongodb-js

MongoDB Model Context Protocol Server

在你的电脑上运行★ 1,157Apache-2.0前天更新
安装

MCP server for interacting with Elasticsearch

在你的电脑上运行★ 315Apache-2.014个月前更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

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
export SPARK_HOST="your-emr-master-node.amazonaws.com"

export SPARK_PORT="10000" # default export SPARK_DATABASE="default" # default export SPARK_AUTH="NONE" # NONE | LDAP | KERBEROS | CUSTOM | NOSASL

2. Add to Claude Code

Global (all projects) — add to ~/.claude.json under your project's mcpServers:

{

"mcpServers": { "spark-sql": { "command": "uvx", "args": ["spark-sql-mcp-server"], "env": { "SPARK_HOST": "your-emr-master-node.amazonaws.com", "SPARK_PORT": "10000", "SPARK_AUTH": "NONE" } } } }

Project-level — add to .claude/mcp.json in your repo:

{

"mcpServers": { "spark-sql": { "command": "uvx", "args": ["spark-sql-mcp-server"], "env": { "SPARK_HOST": "your-emr-master-node.amazonaws.com", "SPARK_PORT": "10000", "SPARK_AUTH": "NONE" } } } }

3. Add to Claude Desktop

Add to your claude_desktop_config.json:

{

"mcpServers": { "spark-sql": { "command": "uvx", "args": ["spark-sql-mcp-server"], "env": { "SPARK_HOST": "your-emr-master-node.amazonaws.com", "SPARK_PORT": "10000" } } } }

4. Query

Ask Claude things like:

  • "What databases are available in our Spark cluster?"
  • "Show me the schema of the sales.transactions table"
  • "Query the top 10 customers by revenue from the analytics database"

Available Tools

ToolDescription
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

Authentication

No Auth (default)
export SPARK_AUTH="NONE"
LDAP
export SPARK_AUTH="LDAP"

export SPARK_USERNAME="your-username" export SPARK_PASSWORD="your-password"

Kerberos
export SPARK_AUTH="KERBEROS"

export SPARK_KERBEROS_SERVICE_NAME="hive" # default

Ensure you have a valid Kerberos ticket (kinit)

AWS EMR Setup

  1. Security Group — Allow inbound traffic on port 10000 from your IP
  2. SSH Tunnel (recommended):
   ssh -i your-key.pem -L 10000:localhost:10000 hadoop@your-emr-master
  1. Set SPARK_HOST=localhost

Development

git clone https://github.com/aidancorrell/spark-sql-mcp-server.git

cd spark-sql-mcp-server pip install -e ".[dev]" pytest ruff check .

Local Testing with Docker

A Docker Compose setup provides a local Spark Thrift Server with sample data for integration testing.

# Start the Spark Thrift Server

cd docker && docker compose up -d

Wait for it to be ready (takes ~30s on first start)

docker logs -f spark-thrift-server # look for "Sample data loaded."

Run integration tests

pytest -m integration -v

Tear down

cd docker && docker compose down -v

The local server comes with sample tables: default.employees, default.orders, and test_db.metrics.

Unit tests run by default with pytest (integration tests are skipped unless -m integration is specified).

Using the local server with Claude Code

With the Docker Spark server running, add it to your MCP config to test the server interactively.

Global — add to ~/.claude.json under your project's mcpServers:

{

"spark-sql": { "command": "uvx", "args": ["spark-sql-mcp-server"], "env": { "SPARK_HOST": "localhost", "SPARK_PORT": "10000", "SPARK_AUTH": "NONE" } } }

Project-level — add to .claude/mcp.json:

{

"mcpServers": { "spark-sql": { "command": "uvx", "args": ["spark-sql-mcp-server"], "env": { "SPARK_HOST": "localhost", "SPARK_PORT": "10000", "SPARK_AUTH": "NONE" } } } }

Then start a new Claude Code session and ask it to query the sample data.

Security

Read-Only Enforcement

The execute_query tool only allows read-only SQL statements. Queries must start with one of: SELECT, SHOW, DESCRIBE, DESC, EXPLAIN, or WITH. All other statement types (DROP, INSERT, DELETE, CREATE, ALTER, SET, ADD JAR, etc.) are rejected before reaching the Spark cluster.

Error Sanitization

Database errors are sanitized before being returned to the MCP client. Internal details such as server hostnames, file paths, and stack traces are not exposed. Connection failures report only the target host/port and error type.

Credential Handling
  • Passwords are never included in log output or error messages
  • The SparkConfig object masks passwords in its string representation
  • SPARK_PASSWORD is marked as a secret in the MCP registry schema
Known Limitations
  • No TLS/SSL support — Thrift connections are unencrypted. For production use with LDAP auth, use an SSH tunnel to protect credentials in transit.
  • No query timeout — Long-running queries are not automatically cancelled. Rely on Spark cluster-level timeout configuration.
  • No per-user access control — All queries execute with the privileges of the configured Spark user. Use HiveServer2 authorization (Ranger, Sentry) to restrict access at the database level.
  • Auth mode defaults to NONE — Appropriate for local development but not for production. Set SPARK_AUTH to LDAP or KERBEROS for authenticated environments.

License

MIT

问 PopNx