1.7 KiB
1.7 KiB
Local Development Setup für GhostNet MCP Router
Voraussetzungen
- Python 3.12+
- VSCode mit Python/Pylance Extension
Einrichtung
1. Virtual Environment anlegen
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)
{
"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)
{
"python.analysis.typeCheckingMode": "basic",
"python.pythonPath": ".venv/bin/python",
"python.defaultInterpreterPath": ".venv/bin/python"
}
5. Testen
# 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.jsonmuss URL zu einem MCP-fähigen Skill enthalten