Skip to content

Commit 2d6eeca

Browse files
authored
Update env var keys (#9)
Signed-off-by: Manabu McCloskey <[email protected]>
1 parent aeb796d commit 2d6eeca

File tree

8 files changed

+49
-300
lines changed

8 files changed

+49
-300
lines changed

README.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,17 @@ task start-mcp-bg # Start MCP Server
6060
task start-inspector-bg # Start MCP Inspector
6161

6262
# Opens http://localhost:6274 for interactive testing
63-
# When done: task stop-all
63+
# When done, run `task stop-all`
6464
```
6565

66+
### 📊 Sample Data
67+
The repository includes real Spark event logs for testing:
68+
- `spark-bcec39f6201b42b9925124595baad260` - ✅ Successful ETL job
69+
- `spark-110be3a8424d4a2789cb88134418217b` - 🔄 Data processing job
70+
- `spark-cc4d115f011443d787f03a71a476a745` - 📈 Multi-stage analytics job
71+
72+
See **[TESTING.md](TESTING.md)** for using them.
73+
6674
### ⚙️ Configuration
6775
Edit `config.yaml` for your Spark History Server:
6876
```yaml
@@ -73,6 +81,11 @@ servers:
7381
auth: # optional
7482
username: "user"
7583
password: "pass"
84+
mcp:
85+
transports:
86+
- streamable-http # streamable-http or stdio.
87+
port: "18888"
88+
debug: true
7689
```
7790
7891
## 📸 Screenshots
@@ -131,14 +144,6 @@ helm install spark-history-mcp ./deploy/kubernetes/helm/spark-history-mcp/ \
131144

132145
📚 See [`deploy/kubernetes/helm/`](deploy/kubernetes/helm/) for complete deployment manifests and configuration options.
133146

134-
## 📊 Sample Data
135-
The repository includes real Spark event logs for testing:
136-
- `spark-bcec39f6201b42b9925124595baad260` - ✅ Successful ETL job
137-
- `spark-110be3a8424d4a2789cb88134418217b` - 🔄 Data processing job
138-
- `spark-cc4d115f011443d787f03a71a476a745` - 📈 Multi-stage analytics job
139-
140-
📖 **Advanced testing**: **[TESTING.md](TESTING.md)**
141-
142147
## ⚙️ Configuration
143148

144149
### 🌐 Multi-server Setup
@@ -156,26 +161,24 @@ servers:
156161

157162
### 🔐 Environment Variables
158163
```bash
159-
SPARK_USERNAME=your_username
160-
SPARK_PASSWORD=your_password
161-
SPARK_TOKEN=your_jwt_token
162-
MCP_PORT=18888
163-
MCP_DEBUG=false
164+
SHS_SPARK_USERNAME=your_username
165+
SHS_SPARK_PASSWORD=your_password
166+
SHS_SPARK_TOKEN=your_jwt_token
167+
SHS_MCP_PORT=18888
168+
SHS_MCP_DEBUG=false
164169
```
165170

166171
## 🤖 AI Agent Integration
167172

168173
### Quick Start Options
169174

170-
| Integration | Transport | Entry Point | Best For |
171-
|-------------|-----------|-------------|----------|
172-
| **[Local Testing](TESTING.md)** | HTTP | `main.py` | Development, testing tools |
173-
| **[Claude Desktop](examples/integrations/claude-desktop/)** | STDIO | `main_stdio.py` | Interactive analysis |
174-
| **[Amazon Q CLI](examples/integrations/amazon-q-cli/)** | STDIO | `main_stdio.py` | Command-line automation |
175-
| **[LlamaIndex](examples/integrations/llamaindex.md)** | HTTP | `main.py` | Knowledge systems, RAG |
176-
| **[LangGraph](examples/integrations/langgraph.md)** | HTTP | `main.py` | Multi-agent workflows |
177-
178-
**Note**: Claude Desktop and Amazon Q CLI use STDIO transport with 6 core tools. LlamaIndex/LangGraph use HTTP transport with 18 comprehensive tools.
175+
| Integration | Transport | Best For |
176+
|-------------|-----------|----------|
177+
| **[Local Testing](TESTING.md)** | HTTP | Development, testing tools |
178+
| **[Claude Desktop](examples/integrations/claude-desktop/)** | STDIO | Interactive analysis |
179+
| **[Amazon Q CLI](examples/integrations/amazon-q-cli/)** | STDIO | Command-line automation |
180+
| **[LlamaIndex](examples/integrations/llamaindex.md)** | HTTP | Knowledge systems, RAG |
181+
| **[LangGraph](examples/integrations/langgraph.md)** | HTTP | Multi-agent workflows |
179182

180183
## 🎯 Example Use Cases
181184

Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ tasks:
134134
cmds:
135135
- echo "Starting MCP Inspector at http://localhost:6274"
136136
- echo "Press Ctrl+C to stop the inspector"
137-
- DANGEROUSLY_OMIT_AUTH=true npx @modelcontextprotocol/inspector uv run main.py
137+
- DANGEROUSLY_OMIT_AUTH=true npx --yes @modelcontextprotocol/inspector
138138

139139
start-inspector-bg:
140140
desc: Start MCP Inspector in background
141141
silent: true
142142
cmds:
143143
- |
144144
echo "Starting MCP Inspector in background..."
145-
nohup sh -c 'DANGEROUSLY_OMIT_AUTH=true npx @modelcontextprotocol/inspector uv run main.py' > inspector.log 2>&1 &
145+
nohup sh -c 'DANGEROUSLY_OMIT_AUTH=true npx --yes @modelcontextprotocol/inspector' > inspector.log 2>&1 &
146146
sleep 3
147147
echo "✅ MCP Inspector started at http://localhost:6274"
148148

app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ async def app_lifespan(server: FastMCP) -> AsyncIterator[AppContext]:
4545
def run():
4646
config = Config.from_file("config.yaml")
4747

48-
mcp.settings.port = int(os.getenv("MCP_PORT", config.mcp.port))
49-
mcp.settings.debug = bool(os.getenv("MCP_DEBUG", config.mcp.debug))
50-
mcp.run(transport=config.mcp.transports[0])
48+
mcp.settings.port = int(os.getenv("SHS_MCP_PORT", config.mcp.port))
49+
mcp.settings.debug = bool(os.getenv("SHS_MCP_DEBUG", config.mcp.debug))
50+
mcp.run(transport=os.getenv("SHS_MCP_TRANSPORT", config.mcp.transports[0]))
5151

5252

5353
mcp = FastMCP("Spark Events", lifespan=app_lifespan)

config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class AuthConfig(BaseModel):
1515
def __init__(self, **data):
1616
# Support environment variables for sensitive data
1717
if not data.get("username"):
18-
data["username"] = os.getenv("SPARK_USERNAME")
18+
data["username"] = os.getenv("SHS_SPARK_USERNAME")
1919
if not data.get("password"):
20-
data["password"] = os.getenv("SPARK_PASSWORD")
20+
data["password"] = os.getenv("SHS_SPARK_PASSWORD")
2121
if not data.get("token"):
22-
data["token"] = os.getenv("SPARK_TOKEN")
22+
data["token"] = os.getenv("SHS_SPARK_TOKEN")
2323
super().__init__(**data)
2424

2525

config.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ servers:
44
url: "http://localhost:18080"
55
# Optional authentication (can also use environment variables)
66
# auth:
7-
# username: "your_username" # or use SPARK_USERNAME env var
8-
# password: "your_password" # or use SPARK_PASSWORD env var
9-
# token: "your_token" # or use SPARK_TOKEN env var
7+
# username: "your_username" # or use SHS_SPARK_USERNAME env var
8+
# password: "your_password" # or use SHS_SPARK_PASSWORD env var
9+
# token: "your_token" # or use SHS_SPARK_TOKEN env var
1010

1111
# Production server example
1212
# production:
1313
# url: "https://spark-history.company.com:18080"
1414
# auth:
1515
# Use environment variables for production
16-
# username: ${SPARK_USERNAME}
17-
# password: ${SPARK_PASSWORD}
18-
# token: ${SPARK_TOKEN}
16+
# username: ${SHS_SPARK_USERNAME}
17+
# password: ${SHS_SPARK_PASSWORD}
18+
# token: ${SHS_SPARK_TOKEN}
1919

2020
# Staging server example
2121
# staging:
@@ -31,8 +31,8 @@ mcp:
3131
debug: true
3232

3333
# Environment Variables:
34-
# SPARK_USERNAME - Default username for authentication
35-
# SPARK_PASSWORD - Default password for authentication
36-
# SPARK_TOKEN - Default token for authentication
37-
# MCP_PORT - Port for MCP server (default: 18888)
38-
# MCP_DEBUG - Enable debug mode (default: false)
34+
# SHS_SPARK_USERNAME - Default username for authentication
35+
# SHS_SPARK_PASSWORD - Default password for authentication
36+
# SHS_SPARK_TOKEN - Default token for authentication
37+
# SHS_MCP_PORT - Port for MCP server (default: 18888)
38+
# SHS_MCP_DEBUG - Enable debug mode (default: false)

examples/integrations/amazon-q-cli/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ curl http://localhost:18080/api/v1/applications
3535
```bash
3636
q mcp add \
3737
--name spark-history-server-mcp \
38-
--command /Users/username/.local/bin/uv \
39-
--args "run,--project,/Users/username/spark-history-server-mcp,python,main_stdio.py" \
38+
--command uv \
39+
--args "run,main.py" \
40+
--env SHS_MCP_TRANSPORT=stdio \
4041
--scope workspace
4142
```
4243

examples/integrations/claude-desktop/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ curl http://localhost:18080/api/v1/applications
3838
"mcpServers": {
3939
"spark-history-server-mcp": {
4040
"command": "uv",
41-
"args": ["run", "--project", "/Users/username/spark-history-server-mcp", "python", "main_stdio.py"],
42-
"cwd": "/Users/username/spark-history-server-mcp"
41+
"args": ["run", "main.py"]
4342
}
4443
}
4544
}

0 commit comments

Comments
 (0)