Add streamable-http and SSE transport support via CLI args
This commit is contained in:
@@ -86,6 +86,36 @@ TradingView session cookies enable real-time data. Priority:
|
||||
2. `set_session` tool (in-memory)
|
||||
3. `TV_SESSION_ID` environment variable (loaded from `.env` via `python-dotenv`)
|
||||
|
||||
## NanoClaw Integration
|
||||
|
||||
Add to your NanoClaw group's `.mcp.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"tradingview-screener": {
|
||||
"command": "/path/to/.venv/bin/python3",
|
||||
"args": ["/path/to/server.py"],
|
||||
"env": {
|
||||
"TV_SESSION_ID": "${TV_SESSION_ID}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For streamable HTTP (server runs externally):
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"tradingview-screener": {
|
||||
"url": "http://host.docker.internal:8000/mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
@@ -99,7 +129,14 @@ cp .env.example .env
|
||||
## Run
|
||||
|
||||
```bash
|
||||
# STDIO transport (default — for Claude Desktop, NanoClaw, etc.)
|
||||
python server.py
|
||||
|
||||
# Streamable HTTP transport
|
||||
python server.py --transport streamable-http --host 0.0.0.0 --port 8000
|
||||
|
||||
# SSE transport
|
||||
python server.py --transport sse --host 127.0.0.1 --port 8000
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
Reference in New Issue
Block a user