Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,13 @@ python3 -m spark_history_mcp.core.main
# Deactivate venv
deactivate
```


### πŸ“Š Sample Data
The repository includes real Spark event logs for testing:
- `spark-bcec39f6201b42b9925124595baad260` - βœ… Successful ETL job
- `spark-110be3a8424d4a2789cb88134418217b` - πŸ”„ Data processing job
- `spark-cc4d115f011443d787f03a71a476a745` - πŸ“ˆ Multi-stage analytics job

See **[TESTING.md](TESTING.md)** for using them.

### βš™οΈ Server Configuration
Edit `config.yaml` for your Spark History Server:

**Config File Options:**
- Command line: `--config /path/to/config.yaml` or `-c /path/to/config.yaml`
- Environment variable: `SHS_MCP_CONFIG=/path/to/config.yaml`
- Default: `./config.yaml`
```yaml
servers:
local:
Expand All @@ -121,6 +116,15 @@ mcp:
debug: true
```


### πŸ“Š Sample Data
The repository includes real Spark event logs for testing:
- `spark-bcec39f6201b42b9925124595baad260` - βœ… Successful ETL job
- `spark-110be3a8424d4a2789cb88134418217b` - πŸ”„ Data processing job
- `spark-cc4d115f011443d787f03a71a476a745` - πŸ“ˆ Multi-stage analytics job

See **[TESTING.md](TESTING.md)** for using them.

## πŸ“Έ Screenshots

### πŸ” Get Spark Application
Expand Down
14 changes: 13 additions & 1 deletion src/spark_history_mcp/core/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Main entry point for Spark History Server MCP."""

import argparse
import json
import logging
import os
import sys

from spark_history_mcp.config.config import Config
Expand All @@ -16,9 +18,19 @@

def main():
"""Main entry point."""
parser = argparse.ArgumentParser(description="Spark History Server MCP")
parser.add_argument(
"--config",
"-c",
default=os.getenv("SHS_MCP_CONFIG", "config.yaml"),
help="Path to config file (default: config.yaml, env: SHS_MCP_CONFIG)",
)
args = parser.parse_args()

try:
logger.info("Starting Spark History Server MCP...")
config = Config.from_file("config.yaml")
logger.info(f"Using config file: {args.config}")
config = Config.from_file(args.config)
if config.mcp.debug:
logger.setLevel(logging.DEBUG)
logger.debug(json.dumps(json.loads(config.model_dump_json()), indent=4))
Expand Down