#!/bin/sh
# Shared Wiki.js MCP stdio bridge for Cursor and Antigravity (pi uses its own mcp.json).
# The token never lands in a config file: secretctl injects it into mcp-remote's child env.
set -eu
PROXY="$HOME/.local/share/wiki-mcp/node_modules/mcp-remote/dist/proxy.js"
BUN="$HOME/.local/share/mise/installs/bun/latest/bin/bun"
exec secretctl get WIKI3_MCP_TOKEN -- \
  "$BUN" "$PROXY" \
  "https://wiki.godemperordoge.org/_mcp" \
  --header 'Authorization:Bearer ${WIKI3_MCP_TOKEN}' \
  --header 'User-Agent:Mozilla/5.0 PersonalWikiMCP/1.0' \
  --transport http-only \
  --silent
