[integrations] Enhanced MCP server with alpha tool suite#6
[integrations] Enhanced MCP server with alpha tool suite#6alanshurafa wants to merge 315 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7633681f7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!response.ok) { | ||
| throw new Error(`OpenRouter embedding failed (${response.status}): ${await response.text()}`); | ||
| } |
There was a problem hiding this comment.
Use OpenAI fallback when OpenRouter embeddings fail
The embedText helper currently throws as soon as OpenRouter returns a non-2xx response, which prevents execution from ever reaching the documented OpenAI fallback branch even when OPENAI_API_KEY is configured. In environments with both providers enabled, any transient OpenRouter failure will hard-fail embedding-dependent tools (search_thoughts semantic mode, capture_thought, update_thought) instead of degrading gracefully to OpenAI.
Useful? React with 👍 / 👎.
| supabase: { from: (name: string) => { select: (cols: string) => { limit: (n: number) => Promise<{ error: unknown }> } } }, | ||
| tableName: string, | ||
| ): Promise<boolean> { | ||
| const { error } = await supabase.from(tableName).select("id").limit(0); |
There was a problem hiding this comment.
Make table existence checks column-agnostic
The schema guard utility claims to test whether a relation exists, but it probes by selecting id, which incorrectly returns false for any valid table/view that does not expose an id column. Because this helper is used to gate optional tools, a deployed schema can be present yet reported unavailable purely due to column shape. The existence check should not assume a specific column name.
Useful? React with 👍 / 👎.
14515a9 to
7e2598b
Compare
…h current generator
…ch provenance-chains contract
…test_path + traverse_graph) The previous recursive-CTE implementations enumerated every path to every reachable node, which exploded on densely connected graphs (a hub with 1k+ neighbours at depth 2 produced tens of thousands of rows) and depended on the per-path ANY(path) check to break cycles. On a cyclic graph that exceeded the statement_timeout the planner never actually pruned the walk. Replace both functions with iterative plpgsql BFS: - Global seen-set (UUID[]) so each node is visited at most once - JSONB parent-pointer map records the first (parent, relation) that reached each node; BFS's "first discovery wins" invariant is enforced with DISTINCT ON (next_id) - Shared reconstruct_bfs_path() helper walks the parent map end -> start with a safety guard against malformed maps - find_shortest_path keeps bidirectional edge traversal; traverse_graph keeps outgoing-only with optional relationship_type filter - Signatures, argument order, RETURNS shape, and language (plpgsql, no SECURITY DEFINER) match the original so this is a body-only rewrite - All queries scope by p_user_id to preserve the multi-tenant isolation the edge function relies on (service_role bypasses RLS) Update the README's "How It Works" section and function table to describe the new implementation so the docs don't contradict the SQL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Standalone Node script that exercises traverse_graph and find_shortest_path against a live Supabase project with ob-graph installed. Picks an arbitrary edge, calls both RPCs at depth 1/2/6, and prints row counts + timings so maintainers can confirm the iterative-BFS rewrite stays inside the statement_timeout and returns sensible shapes before shipping. Reads SUPABASE_PROJECT_REF, SUPABASE_SERVICE_ROLE_KEY, and OB_GRAPH_USER_ID from recipes/ob-graph/.env.local so the service-role key never lands in repo history. Sets process.exitCode=1 on any RPC failure so CI or shell chaining picks up a non-zero exit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rsive CTE (preserve contract)
…directional shortest-path
…gth === 2 to protect bidirectional shortest-path
…allel edges produce 3 D-rows
…shortest_path + traverse_graph
…match metadata 1.0.1
…-agent-memory feat(integrations): add hermes-agent-memory native provider for OB1
…lanshurafa/smart-ingest [integrations] Smart ingest Edge Function
…wicegood/dashboard-open-next-cloudflare [dashboards] open-brain-dashboard-next: add Cloudflare Workers deploy support
…lanshurafa/enhanced-thoughts [schemas] Enhanced thoughts columns and utility RPCs
…rain-health-monitoring
…rain-health-monitoring
…lanshurafa/brain-backup [recipes] Brain backup and export
…rain-health-monitoring
…lanshurafa/brain-health-monitoring [recipes] Brain health monitoring views
…ns1002/per-request-mcp [integrations] Fix per-request McpServer instantiation for stable MCP connections
…xcfi-scott/delete-thought-mcp [integrations] delete_thought MCP
…er/typed-reasoning-edges-comment-syntax-fix [schemas] Fix typed-reasoning-edges COMMENT ON syntax error
…uto-capture-claude-code
…lanshurafa/auto-capture-claude-code [skills] Auto-capture Claude Code adapter
Document that MCP_ACCESS_KEY should be high-entropy (single shared secret, single-tenant) and that the wildcard CORS is deliberate and safe given header-based auth. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
integrations/enhanced-mcp/expanding the tool surface from 4 to 14 toolsgraph_search,entity_detail,ops_capture_status,ops_source_monitor) gracefully degrade when optional schemas (smart-ingest, knowledge-graph) are absentserver/is untouched — this deploys as a second remote connectorDependencies
schemas/enhanced-thoughts(PR [schemas] Enhanced thoughts columns and utility RPCs #1) — adds columns and RPCs used by all core toolsschemas/smart-ingest(PR [schemas] Smart ingest pipeline tables #4) — unlocksops_capture_statustoolschemas/knowledge-graph(PR [schemas] Knowledge graph tables and extraction trigger #5) — unlocksgraph_search,entity_detail,ops_source_monitortoolsFiles
Tool Surface (14 tools)
Test Plan
.github/metadata.schema.json../../docs/01-getting-started.md,../../docs/05-tool-audit.md)Generated with Claude Code