Sync vault notes: April-November 2026 sessions, projects, and architecture
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fe4fe656be
commit
994c7ae577
379 files changed
+55216
-107
No files matched your search
@@ -0,0 +1,268 @@
|
||||
|
||||
## DeerFlow + Hermes MCP Integration Guide
|
||||
|
||||
# DeerFlow + Hermes MCP Integration Guide
|
||||
|
||||
## Overview
|
||||
|
||||
This guide documents how to attach Hermes MCP (email + Obsidian) to DeerFlow running in Kubernetes (microk8s). Hermes MCP provides:
|
||||
- **Yahoo Mail** (`gheron01@yahoo.com`)
|
||||
- **FetcherPay emails** (`garfield.heron@fetcherpay.com`, `garfield@fetcherpay.com`, `sales@fetcherpay.com`, `leads@fetcherpay.com`, `founder@fetcherpay.com`)
|
||||
- **Obsidian vault** access
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
User → jacob.fetcherpay.com (Ingress)
|
||||
→ deer-flow-nginx (K8s Service:2026)
|
||||
→ deer-flow-langgraph (K8s Pod:2024)
|
||||
→ Hermes MCP (K8s Service:3456)
|
||||
```
|
||||
|
||||
## Critical Lesson: Use HTTP Transport, NOT SSE
|
||||
|
||||
**DO NOT use `type: "sse"`** for Hermes MCP. The `langchain-mcp-adapters` `MultiServerMCPClient` hangs indefinitely on SSE connections to Hermes MCP due to an `asyncio.gather()` deadlock with no timeout.
|
||||
|
||||
**Always use `type: "http"`** (which maps to `streamable_http` in `langchain-mcp-adapters`).
|
||||
|
||||
## Step-by-Step Setup
|
||||
|
||||
### 1. Verify Hermes MCP is Running
|
||||
|
||||
```bash
|
||||
microk8s kubectl get pods -n fetcherpay | grep hermes-mcp
|
||||
# Should show: hermes-mcp-... 1/1 Running
|
||||
|
||||
# Test the endpoint from host
|
||||
curl -s -H "x-api-key: 114521f3f9e6858480d6269446a446ef" \
|
||||
http://10.152.183.89:3456/mcp
|
||||
# Expected: {"error":"No active session"}
|
||||
```
|
||||
|
||||
### 2. Update the ConfigMap
|
||||
|
||||
Edit `deer-flow-app-config` in the `fetcherpay` namespace:
|
||||
|
||||
```bash
|
||||
microk8s kubectl edit configmap deer-flow-app-config -n fetcherpay
|
||||
```
|
||||
|
||||
Update the `extensions_config.json` field:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"filesystem": {
|
||||
"enabled": false,
|
||||
"type": "stdio",
|
||||
"command": "npx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/files"],
|
||||
"env": {},
|
||||
"url": null,
|
||||
"headers": {},
|
||||
"oauth": null,
|
||||
"description": "Provides filesystem access within allowed directories"
|
||||
},
|
||||
"github": {
|
||||
"enabled": false,
|
||||
"type": "stdio",
|
||||
"command": "npx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-github"],
|
||||
"env": { "GITHUB_TOKEN": "" },
|
||||
"url": null,
|
||||
"headers": {},
|
||||
"oauth": null,
|
||||
"description": "GitHub MCP server for repository operations"
|
||||
},
|
||||
"hermes-mcp": {
|
||||
"enabled": true,
|
||||
"type": "http",
|
||||
"url": "http://hermes-mcp:3456/mcp",
|
||||
"headers": {
|
||||
"x-api-key": "114521f3f9e6858480d6269446a446ef"
|
||||
},
|
||||
"env": {},
|
||||
"oauth": null,
|
||||
"description": "Hermes MCP - access to Yahoo Mail, FetcherPay emails, and Obsidian vault"
|
||||
},
|
||||
"postgres": {
|
||||
"enabled": false,
|
||||
"type": "stdio",
|
||||
"command": "npx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"],
|
||||
"env": {},
|
||||
"url": null,
|
||||
"headers": {},
|
||||
"oauth": null,
|
||||
"description": "PostgreSQL database access"
|
||||
}
|
||||
},
|
||||
"skills": {}
|
||||
}
|
||||
```
|
||||
|
||||
**Key points:**
|
||||
- `type: "http"` — NOT `"sse"`
|
||||
- URL uses **internal K8s service name**: `http://hermes-mcp:3456/mcp`
|
||||
- `x-api-key` header must match `MCP_API_KEY` env var in Hermes MCP deployment
|
||||
- Disable `filesystem` and `github` — they require `npx` which isn't in the DeerFlow container
|
||||
|
||||
### 3. Ensure Thread Persistence (`.langgraph_api` on PVC)
|
||||
|
||||
The LangGraph dev server stores compiled graph state in `.langgraph_api/`. This must be on the PVC or thread data is lost on pod restart.
|
||||
|
||||
Verify the deployment has this mount:
|
||||
|
||||
```bash
|
||||
microk8s kubectl get deployment deer-flow-langgraph -n fetcherpay -o yaml | grep -A 5 "subPath: .langgraph_api"
|
||||
```
|
||||
|
||||
Should show:
|
||||
```yaml
|
||||
- mountPath: /app/backend/.langgraph_api
|
||||
name: deer-flow-data
|
||||
subPath: .langgraph_api
|
||||
```
|
||||
|
||||
If missing, patch it:
|
||||
|
||||
```bash
|
||||
microk8s kubectl patch deployment deer-flow-langgraph -n fetcherpay --type='json' -p='[
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/spec/template/spec/containers/0/volumeMounts/-",
|
||||
"value": {
|
||||
"mountPath": "/app/backend/.langgraph_api",
|
||||
"name": "deer-flow-data",
|
||||
"subPath": ".langgraph_api"
|
||||
}
|
||||
}
|
||||
]'
|
||||
```
|
||||
|
||||
Also ensure `.langgraph_api` directory exists on the PVC:
|
||||
|
||||
```bash
|
||||
mkdir -p /var/snap/microk8s/common/default-storage/fetcherpay-deer-flow-data-pvc-*/.langgraph_api
|
||||
```
|
||||
|
||||
### 4. Rebuild and Redeploy
|
||||
|
||||
Build the backend image:
|
||||
|
||||
```bash
|
||||
cd /home/garfield/deer-flow
|
||||
docker build -t localhost:32000/deer-flow-backend:latest -f backend/Dockerfile .
|
||||
```
|
||||
|
||||
Tag and push:
|
||||
|
||||
```bash
|
||||
GIT_SHA=$(git rev-parse --short HEAD)
|
||||
docker tag localhost:32000/deer-flow-backend:latest localhost:32000/deer-flow-backend:${GIT_SHA}
|
||||
docker push localhost:32000/deer-flow-backend:${GIT_SHA}
|
||||
```
|
||||
|
||||
Update deployments to use the new tag:
|
||||
|
||||
```bash
|
||||
microk8s kubectl patch deployment deer-flow-langgraph -n fetcherpay -p \
|
||||
'{"spec":{"template":{"spec":{"containers":[{"name":"langgraph","image":"localhost:32000/deer-flow-backend:'${GIT_SHA}'"}]}}}}'
|
||||
|
||||
microk8s kubectl patch deployment deer-flow-gateway -n fetcherpay -p \
|
||||
'{"spec":{"template":{"spec":{"containers":[{"name":"gateway","image":"localhost:32000/deer-flow-backend:'${GIT_SHA}'"}]}}}}'
|
||||
```
|
||||
|
||||
**Important:** The `deer-flow-frontend` image also needs rebuilding if frontend code changed:
|
||||
|
||||
```bash
|
||||
docker build -t localhost:32000/deer-flow-frontend:latest -f frontend/Dockerfile .
|
||||
docker push localhost:32000/deer-flow-frontend:latest
|
||||
microk8s kubectl patch deployment deer-flow-frontend -n fetcherpay -p \
|
||||
'{"spec":{"template":{"spec":{"containers":[{"name":"frontend","image":"localhost:32000/deer-flow-frontend:latest"}]}}}}'
|
||||
```
|
||||
|
||||
### 5. Verify MCP Tools Loaded
|
||||
|
||||
After the new pod is running, trigger a graph compilation by creating a thread and run:
|
||||
|
||||
```bash
|
||||
# Create a thread
|
||||
curl -s -X POST http://localhost:32024/threads -H "Content-Type: application/json" -d '{}'
|
||||
|
||||
# Create a run (this forces graph compilation and MCP init)
|
||||
curl -s -X POST "http://localhost:32024/threads/<THREAD_ID>/runs" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"assistant_id": "lead_agent", "input": {"messages": [{"role": "human", "content": "hello"}]}}'
|
||||
```
|
||||
|
||||
Then check the langgraph pod logs for MCP initialization:
|
||||
|
||||
```bash
|
||||
microk8s kubectl logs -n fetcherpay deployment/deer-flow-langgraph --since=2m
|
||||
```
|
||||
|
||||
Expected output:
|
||||
```
|
||||
MCP tools initialized: 10 tool(s) loaded
|
||||
Successfully loaded 10 tool(s) from MCP servers
|
||||
```
|
||||
|
||||
### 6. Test with Jacob
|
||||
|
||||
Open a **completely fresh thread** with Jacob and ask:
|
||||
|
||||
> "What tools do you have access to through Hermes?"
|
||||
|
||||
He should list:
|
||||
- `hermes-mcp_search_messages`
|
||||
- `hermes-mcp_read_message`
|
||||
- `hermes-mcp_send_email`
|
||||
- `hermes-mcp_obsidian_search_notes`
|
||||
- `hermes-mcp_obsidian_read_note`
|
||||
- `hermes-mcp_obsidian_append_to_note`
|
||||
- (and others)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "No enabled MCP servers configured"
|
||||
- Check `extensions_config.json` is mounted correctly in the pod
|
||||
- Verify `DEER_FLOW_EXTENSIONS_CONFIG_PATH` env var points to the right file
|
||||
- Ensure ConfigMap was applied and pod was restarted
|
||||
|
||||
### MCP init hangs / no tools loaded
|
||||
- **Most likely cause:** Using `type: "sse"` instead of `"http"`
|
||||
- Check if `filesystem` or `github` servers are enabled — disable them (no `npx` in container)
|
||||
- Verify Hermes MCP pod is running: `microk8s kubectl get pods -n fetcherpay | grep hermes`
|
||||
- Test Hermes endpoint: `curl -H "x-api-key: ..." http://hermes-mcp:3456/mcp`
|
||||
|
||||
### Thread history lost after pod restart
|
||||
- `.langgraph_api` directory is not persisted on PVC
|
||||
- Patch deployment to mount `.langgraph_api` from PVC (see Step 3)
|
||||
- Delete old `.langgraph_ops.pckl` to force recompilation after code changes
|
||||
|
||||
### "Invalid image" / pod uses old code
|
||||
- `imagePullPolicy: IfNotPresent` means K8s won't pull new `latest` tag
|
||||
- Always use specific tags (git SHA) instead of `latest`
|
||||
- Or set `imagePullPolicy: Always` during active development
|
||||
|
||||
## Files and Locations
|
||||
|
||||
| File | Location | Purpose |
|
||||
|------|----------|---------|
|
||||
| ConfigMap | `deer-flow-app-config` in `fetcherpay` namespace | MCP server config |
|
||||
| PVC data | `/var/snap/microk8s/common/default-storage/fetcherpay-deer-flow-data-pvc-*/` | Persistent agent data |
|
||||
| Jacob's SOUL.md | `.deer-flow/agents/jacob/SOUL.md` | Agent personality |
|
||||
| Jacob's config | `.deer-flow/agents/jacob/config.yaml` | Agent configuration |
|
||||
| Hermes MCP source | `/home/garfield/hermes-mcp/` | Hermes MCP server code |
|
||||
| Hermes K8s manifest | `/home/garfield/hermes-mcp/hermes-k8s.yaml` | Hermes deployment |
|
||||
| DeerFlow K8s manifests | `/home/garfield/deer-flow/k8s/` | DeerFlow deployments |
|
||||
| Local registry | `localhost:32000` | Docker image registry for K8s |
|
||||
|
||||
## References
|
||||
|
||||
- Hermes MCP repo: https://github.com/yuukiii/hermes-mcp
|
||||
- DeerFlow repo: https://github.com/bytedance/deer-flow
|
||||
- `langchain-mcp-adapters` transport docs: HTTP/SSE support
|
||||
- LangGraph API: `http://localhost:32024` (NodePort for internal testing)
|
||||
|
||||
Reference in new issue
Block a user