
semyonsinchenko/pyspark-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
PySpark 用の MPC サーバーは、LakeSail によって侵入します
概要
ピスパーク MCP Server は、Apache Spark 用のモデルコンテキストプロトコル (MCP) の軽量なサーバー実装です。 このMCPサーバーの主な目的は、AIシステムを使用してクエリの最適化を容易にすることです。 スパークからAIシステムまでの論理的かつ物理的なクエリプランと、追加のクエリプラン情報を提供します。 さらに、サーバーはカタログやテーブル情報を公開し、Sparkによって動力を与えられたデータ湖のデータ発見機能を可能にします。 インストール後、pyspark-mcp コマンドを使用してサーバーを起動します。 CLI はスパーク・サブミットの設定を自動的に処理します。 すべての標準のスパーク・サブミットのオプションがサポートされています。 全てのスパーク・サブミットのオプション(--conf, --jars, --packages, --executor-memoryなど)が自動的に渡されます。 - Python >=3.11, = 2.10.6 - ログル - pyspark >= 3.5 以下のツールは、PySpark MCP Server に含まれています
概要(AI 翻訳)
hi# PySpark MCP サーバー
説明
ピスパーク MCP Server は、Apache Spark 用のモデルコンテキストプロトコル (MCP) の軽量なサーバー実装です。
このMCPサーバーの主な目的は、AIシステムを使用してクエリの最適化を容易にすることです。 スパークからAIシステムまでの論理的かつ物理的なクエリプランと、追加のクエリプラン情報を提供します。 さらに、サーバーはカタログやテーブル情報を公開し、Sparkによって動力を与えられたデータ湖のデータ発見機能を可能にします。
クイックスタート
インストール
サーバーの実行
インストール後、 pyspark-mcp コマンドを使用して、サーバーを起動します。
CLI は [spark-submit] 設定を自動的に処理します。 すべての標準のスパーク・サブミットのオプションがサポートされています。
###Clip オプション
| オプション | デフォルト | 説明 |
お問い合わせ
| [[T2] | [local[*] | スパークマスターURL |
| [--host | [127.0.0.1 | MCPサーバホストアドレス |
| [--port | [8090 | MCPサーバーポート番号 |
| [--spark-submit | [spark-submit | 火花透過実行可能パス |
| [[T10] | - | 実行せずに印刷する
全てのスパーク・サブミット・オプション(--conf]), [--jars, [--packages], [--executor-memory]]), 等.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
hi# PySpark MCP Server
Description
PySpark MCP Server is a lightweight server implementation of Model Context Protocol (MCP) for Apache Spark.
The primary purpose of this MCP server is to facilitate query optimization using AI systems. It provides both logical and physical query plans from Spark to AI systems for analysis, along with additional query plan information. Furthermore, the server exposes catalog and table information, enabling data discovery capabilities in data lakes powered by Spark.
Quick Start
Installation
pip install pyspark-mcp
Running the Server
After installation, use the pyspark-mcp command to start the server:
pyspark-mcp --master "local[*]" --host 127.0.0.1 --port 8090
The CLI automatically handles spark-submit configuration. All standard spark-submit options are supported:
# With additional Spark configuration
pyspark-mcp --master "local[*]" --conf spark.driver.memory=4g
# YARN cluster mode
pyspark-mcp --master yarn --deploy-mode client --num-executors 4
# With additional JARs
pyspark-mcp --master "local[*]" --jars /path/to/connector.jar
# Preview the spark-submit command without running
pyspark-mcp --master "local[*]" --dry-run
# With GraphFrames package
pyspark-mcp --master "local[*]" --packages io.graphframes:graphframes-spark3_2.12:0.10.1
CLI Options
| Option | Default | Description |
|---|---|---|
--master |
local[*] |
Spark master URL |
--host |
127.0.0.1 |
MCP server host address |
--port |
8090 |
MCP server port number |
--spark-submit |
spark-submit |
Path to spark-submit executable |
--dry-run |
- | Print command without executing |
All spark-submit options (--conf, --jars, --packages, --executor-memory, etc.) are passed through automatically.
Adding the running MCP to the Claude-code
# Must run one server on a different port per Claude instance
claude mcp add --transport http pyspark-mcp http://127.0.0.1:8090/mcp
Dependencies
- Python >=3.11,<4.0
- fastmcp >= 2.10.6
- loguru
- pyspark >= 3.5
Bundled MCP tools
The following tools are included in the PySpark MCP Server:
| MCP Tool | Description |
|---|---|
| Get the version of PySpark | Get the version number from the current PySpark Session |
| Get Analyzed Plan of the query | Extracts an analyzed logical plan from the provided SQL query |
| Get Optimized Plan of the query | Extracts an optimized logical plan from the provided SQL query |
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →