Files

76 lines
1.7 KiB
Markdown

# Local Development Setup für GhostNet MCP Router
## Voraussetzungen
- Python 3.12+
- VSCode mit Python/Pylance Extension
## Einrichtung
### 1. Virtual Environment anlegen
```bash
cd /home/ghost/source/repos/ghostnet-openclaw/tools/router
python3 -m venv .venv
source .venv/bin/activate
pip install -r app/requirements.txt
```
### 2. VSCode Konfiguration
Öffne den Ordner `tools/router/` in VSCode und installiere folgende Extensions:
- Python (Microsoft)
- Pylance
- Black Formatter (optional)
### 3. Launch Configuration (.vscode/launch.json)
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Router debuggen",
"type": "debugpy",
"request": "launch",
"module": "uvicorn",
"args": [
"app.main:app",
"--host", "0.0.0.0",
"--port", "3000",
"--reload"
],
"jinja": true,
"env": {
"CONFIG_PATH": "config/gateway.json"
},
"cwd": "${workspaceFolder}"
}
]
}
```
### 4. Pylance Konfiguration (.vscode/settings.json)
```json
{
"python.analysis.typeCheckingMode": "basic",
"python.pythonPath": ".venv/bin/python",
"python.defaultInterpreterPath": ".venv/bin/python"
}
```
### 5. Testen
```bash
# Server starten
uvicorn app.main:app --host 0.0.0.0 --port 3000 --reload
# In anderem Terminal testen:
curl http://localhost:3000/sse
```
## Wichtige Pfade
- Router Source: `app/`
- Config: `config/gateway.json`
- Log-Output: stdout (INFO level default)
## Bekannte Issues
- Der Router benötigt laufende MCP-Skills (z.B. searchfetch), damit er Tools registrieren kann
- Ohne config/mcpServers ist der Router nutzlos (keine Tools registriert)
- `config/gateway.json` muss URL zu einem MCP-fähigen Skill enthalten