PySpark MCP
개요
제작자가 쓴 설명(영어 원문)
SQL migration, AWS Glue job generation, and PySpark optimization as an MCP server.
PopNx MCP의 세 기둥
이 세 가지는 절대 하나의 점수로 합치지 않아요. 의견, 측정, 인기는 서로 다른 것이니까요.
- 사용자 의견i아직 리뷰가 없어요리뷰는 다음 단계에서 계정 기능과 함께 열려요
- 우리의 기본 점검i1개 중 1개 통과공개된 정보로 점검했으며, 코드는 아직 스캔하지 않았어요
- 사용 정도i아주 새로움↓ 17/주 · ★ –
할 수 있는 일
이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.
- 연결 방식: 내 컴퓨터에서 실행
- 전송 방식: stdio
- 카테고리: 데이터베이스 및 데이터셋
설치
쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.
설치하기 전에
- 기본 점검: 1개 중 1개 통과
- 내 컴퓨터에서 내 사용자 계정의 권한(파일, 네트워크, 앱)으로 실행돼요.
- 레지스트리에 입력해야 할 키가 나와 있지 않아요.
필요한 것
- PyPIPython의 uv 설치(uvx 명령어용)
어떤 앱을 쓰세요?
위에서 앱을 고르세요. 기억해 두었다가 다음부터는 버튼에 “…에 설치”라고 표시해요.
Claude Desktop → Settings → Developer → Edit Config를 열고 claude_desktop_config.json에 이 내용을 붙여 넣으세요
{
"mcpServers": {
"pyspark": {
"command": "uvx",
"args": [
"pyspark-tools"
]
}
}
}터미널에서 이 명령어를 실행하세요
claude mcp add pyspark -- uvx pyspark-tools또는 설정을 직접 복사하기
프로젝트의 .cursor/mcp.json 또는 ~/.cursor/mcp.json에 붙여 넣으세요
{
"mcpServers": {
"pyspark": {
"command": "uvx",
"args": [
"pyspark-tools"
]
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
또는 설정을 직접 복사하기
프로젝트의 .vscode/mcp.json에 붙여 넣으세요
{
"servers": {
"pyspark": {
"type": "stdio",
"command": "uvx",
"args": [
"pyspark-tools"
]
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
이 서버는 내 컴퓨터에서 실행되는데, ChatGPT는 인터넷에 있는 서버에만 연결할 수 있어요. 다른 앱을 고르세요.
선택한 앱은 이 기기의 쿠키에만 저장돼요. 계정은 필요 없어요.
이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.
할 수 있는 일
내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.
기본 점검i
누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 9일 점검
- ✓ 통과
제작자와 저장소 일치
레지스트리 이름이 GitHub 계정 AnnasMazhar 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요
- … 아직 점검 안 함
계속 관리되고 있음
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
- … 아직 점검 안 함
라이선스 있음
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
- – 해당 없음
엔드포인트 응답
내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요
- – 해당 없음
OAuth로 로그인
내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요
- … 아직 점검 안 함
도구 설명에 숨겨진 지시 없음
내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요
데이터베이스 및 데이터셋 카테고리의 다른 서버와 비교i
- 이 카테고리의 다른 서버 1151개 중 0%보다 스타가 많아요
- 이 카테고리의 다른 서버 1151개 중 67%보다 최근에 레지스트리에 공개됐어요
- 기본 점검 결과가 이 카테고리의 다른 서버 1151개 중 100%와 같거나 더 좋아요
레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.
자주 묻는 질문
PySpark MCP, 안전한가요?
해당하는 기본 점검 1개 중 1개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.
어떤 키나 코드가 필요한가요?
레지스트리에 필수 키가 나와 있지 않아요. 다만 처음 쓸 때 로그인을 요구하는 서버도 있어요.
내 컴퓨터에서 실행되나요, 클라우드에서 실행되나요?
내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).
아직 관리되고 있나요?
GitHub 저장소는 마지막으로 – 변경됐고, 최신 버전(0.1.0)은 21일 전 레지스트리에 올라왔어요.
어떤 앱에서 쓸 수 있나요?
Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Python (uv)도 있어야 해요.
대신 쓸 수 있는 건 뭐가 있나요?
같은 카테고리에는: Supabase, MongoDB MCP Server, Elasticsearch MCP Server
대안
같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.
카드 보는 법:↓ 주간 다운로드i★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i
제작자의 README
README 열기
제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.
PySpark MCP Server
SQL migration assistance, AWS Glue job *template* generation, and Spark code optimization — as an MCP server.
Not the live-Spark `pyspark-mcp` package. This project is SQL → PySpark /
Glue *source generation*, published as
pyspark-tools.
SemyonSinchenko/pyspark-mcp introspects a
running SparkSession. A deprecated
pyspark-mcpconsole script remains here so
old configs keep working; it prints a warning, then starts this server.
What It Does
- SQL Dialect Transpilation — Convert between PostgreSQL, Oracle, Redshift, MySQL, Snowflake, and Spark SQL using SQLGlot
- PySpark DataFrame API Generation — Generate DataFrame API *source text* from SQL, with optimization hints
- AWS Glue templates — Job script strings, DynamicFrame conversions, Data Catalog definitions, S3 layout advice
- Batch Processing — Walk SQL files/directories and emit converted modules
- Code Review & Optimization — Pattern-based review of existing PySpark source
- Pattern Detection — Find duplicated snippets and suggest utilities
What It Doesn't Do
- Recursive CTEs → provides Spark SQL equivalent + guidance (PySpark has no native recursive CTE support)
- MERGE/PIVOT/CONNECT BY → transpiles to Spark SQL, provides DataFrame API guidance
- Perfect 1:1 DataFrame API transpilation for all SQL — complex queries get Spark SQL + recommendations
- It does not start a SparkSession, submit Glue jobs, or execute SQL
optimize(mode="code")returns suggestions; it does not rewrite your codeglue_s3is a path heuristic (no AWS call, no measured speedups)- It does not replace SemyonSinchenko/pyspark-mcp for live catalog/plans
Why this vs calling sqlglot yourself
SQLGlot already transpiles dialects. This MCP adds three things around that kernel: DataFrame-API pretty-printing with join/window/cast mappings that the conversion tests lock, Glue job *boilerplate strings* (bookmarks, DynamicFrames, catalog tables) so an agent can emit a file instead of assembling one, and a 14-tool FastMCP surface so an LLM picks convert / mode=sql instead of wiring sqlglot itself. If you only need sqlglot.transpile(...), use sqlglot.
Quick Start
pip install pyspark-tools
pyspark-tools
Zero-clone alternative: uvx pyspark-tools. run_server.py is a development convenience that inserts sys.path and prints startup banners. Prefer pyspark-tools in configs and production.
Try it
pip install pyspark-tools
python -c "from pathlib import Path; from pyspark_tools.sql_converter import SQLToPySparkConverter as C; from pyspark_tools.consolidated_tools import glue_job; c,s,o=C(),Path('examples'),Path('examples/out'); [(o/f'{n}.py').write_text(c.convert_sql_to_pyspark((s/f'{n}.sql').read_text(), dialect=d).pyspark_code) for n,d in [('postgres_orders','postgres'),('oracle_decode','oracle')]]; (o/'orders_etl_glue.py').write_text(glue_job(mode='template', job_name='orders_etl', sql_query=(s/'postgres_orders.sql').read_text())['template'])"
Writes the same files as examples/out/. MCP stdio CLI: pyspark-tools.
Example: SQL → PySpark
SELECT o.customer_id, c.name, SUM(o.amount) AS total
FROM orders o JOIN customers c ON o.customer_id = c.id WHERE o.status = 'paid' GROUP BY o.customer_id, c.name
Call convert with mode=sql. Captured converter output (dialect=spark):
from pyspark.sql import SparkSession
from pyspark.sql.functions import ( col, lit, when, count, sum as spark_sum, avg, min, max, countDistinct, coalesce, concat, datediff, date_add, to_date, row_number, rank, lag, lead, ) from pyspark.sql.window import Window
Generated from SPARK SQL
spark = SparkSession.builder.appName('SQLToPySpark').getOrCreate()
Load table: customers
customers_df = spark.table('customers')
Load table: orders
orders_df = spark.table('orders')
Main query
result_df = (orders_df.alias('o') .join(customers_df.alias('c'), (col('o.customer_id') == col('c.id')), 'inner') .filter((col('o.status') == lit('paid'))) .groupBy(col('o.customer_id'), col('c.name')) .select(col('o.customer_id'), col('c.name'), (spark_sum(col('o.amount'))).alias('total')))
Exact output depends on dialect detection and fallbacks; conversion tests in tests/test_sql_conversion_fixes.py pin the important constructs. Notebook-style import * / show() is opt-in via style="notebook" on the converter.
MCP Configuration
Claude Desktop
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": { "pyspark": { "command": "pyspark-tools", "args": [] } } }
Hermes Agent
Add to ~/.hermes/config.yaml:
mcp:
servers: pyspark: command: pyspark-tools enabled_tools: all
Docker
The image is stdio only (FastMCP over stdin/stdout). There is no HTTP server on port 8000. docker compose up is for local tests, not a health-checkable web service.
docker compose --profile test run --rm pyspark-tools-test
Tools
Three primary tools. The other eleven routers stay registered this minor version but are deprecated — prefer convert, glue_job, and review.
convert — SQL → PySpark (including mode=batch_dir)
convert(mode="sql", sql_query="SELECT id FROM users", dialect="postgres")
convert(mode="batch_dir", directory_path="etl/", output_dir="out")
glue_job — Glue 5.0 job *template* strings
glue_job(mode="template", job_name="orders_etl", sql_query="SELECT * FROM orders")
review — code review, patterns, duplicates
review(mode="code", code="df = spark.table('t')\ndf.collect()")
Legacy / deprecated: analyze, optimize, glue_schema, glue_s3, glue_data, refactor, search, context, batch_status, s3_source, analytics. Still callable; do not advertise to new agents.
Security
This MCP can read local files (SQL, TXT, PDF) and, if the [aws] extra is installed, list/read S3 with the host's default AWS credentials. File tools only allow paths under the process working directory (or an explicit base_path / FileHandler(base_directory=...)). That is not a sandbox.
Run the server under a restricted OS account. Do not point it at secrets directories. Do not attach AWS credentials with write access unless you intend S3 reads via s3_source / glue_s3. Optional extras:
pip install "pyspark-tools[aws]" # boto3 for S3/Glue catalog helpers
pip install "pyspark-tools[spark]" # pyspark — not required at runtime; generated code only
Development
python -m venv .venv
source .venv/bin/activate pip install -e ".[dev]"
Test
pytest tests/ -v --cov=pyspark_tools
Format
black pyspark_tools tests isort pyspark_tools tests
Lint
flake8 pyspark_tools tests
Requires Python 3.11+ (matches the CI matrix).
Architecture
pyspark_tools/
├── server.py # FastMCP server + helper implementations ├── consolidated_tools.py # 14 @app.tool() routers ├── sql_converter.py # SQLGlot-based transpilation + DataFrame API generation ├── aws_glue_integration.py # Glue job templates, DynamicFrame, Data Catalog ├── advanced_optimizer.py # Performance analysis + optimization suggestions ├── batch_processor.py # Concurrent file processing ├── code_reviewer.py # PySpark code review patterns ├── duplicate_detector.py # Code deduplication ├── data_source_analyzer.py # Data source analysis (optional boto3) └── file_utils.py # File I/O with allow-root checks
License
MIT — see LICENSE.
mcp-name: io.github.AnnasMazhar/pyspark-mcp