File tree Expand file tree Collapse file tree 2 files changed +27
-11
lines changed
src/spark_history_mcp/core Expand file tree Collapse file tree 2 files changed +27
-11
lines changed Original file line number Diff line number Diff line change @@ -94,18 +94,13 @@ python3 -m spark_history_mcp.core.main
9494# Deactivate venv
9595deactivate
9696```
97-
98-
99- ### 📊 Sample Data
100- The repository includes real Spark event logs for testing:
101- - ` spark-bcec39f6201b42b9925124595baad260 ` - ✅ Successful ETL job
102- - ` spark-110be3a8424d4a2789cb88134418217b ` - 🔄 Data processing job
103- - ` spark-cc4d115f011443d787f03a71a476a745 ` - 📈 Multi-stage analytics job
104-
105- See ** [ TESTING.md] ( TESTING.md ) ** for using them.
106-
10797### ⚙️ Server Configuration
10898Edit ` config.yaml ` for your Spark History Server:
99+
100+ ** Config File Options:**
101+ - Command line: ` --config /path/to/config.yaml ` or ` -c /path/to/config.yaml `
102+ - Environment variable: ` SHS_MCP_CONFIG=/path/to/config.yaml `
103+ - Default: ` ./config.yaml `
109104``` yaml
110105servers :
111106 local :
@@ -121,6 +116,15 @@ mcp:
121116 debug : true
122117` ` `
123118
119+
120+ ### 📊 Sample Data
121+ The repository includes real Spark event logs for testing:
122+ - ` spark-bcec39f6201b42b9925124595baad260` - ✅ Successful ETL job
123+ - ` spark-110be3a8424d4a2789cb88134418217b` - 🔄 Data processing job
124+ - ` spark-cc4d115f011443d787f03a71a476a745` - 📈 Multi-stage analytics job
125+
126+ See **[TESTING.md](TESTING.md)** for using them.
127+
124128# # 📸 Screenshots
125129
126130# ## 🔍 Get Spark Application
Original file line number Diff line number Diff line change 11"""Main entry point for Spark History Server MCP."""
22
3+ import argparse
34import json
45import logging
6+ import os
57import sys
68
79from spark_history_mcp .config .config import Config
1618
1719def main ():
1820 """Main entry point."""
21+ parser = argparse .ArgumentParser (description = "Spark History Server MCP" )
22+ parser .add_argument (
23+ "--config" ,
24+ "-c" ,
25+ default = os .getenv ("SHS_MCP_CONFIG" , "config.yaml" ),
26+ help = "Path to config file (default: config.yaml, env: SHS_MCP_CONFIG)" ,
27+ )
28+ args = parser .parse_args ()
29+
1930 try :
2031 logger .info ("Starting Spark History Server MCP..." )
21- config = Config .from_file ("config.yaml" )
32+ logger .info (f"Using config file: { args .config } " )
33+ config = Config .from_file (args .config )
2234 if config .mcp .debug :
2335 logger .setLevel (logging .DEBUG )
2436 logger .debug (json .dumps (json .loads (config .model_dump_json ()), indent = 4 ))
You can’t perform that action at this time.
0 commit comments