Ai-SparkBLOCK
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
This project implements a Model Context Protocol (MCP) server and client for optimizing Apache Spark code. The system provides intelligent code optimization suggestions and performance analysis through a client-server architecture.
How It Works
Code Optimization Workflow
graph TB subgraph Input A[Input PySpark Code] --> |spark_code_input.py| B[run_client.py] end subgraph MCP Client B --> |Async HTTP| C[SparkMCPClient] C --> |Protocol Handler| D[Tools Interface] end subgraph MCP Server E[run_server.py] --> F[SparkMCPServer] F --> |Tool Registry| G[optimize_spark_code] F --> |Tool Registry| H[analyze_performance] F --> |Protocol Handler| I[Claude AI Integration] end subgraph Resources I --> |Code Analysis| J[Claude AI Model] J --> |Optimization| K[Optimized Code Generation] K --> |Validation| L[PySpark Runtime] end subgraph Output M[optimized_spark_code.py] N[performance_analysis.md] end D --> |MCP Request| F G --> |Generate| M H --> |Generate| N classDef client fill:#e1f5fe,stroke:#01579b classDef server fill:#f3e5f5,stroke:#4a148c classDef resource fill:#e8f5e9,stroke:#1b5e20 classDef output fill:#fff3e0,stroke:#e65100 class A,B,C,D client class E,F,G,H,I server class J,K,L resource class M,N,O output
Component Details
- Input Layer
spark_code_input.py: Source PySpark code for optimizationrun_client.py: Client startup and configuration
- MCP Client Layer
- Tools Interface: Protocol-compliant tool invocation
- MCP Server Layer
run_server.py: Server initialization- Tool Registry: Optimization and analysis tools
- Protocol Handler: MCP request/response management
- Resource Layer
- Claude AI: Code analysis and optimization
- PySpark Runtime: Code e
53089993c5e4OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add spark-mcp-server --env ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} -- uvx spark-mcp-server{
"mcpServers": {
"spark-mcp-server": {
"command": "uvx",
"args": [
"spark-mcp-server"
],
"env": {
"ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}"
}
}
}
}Exposed tools (2)
2 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
analyze_performance | read | Analyze performance of Spark code execution |
optimize_spark_code | read | Optimize Spark code using Claude AI |
Trust audit
BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (1 observation(s))
- Network
- none-observed
- Shell
- declared (3 observation(s))
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (4)
exec(open(code_path).read())
exec(code_file.read())
mcp, pyspark, anthropic, pydantic
Gates applied: no_behavioural_pass, no_license.
53089993c5e4full audit observations/trust-audit/mcp-server/vgiri2015__ai-spark.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 53089993c5e4 | BLOCK | D | 69 | first audit |
Questions
What tools does Ai-Spark expose?
2 in total: 2 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Ai-Spark safe to connect to an agent?
No — not without reading the findings first. The audit graded it D (69/100) and found 2 critical or high issues in the source. Each one is listed on this page with the file and line it is on.
What credentials does Ai-Spark need?
It reads ANTHROPIC_API_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How current is this page?
The grade is for one exact copy of the source (53089993c5e4), read on 2026-10-08. The repository is watched and re-audited when it changes.