refactor(grain): rewrite API integration based on official Grain docs#248
Merged
JonasJesus42 merged 2 commits intomainfrom Feb 25, 2026
Merged
refactor(grain): rewrite API integration based on official Grain docs#248JonasJesus42 merged 2 commits intomainfrom
JonasJesus42 merged 2 commits intomainfrom
Conversation
- Fix webhook creation to use correct endpoint (POST /_/public-api/hooks) with version:2 and view_id (fetched from GET /_/public-api/views) - Replace PostgreSQL binding with direct Supabase client integration - Remove OAuth, use MESH_REQUEST_CONTEXT.authorization for API key - Add webhook enrichment: fetch full recording details (participants, owners, tags, intelligence notes) from Grain API before indexing - Implement multi-field search across title, participants, and AI notes - Add dedicated transcript and summary tools with proper API endpoints - Handle Grain reachability test on webhook URL creation - Update all TypeScript types to match official Grain Personal API - Rewrite README in English with correct setup instructions Co-authored-by: Cursor <cursoragent@cursor.com>
🚀 Preview Deployments Ready!Your changes have been deployed to preview environments: 📦
|
Contributor
There was a problem hiding this comment.
3 issues found across 20 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="grain/server/main.ts">
<violation number="1" location="grain/server/main.ts:41">
P2: Honor DEVELOPMENT_WEBHOOK_URL when DEVELOPMENT_MODE=true so the documented dev override works and avoids rebuilding an already-complete webhook URL.</violation>
</file>
<file name="grain/server/tools/search-indexed-recordings.ts">
<violation number="1" location="grain/server/tools/search-indexed-recordings.ts:69">
P2: Treat whitespace-only queries as empty so the guard blocks unfiltered searches. Otherwise a query like " " bypasses the guard but is ignored by the DB filter, returning all recordings.</violation>
</file>
<file name="grain/server/lib/grain-client.ts">
<violation number="1" location="grain/server/lib/grain-client.ts:133">
P2: `include_calendar_id` is defined in `ListRecordingsParams` but never serialized into query params, so callers can’t request calendar IDs from the API.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…serialize include_calendar_id - Use DEVELOPMENT_WEBHOOK_URL env override when DEVELOPMENT_MODE=true - Treat whitespace-only search queries as empty to prevent unfiltered DB scans - Serialize include_calendar_id param in listRecordings API call Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Rewrote the Grain MCP against the official Personal API. Fixes webhook setup, adds Supabase indexing and transcript/summary tools, switches auth to the Mesh API key, and includes small fixes for dev webhook override and search input handling.
New Features
Migration
Written for commit 5356620. Summary will update on new commits.