Commit graph

13 commits

Author SHA1 Message Date
CREDO23
704d1bf18f refactor(mcp): per-connector cache refresh on lifecycle events
Collapse the invalidate + warmup pair into a single
refresh_mcp_tools_cache_for_connector(connector_id, search_space_id)
helper and scope live discovery to the one connector that changed
instead of the whole search space.

- new mcp_tool.discover_single_mcp_connector: load one connector,
  refresh OAuth if needed, force live MCP discovery so its cached_tools
  row is rewritten; returned wrappers are discarded since the in-process
  LRU is rebuilt lazily on the next user query
- mcp_tools_cache.refresh_mcp_tools_cache_for_connector: synchronously
  evicts the per-space LRU (LRU keys cannot scope finer) and schedules
  the per-connector prefetch via loop.create_task
- routes (OAuth callback, MCP POST, MCP PUT) collapse their two
  back-to-back calls into a single refresh call; DELETE handlers keep
  using bare invalidate_mcp_tools_cache (nothing to prefetch)

No new automated tests: the new functions are I/O glue (DB + network)
where mocked unit tests would test implementation rather than behavior.
The existing 9 unit tests for the cached_tools data shape are unchanged.
2026-05-20 17:43:27 +02:00
DESKTOP-RTLN3BA\$punk
8d50f90060 chore: linting
Some checks failed
Obsidian Plugin Lint / lint (push) Has been cancelled
2026-04-27 14:04:50 -07:00
CREDO23
0eae96bffb fix: harden MCP OAuth and connector edge cases 2026-04-22 20:54:42 +02:00
CREDO23
a1d03da896 fix: encrypt tokens at rest, invalidate cache on refresh, clean up logging 2026-04-22 20:08:19 +02:00
CREDO23
9eb54bc4af add account metadata discovery and connected_accounts tool 2026-04-22 18:57:26 +02:00
CREDO23
dfa40b8801 fix MCP OAuth for all 5 services, add MCP connector edit view 2026-04-22 10:50:43 +02:00
CREDO23
dde1948a5c fix Slack MCP OAuth: v2 endpoint, user_scope param, nested token extraction 2026-04-22 10:06:12 +02:00
CREDO23
970f62278b revert scope_param, use standard scope for Slack v2_user endpoint 2026-04-22 09:56:18 +02:00
CREDO23
820326e3ee use user_scope param for Slack OAuth 2026-04-22 09:54:16 +02:00
CREDO23
ea3508cb25 use native connector types for MCP OAuth, restore original UI 2026-04-22 08:57:28 +02:00
CREDO23
940889c291 fix open redirect, error leaking, unused imports, state validation 2026-04-22 08:42:38 +02:00
CREDO23
8b8c9b1f5d add Slack and Airtable MCP OAuth support 2026-04-21 21:38:24 +02:00
CREDO23
45867e5c56 add generic MCP OAuth route with DCR + PKCE 2026-04-21 21:19:32 +02:00