Skip to content

feat: add read_github_data MCP tool for Supabase Postgres#3771

Merged
yujonglee merged 2 commits intomainfrom
devin/1770613747-supabase-read-tool
Feb 9, 2026
Merged

feat: add read_github_data MCP tool for Supabase Postgres#3771
yujonglee merged 2 commits intomainfrom
devin/1770613747-supabase-read-tool

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 9, 2026

feat: add read_github_data MCP tool for Supabase Postgres

Summary

Adds a new MCP tool to read GitHub data (issues, pull requests, comments, tags) from the hyprnote_github schema in Supabase Postgres, using sqlx. This schema is populated by the Airbyte GitHub source connector.

Changes:

  • Added sqlx (with postgres, runtime-tokio, tls-rustls, json features) as a dependency
  • Added SupabaseDbEnv config struct expecting a supabase_db_url env var
  • Updated AppState to hold a PgPool, making AppState::new() and router() async
  • New read_github_data MCP tool that queries hyprnote_github.{issues,pull_requests,comments,tags} with optional state filter, pagination (limit/offset), returning rows as JSON
  • Updated apps/ai to wire through the new config and handle the async router

Review & Testing Checklist for Human

  • supabase_db_url env var: Must be configured in all deployment environments (local .env, CI, production). Server will panic on startup if missing or if DB is unreachable (state.rs:34 uses .expect()). Consider whether a graceful fallback is preferred.
  • _airbyte_extracted_at column: All queries ORDER BY this column — verify it exists on all four Airbyte-synced tables (issues, pull_requests, comments, tags). If any table lacks it, the tool will return a runtime error.
  • state filter on non-applicable tables: The state param will be applied even to comments and tags tables (which likely lack a state column), causing a SQL error. Consider validating the filter against the selected table.
  • Test against real DB: This has only been verified to compile. Please test the MCP tool against the actual Supabase instance to confirm schema compatibility and query correctness.

Notes

  • Table name in SQL is constructed via format!() but is safe from injection since GitHubTable::as_str() only returns hardcoded string literals.
  • The count query silently returns 0 on error (unwrap_or(0)).

Link to Devin run: https://app.devin.ai/sessions/4d00ea2dde3946b09f27d0f45c0ff3b7
Requested by: @yujonglee


Open with Devin

…ithub schema)

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 9e3f5ce
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6989703b56e297000888548c

@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 9e3f5ce
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6989703ce8f36d000846180c

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Contributor Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Open in Devin Review

…amp limit/offset

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@yujonglee yujonglee merged commit d4d414f into main Feb 9, 2026
24 of 25 checks passed
@yujonglee yujonglee deleted the devin/1770613747-supabase-read-tool branch February 9, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant