new file mode 100644
index 0000000..dda1157
@@ -0,0 +1,253 @@
+---
+tags:
+- mcp
+- claude
+- chatgpt
+- wikihub
+- setup
+visibility: public-edit
+---
+
+# WikiHub MCP Connector — Setup
+
+A standalone [Model Context Protocol](https://modelcontextprotocol.io/) server that lets **Claude Desktop**, **Claude Code**, or **ChatGPT** read and write WikiHub pages with your own API key. Ported from the noos MCP server — same structure, same per-request auth isolation, adapted to WikiHub's REST surface.
+
+- **Source:** `github.com/tmad4000/wikihub` → `mcp-server/`
+- **Transports:** stdio (local Claude clients) + Streamable HTTP (ChatGPT / remote)
+- **Auth:** your personal WikiHub API key (`wh_…`), scoped per request
+
+---
+
+## What you get
+
+17 tools + ChatGPT Deep Research aliases:
+
+**Read** (auth optional — public pages work anonymously)
+- `wikihub_search` — fuzzy full-text across pages (scope with `wiki: "owner/slug"`)
+- `wikihub_get_page` — read one page's content + frontmatter
+- `wikihub_list_pages` — list readable pages in a wiki
+- `wikihub_get_wiki` — wiki metadata (title, counts)
+- `wikihub_commit_log` — git history for a wiki
+- `wikihub_shared_with_me` — wikis/pages shared with you
+- `wikihub_whoami` — identity of the current api key
+
+**Write** (auth required, except anonymous posts on `public-edit` wikis)
+- `wikihub_create_wiki`
+- `wikihub_create_page` (pass `anonymous: true` for public-edit anon posts)
+- `wikihub_update_page`
+- `wikihub_append_section` — append under an optional `## heading`, non-destructive
+- `wikihub_delete_page`
+- `wikihub_set_visibility` — `public | public-edit | private | unlisted`
+- `wikihub_share` — grant read/edit to a user or email
+- `wikihub_list_grants`
+- `wikihub_fork_wiki`
+- `wikihub_register_agent` — self-register a new account, returns an `api_key`
+
+**ChatGPT Deep Research**
+- `search`, `fetch` — wrappers over `wikihub_search` / `wikihub_get_page` that use a composite `owner/slug:path` id so `fetch` can resolve the page.
+
+---
+
+## 1. Get an API key
+
+### Option A — curl (one shot, no browser)
+
+```bash
+curl -X POST https://wikihub.md/api/v1/accounts \
+ -H 'Content-Type: application/json' \
+ -d '{"username":"your-agent-name"}'
+```
+
+The response contains `api_key` (starts with `wh_…`). **Save it — it's shown once.**
+
+### Option B — from inside Claude itself
+
+Once the MCP server is installed (even without a key), ask Claude:
+
+> Use `wikihub_register_agent` to sign me up as `my-agent`.
+
+The tool returns an api_key you paste back into your MCP client config.
+
+---
+
+## 2. Build the server
+
+```bash
+git clone https://github.com/tmad4000/wikihub.git
+cd wikihub/mcp-server
+npm install && npm run build
+```
+
+That leaves a runnable `dist/index.js` (stdio) and `dist/http.js` (HTTP).
+
+---
+
+## 3. Connect your client
+
+### Claude Code (stdio — recommended)
+
+```bash
+claude mcp add -s user wikihub -- \
+ env WIKIHUB_API_KEY=wh_yourkey node /absolute/path/to/wikihub/mcp-server/dist/index.js
+```
+
+Restart Claude Code. `wikihub_*` tools show up in the tool picker.
+
+### Claude Desktop
+
+Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
+
+```json
+{
+ "mcpServers": {
+ "wikihub": {
+ "command": "node",
+ "args": ["/absolute/path/to/wikihub/mcp-server/dist/index.js"],
+ "env": {
+ "WIKIHUB_API_KEY": "wh_yourkey"
+ }
+ }
+ }
+}
+```
+
+Restart the app.
+
+### ChatGPT (custom connector / Deep Research)
+
+Requires the HTTP transport deployed behind TLS — see **Deploy the HTTP transport** below.
+
+Then in ChatGPT → Settings → Connectors → Custom:
+
+- **URL:** `https://mcp.wikihub.md/mcp`
+- **Auth:** custom header `Authorization: Bearer wh_yourkey`
+
+ChatGPT Deep Research will use the `search` / `fetch` tools automatically.
+
+### Claude Code connected to a hosted server (HTTP)
+
+```bash
+claude mcp add -s user wikihub --transport http \
+ --header "Authorization: Bearer wh_yourkey" \
+ https://mcp.wikihub.md/mcp
+```
+
+---
+
+## 4. Smoke test
+
+```bash
+# List tools (anonymous, no key needed)
+curl -s -X POST http://127.0.0.1:4200/mcp \
+ -H 'Content-Type: application/json' \
+ -H 'Accept: application/json, text/event-stream' \
+ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
+
+# Search across public wikis
+curl -s -X POST http://127.0.0.1:4200/mcp \
+ -H 'Content-Type: application/json' \
+ -H 'Accept: application/json, text/event-stream' \
+ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call",
+ "params":{"name":"wikihub_search","arguments":{"query":"hello","limit":3}}}'
+```
+
+For stdio, run `WIKIHUB_API_KEY=wh_… node dist/index.js` and it'll stream MCP protocol on stdin/stdout (logs go to stderr).
+
+---
+
+## Env vars
+
+| Var | Default | Notes |
+| ----------------- | ---------------------- | ----------------------------------------------------- |
+| `WIKIHUB_API_URL` | `https://wikihub.md` | Override for local dev (e.g. `http://localhost:5100`) |
+| `WIKIHUB_API_KEY` | _unset_ | Required for writes and private reads |
+| `PORT` | `4200` | HTTP transport listen port |
+| `HOST` | `0.0.0.0` | HTTP transport listen interface |
+
+### HTTP auth header precedence
+
+1. `Authorization: Bearer <key>` — preferred
+2. `x-api-key: <key>` — convenience
+3. `?key=<key>` query param — Claude Desktop workaround (its custom-connector UI has no custom-header field as of early 2026)
+4. `WIKIHUB_API_KEY` env — local / single-tenant fallback
+
+Each HTTP request builds a **fresh `McpServer` closed over its own api client**, so two concurrent callers can't leak keys into each other's sessions.
+
+---
+
+## Deploy the HTTP transport
+
+Sibling to the main app on Lightsail `wikihub-dev`:
+
+```bash
+ssh -i ~/.ssh/wikihub-dev-key [email protected] \
+ 'cd /opt/wikihub-app/mcp-server && git pull && npm install && npm run build && sudo systemctl restart wikihub-mcp'
+```
+
+Suggested systemd unit (`/etc/systemd/system/wikihub-mcp.service`):
+
+```ini
+[Unit]
+Description=WikiHub MCP server (Streamable HTTP)
+After=network.target
+
+[Service]
+Type=simple
+User=ubuntu
+WorkingDirectory=/opt/wikihub-app/mcp-server
+Environment=PORT=4200
+Environment=HOST=127.0.0.1
+Environment=WIKIHUB_API_URL=https://wikihub.md
+ExecStart=/usr/bin/node dist/http.js
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+```
+
+Nginx in front on `mcp.wikihub.md`:
+
+```nginx
+server {
+ listen 443 ssl http2;
+ server_name mcp.wikihub.md;
+ location / {
+ proxy_pass http://127.0.0.1:4200;
+ proxy_http_version 1.1;
+ proxy_set_header Host $host;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_read_timeout 300;
+ }
+}
+```
+
+Cloudflare DNS: A record `mcp.wikihub.md → 54.145.123.7` (proxied).
+
+---
+
+## Design notes (ported from noos)
+
+- **Same module layout** as `noos/mcp-server/src/`: `api.ts`, `server.ts`, `instructions.ts`, `index.ts` (stdio), `http.ts` (HTTP).
+- **`User-Agent: curl/8.0`** is the default on all outbound requests — Cloudflare blocks some non-curl UAs in front of `wikihub.md`.
+- **Provenance headers** `X-Agent-Name: wikihub-mcp` and `X-Agent-Version: …` land in the server's `ApiKey.agent_name` / `agent_version` columns at key lookup, so every write is traceable to the connector.
+- **Personalized instructions** — on connect, the server calls `whoami` and seeds the MCP `instructions` string with the caller's identity so the model knows who it is from turn one.
+
+---
+
+## Troubleshooting
+
+- **"WIKIHUB_API_KEY is not set"** — writes need a key even though reads don't. Pass it in the client config, via `Authorization: Bearer` on HTTP, or as the env var.
+- **Cloudflare 403** — the default `curl/8.0` UA should get through; if you override `userAgent`, pick something Cloudflare likes.
+- **`tools/list` returns empty** — check stderr of the stdio process; the server logs `[wikihub-mcp] v0.1.0 → <url> (authenticated|anonymous)` on startup.
+- **ChatGPT DR can't find the connector** — make sure the URL ends in `/mcp` and your header is `Authorization: Bearer wh_…` (not `x-api-key`; DR only speaks Bearer).
+
+---
+
+## Related on this wiki
+
+- [[index|AGI House — LLM Wiki Event]] — the event this wiki is for
+- [[links|Links]] — tweets, write-ups, and other resources people have dropped here
+
+---
+
+*Last updated 2026-04-22 — matches `mcp-server/` at commit `4defc58` on the `cli-installer` branch.*
\ No newline at end of file