From 6f3ba33e0293724c443691ba638f1ccda3123651 Mon Sep 17 00:00:00 2001 From: Mixer Date: Tue, 14 Apr 2026 06:44:22 +0800 Subject: [PATCH 1/2] Sync 2026-04-14 06:44 --- skills/mcp/native-mcp/SKILL.md | 53 ---------------------------------- 1 file changed, 53 deletions(-) diff --git a/skills/mcp/native-mcp/SKILL.md b/skills/mcp/native-mcp/SKILL.md index 9b315ee..e56bf3f 100644 --- a/skills/mcp/native-mcp/SKILL.md +++ b/skills/mcp/native-mcp/SKILL.md @@ -242,59 +242,6 @@ pip install --upgrade mcp The client retries up to 5 times with exponential backoff (1s, 2s, 4s, 8s, 16s, capped at 60s). If the server is fundamentally unreachable, it gives up after 5 attempts. Check the server process and network connectivity. -### feishu-mcp causes EPIPE / "write EPIPE" errors in stdio mode - -Many community MCP servers (e.g. `cso1z/Feishu-MCP`) emit console.log/warn output to stdout *before* the JSON-RPC handshake begins. This corrupts the stdio stream, causing `httpx.ReadError` on the Hermes side and EPIPE errors in the Node process. - -**Symptoms:** -- `Error: write EPIPE` in the MCP server process -- `httpx.ReadError` or `Session termination failed: All connection attempts failed` in Hermes logs -- Tools register briefly then immediately fail on first use - -**Solution — use HTTP transport instead of stdio:** - -1. Run feishu-mcp as a persistent HTTP server behind a systemd service: - -```bash -# Install globally -npm install -g feishu-mcp - -# Create systemd user service at ~/.config/systemd/user/feishu-mcp.service -[Unit] -Description=Feishu MCP Server -After=network.target - -[Service] -Type=simple -Restart=always -RestartSec=5 -ExecStart=/root/.hermes/node/bin/node /root/.hermes/node/lib/node_modules/feishu-mcp/dist/index.js --log-level=none --feishu-app-id=YOUR_APP_ID --feishu-app-secret=YOUR_APP_SECRET --feishu-auth-type=tenant --enabled-modules=document,task -StandardOutput=null -StandardError=journal - -[Install] -WantedBy=default.target -``` - -2. Reload and start the service: -```bash -systemctl --user daemon-reload -systemctl --user enable --now feishu-mcp -``` - -3. Configure Hermes to connect via HTTP instead of stdio: -```yaml -mcp_servers: - feishu: - url: http://127.0.0.1:3333/mcp - timeout: 120 - connect_timeout: 60 -``` - -4. Restart Hermes gateway: `hermes gateway restart` - -5. Verify: `hermes mcp test feishu` — should show "✓ Connected" with tools listed. - ## Examples ### Time Server (uvx) From 209487e3932206f32fb9b4c1ab3e41d10018dc05 Mon Sep 17 00:00:00 2001 From: Mixer Date: Mon, 13 Apr 2026 22:51:52 +0000 Subject: [PATCH 2/2] Sync 2026-04-13 22:51 --- sync.sh | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/sync.sh b/sync.sh index 68cdb4d..b5a36e9 100755 --- a/sync.sh +++ b/sync.sh @@ -1,19 +1,15 @@ #!/bin/bash -# Hermes Sync Script - 真正的双向合并同步 set -e - -SYNC_DIR="${SYNC_DIR:-$HOME/.hermes-sync}" -HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}" - +SYNC_DIR="$HOME/.hermes-sync" +HERMES_HOME="$HOME/.hermes" cd "$SYNC_DIR" -git config pull.rebase false -echo "[$(date '+%H:%M:%S')] Starting sync..." +echo "[$(date '+%H:%M:%S')] Syncing..." # Stage local changes cp "$HERMES_HOME/memories/MEMORY.md" "$SYNC_DIR/memories/MEMORY.md" 2>/dev/null || true if [ -d "$HERMES_HOME/skills" ]; then - mkdir -p "$SYNC_DIR/memories" "$SYNC_DIR/skills" + mkdir -p "$SYNC_DIR/skills" rsync -a --delete "$HERMES_HOME/skills/" "$SYNC_DIR/skills/" 2>/dev/null || true fi git add -A @@ -25,17 +21,13 @@ fi # Fetch and merge remote git fetch origin main - if git rev-parse HEAD >/dev/null 2>&1 && \ git rev-parse origin/main >/dev/null 2>&1 && \ ! git merge-base --is-ancestor HEAD origin/main 2>/dev/null; then - echo "[$(date '+%H:%M:%S')] Remote has changes, merging..." - + echo "Merging remote..." if [ "$HAS_LOCAL" = true ]; then git stash push -m "local $(date)" 2>/dev/null || true if ! git merge origin/main --no-edit 2>/dev/null; then - # Conflict: keep ours for all - git checkout --ours sync.sh 2>/dev/null || true git checkout --ours memories/MEMORY.md 2>/dev/null || true git add -A git commit -m "Auto-resolve $(date)" 2>/dev/null || true @@ -56,19 +48,17 @@ fi if [ "$HAS_LOCAL" = true ]; then git commit -m "Sync $(date '+%Y-%m-%d %H:%M')" 2>/dev/null || true if ! git push origin main 2>&1; then - echo "[$(date '+%H:%M:%S')] Push rejected, pulling..." + echo "Push rejected, pulling..." git pull origin main --no-edit 2>/dev/null || true - git push origin main 2>&1 || echo "[$(date '+%H:%M:%S')] Push failed" + git push origin main 2>&1 || echo "Push failed" fi -else - echo "[$(date '+%H:%M:%S')] No local changes" fi -# Apply merged result to hermes home +# Apply to hermes cp "$SYNC_DIR/memories/MEMORY.md" "$HERMES_HOME/memories/MEMORY.md" 2>/dev/null || true if [ -d "$SYNC_DIR/skills" ]; then rsync -a --ignore-existing "$SYNC_DIR/skills/" "$HERMES_HOME/skills/" 2>/dev/null || \ cp -rn "$SYNC_DIR/skills/"* "$HERMES_HOME/skills/" 2>/dev/null || true fi -echo "[$(date '+%H:%M:%S')] Sync complete" +echo "Done" \ No newline at end of file