Skip to content

Commit 4c30a44

Browse files
authored
add default config values (#77)
1 parent 3726ac7 commit 4c30a44

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ graph TB
5858
-[uv](https://docs.astral.sh/uv/getting-started/installation/) package manager
5959

6060
### 🚀 Setup & Testing
61+
6162
```bash
6263
git clone https://github.com/DeepDiagnostix-AI/mcp-apache-spark-history-server.git
6364
cd mcp-apache-spark-history-server
@@ -66,7 +67,6 @@ cd mcp-apache-spark-history-server
6667
brew install go-task # macOS, see https://taskfile.dev/installation/ for others
6768

6869
# Setup and start testing
69-
task install # Install dependencies
7070
task start-spark-bg # Start Spark History Server with sample data (default Spark 3.5.5)
7171
# Or specify a different Spark version:
7272
# task start-spark-bg spark_version=3.5.2
@@ -79,6 +79,21 @@ task start-inspector-bg # Start MCP Inspector
7979
# When done, run `task stop-all`
8080
```
8181

82+
If you just want to run the MCP server without cloning the repository:
83+
84+
```bash
85+
# Run with uv without installing the module
86+
uvx --from mcp-apache-spark-history-server spark-mcp
87+
88+
# OR run with pip and python. Use of venv is highly encouraged.
89+
python3 -m venv spark-mcp && source spark-mcp/bin/activate
90+
pip install mcp-apache-spark-history-server
91+
python3 -m spark_history_mcp.core.main
92+
# Deactivate venv
93+
deactivate
94+
```
95+
96+
8297
### 📊 Sample Data
8398
The repository includes real Spark event logs for testing:
8499
- `spark-bcec39f6201b42b9925124595baad260` - ✅ Successful ETL job

src/spark_history_mcp/config/config.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ class McpConfig(BaseSettings):
4343
class Config(BaseSettings):
4444
"""Configuration for the Spark client."""
4545

46-
servers: Dict[str, ServerConfig]
47-
mcp: Optional[McpConfig] = None
46+
servers: Dict[str, ServerConfig] = {
47+
"local": ServerConfig(url="http://localhost:18080", default=True),
48+
}
49+
mcp: Optional[McpConfig] = McpConfig(transports=["streamable-http"])
4850
model_config = SettingsConfigDict(
4951
env_prefix="SHS_",
5052
env_nested_delimiter="_",
@@ -56,7 +58,7 @@ class Config(BaseSettings):
5658
def from_file(cls, file_path: str) -> "Config":
5759
"""Load configuration from a YAML file."""
5860
if not os.path.exists(file_path):
59-
raise FileNotFoundError(f"Config file not found: {file_path}")
61+
return Config()
6062

6163
with open(file_path, "r") as f:
6264
config_data = yaml.safe_load(f)

0 commit comments

Comments
 (0)