Skip to content

Conversation

mbleigh
Copy link
Contributor

@mbleigh mbleigh commented Aug 15, 2025

This PR does a few things:

  1. Adds a new dataconnect_compile tool that builds FDC schema/connectors and returns any errors.
  2. Adds a new mcpalpha experiment so that we can gate MCP features on a flag to keep things on master.
  3. Adds a new firebase:dataconnect:schema prompt that is only available with mcpalpha enabled.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @mbleigh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant enhancements to the Firebase Data Connect (FDC) functionality within the MCP server. It adds a new dataconnect_compile tool for validating FDC schemas and connectors, and gates new MCP features behind an mcpalpha experiment flag. Additionally, a new firebase:dataconnect:schema prompt is introduced to facilitate schema generation and updates, accessible when the mcpalpha flag is enabled.

Highlights

  • New dataconnect_compile Tool: A new tool has been added to the MCP server that allows users to compile Firebase Data Connect schemas and connectors, providing immediate feedback on any build errors.
  • Introduction of mcpalpha Experiment Flag: A new experiment flag, mcpalpha, has been implemented. This flag enables the gating of early-stage MCP features, allowing for controlled rollout and testing without impacting the main master branch.
  • New firebase:dataconnect:schema Prompt: A dedicated prompt has been added to assist with generating or updating Firebase Data Connect schemas. This prompt is conditionally available when the mcpalpha experiment flag is active.
  • Refactoring of Data Connect Utilities: Several utility files related to Data Connect (specifically converter.ts and emulator.ts) have been relocated to a new src/mcp/lib/dataconnect directory, improving code organization and maintainability.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new dataconnect_compile tool, an mcpalpha experiment, and a new firebase:dataconnect:schema prompt. The changes are well-structured and align with the PR's objectives. I've identified a few minor issues, including a duplicated debug log, an incomplete sentence in a prompt, and a typo in an error message, and have provided suggestions for fixes.

mbleigh and others added 4 commits August 15, 2025 10:30
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@mbleigh mbleigh enabled auto-merge (squash) August 15, 2025 18:22
src/mcp/index.ts Outdated
@@ -227,6 +227,10 @@ export class FirebaseMcpServer {
}

get availablePrompts(): ServerPrompt[] {
this.log(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

"Use this to compile Firebase Data Connect schema, operations, and/or connectors and check for build errors.",
inputSchema: z.object({
error_filter: z
.enum(["all", "schema", "connectors"])
Copy link
Contributor

Choose a reason for hiding this comment

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

"connectors" optional doesn't make sense.

If schema is invalid, connectors will return no error, which is mis-leading. This should be either "schema" or "all".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll just drop this for now, it can just see all the errors at once.

return (
errors
?.filter((e) => {
const isOperationError = ["query", "mutation"].includes(e.path?.[0] as string);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not all clients follow the query & mutation convention. Only our CLI init template does.

We should probably not support errorFilter for now.

I can find a correct way to do this later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I believe this will always be correct -- the path is like ["query", "users", "someField"] because it's mapping query { users { someField }}. I believe it will always work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I see. This is the GQL path error.

I got it mixed up with the file name.

},
],
annotations: {
title: "Deploy to Firebase",
Copy link
Contributor

@fredzqm fredzqm Aug 18, 2025

Choose a reason for hiding this comment

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

"title" looks off.

I am wondering if it makes more sense to rely on the GiF backend more, which is known to have good accuracy.

I have concerns over lack of eval & performance visibility in local MCP prompts. It gets worse if this tool shadows the dataconnect_generate_schema tool.

Copy link
Contributor

Choose a reason for hiding this comment

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

[not blocking] Feel free to check this in.

I am trying to figure out where that line should be. Maybe it's edit vs create.

Use GiF API to generate the initial schema and new operations.

Use the local prompts to iterate and edit them. Cursor probably has more local context.

Without evaluation, it's really a pain to figure how the experience is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think our visibility into GiF is all that much better, though I'd like us to come up with an informal eval system utilizing Gemini CLI for the MCP server generally. This is currently flagged off in the "mcpalpha" experiment so I'm not too worried about it one way or the other for now.

@github-project-automation github-project-automation bot moved this from Approved [PR] to Changes Requested [PR] in [Cloud] Extensions + Functions Aug 18, 2025

==== TASK INSTRUCTIONS ====

1. If Data Connect is marked as \`<UNCONFIGURED>\`, first run the \`firebase_init\` tool with \`{dataconnect: {}}\` arguments to initialize it.
Copy link
Contributor

Choose a reason for hiding this comment

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

NOTE: for myself. We can pass in appIdea here to let GiF generates the schema and connectors for us

},
],
annotations: {
title: "Deploy to Firebase",
Copy link
Contributor

Choose a reason for hiding this comment

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

[not blocking] Feel free to check this in.

I am trying to figure out where that line should be. Maybe it's edit vs create.

Use GiF API to generate the initial schema and new operations.

Use the local prompts to iterate and edit them. Cursor probably has more local context.

Without evaluation, it's really a pain to figure how the experience is.

Copy link
Contributor

@fredzqm fredzqm left a comment

Choose a reason for hiding this comment

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

Thank you Michael!! Love it!!! 🔥 🔥 🔥

import { load, readFirebaseJson } from "./load";
import type { Config } from "../config";

export function loadAll(projectId: string, config: Config) {
Copy link
Contributor

Choose a reason for hiding this comment

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

return (
errors
?.filter((e) => {
const isOperationError = ["query", "mutation"].includes(e.path?.[0] as string);
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I see. This is the GQL path error.

I got it mixed up with the file name.

@github-project-automation github-project-automation bot moved this from Changes Requested [PR] to Approved [PR] in [Cloud] Extensions + Functions Aug 28, 2025
@mbleigh mbleigh merged commit 2bde655 into master Aug 28, 2025
48 checks passed
@mbleigh mbleigh deleted the mb/mcp/fdc-compile branch August 28, 2025 20:54
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Aug 28, 2025
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.

3 participants