feat: API key auth, fable-mcp package, and semantic search endpoint #8

Merged
bvandeusen merged 0 commits from dev into main 2026-03-23 23:05:18 -04:00
bvandeusen commented 2026-03-23 22:47:43 -04:00 (Migrated from git.fabledsword.com)

Summary

  • API key auth — new api_keys table (migration 0027), _check_auth updated to accept Authorization: Bearer fmcp_* tokens before falling back to session. Read/write scope enforcement. Soft-delete via revoked_at, last_used_at tracking.
  • Settings UI — API Keys tab — generate, copy, revoke keys; one-time reveal with .env download and Claude config download buttons.
  • GET /api/search — semantic search endpoint wrapping semantic_search_notes(); supports content_type=note|task|all and limit.
  • conversation_type="mcp" — MCP conversations excluded from main chat list and retention cleanup.
  • fable-mcp/ package — standalone Python MCP server (mcp[cli], httpx); 20 tools across notes, tasks, projects, milestones, search, and chat (SSE); 34 tests passing.
  • fix: clipboard copy fallbacknavigator.clipboard requires HTTPS; added execCommand fallback for http dev environments.

Test plan

  • Run migration: alembic upgrade head
  • Generate an API key in Settings → API Keys, verify copy/download buttons work
  • Confirm bearer token auth works: curl -H "Authorization: Bearer fmcp_..." /api/notes
  • Confirm read-only key returns 403 on POST
  • Test semantic search: GET /api/search?q=...
  • Install fable-mcp and verify tools connect to instance
## Summary - **API key auth** — new `api_keys` table (migration 0027), `_check_auth` updated to accept `Authorization: Bearer fmcp_*` tokens before falling back to session. Read/write scope enforcement. Soft-delete via `revoked_at`, `last_used_at` tracking. - **Settings UI — API Keys tab** — generate, copy, revoke keys; one-time reveal with `.env` download and Claude config download buttons. - **`GET /api/search`** — semantic search endpoint wrapping `semantic_search_notes()`; supports `content_type=note|task|all` and `limit`. - **`conversation_type="mcp"`** — MCP conversations excluded from main chat list and retention cleanup. - **`fable-mcp/` package** — standalone Python MCP server (`mcp[cli]`, `httpx`); 20 tools across notes, tasks, projects, milestones, search, and chat (SSE); 34 tests passing. - **fix: clipboard copy fallback** — `navigator.clipboard` requires HTTPS; added `execCommand` fallback for http dev environments. ## Test plan - [ ] Run migration: `alembic upgrade head` - [ ] Generate an API key in Settings → API Keys, verify copy/download buttons work - [ ] Confirm bearer token auth works: `curl -H "Authorization: Bearer fmcp_..." /api/notes` - [ ] Confirm read-only key returns 403 on POST - [ ] Test semantic search: `GET /api/search?q=...` - [ ] Install fable-mcp and verify tools connect to instance
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledScribe#8