Google Genkit 2 0 Firebase Ai Developer Guide 2026
Date: 2026-05-27
Content track: sandbox-poc
Slug: google-genkit-2-0-firebase-ai-developer-guide-2026
Goal
Verify that the current Genkit TypeScript packages can expose a typed local tool through the Genkit MCP plugin and that a real MCP client can discover and call that tool without API keys or Google Cloud credentials.
The backlog topic mentions Cloud Run, but this run intentionally stayed local. Cloud Run deployment requires a Google Cloud project, billing, credentials, and Secret Manager setup. No Cloud Run deployment or Cloud Trace screenshot was produced in this sandbox.
Environment
Host: macOS Darwin 24.6.0 arm64
Node.js: v25.9.0
npm: 11.12.1
Sandbox: /tmp/effloow-genkit-mcp-poc
Secrets: none
Date: 2026-05-27 Asia/Tokyo
Version checks
npm view genkit version
npm view @genkit-ai/mcp version
npm view @modelcontextprotocol/sdk version
Output:
genkit: 1.35.0
@genkit-ai/mcp: 1.35.0
@modelcontextprotocol/sdk: 1.29.0
Dist tags checked:
genkit latest: 1.35.0
genkit next: 1.33.0-rc.1
@genkit-ai/mcp latest: 1.35.0
@genkit-ai/mcp next: 1.33.0-rc.1
Commands run
mkdir -p /tmp/effloow-genkit-mcp-poc/src
cd /tmp/effloow-genkit-mcp-poc
npm init -y
npm install genkit@1.35.0 @genkit-ai/mcp@1.35.0 @modelcontextprotocol/sdk@1.29.0 typescript@latest tsx@latest
npm run build
npx tsx src/test-client.ts
npm audit --omit=dev --audit-level=high
Install issues and recovery
First install attempt failed because the local npm cache had a missing cached object:
npm error code ENOENT
npm error enoent Invalid response body while trying to fetch https://registry.npmjs.org/typescript
Recovery command:
npm cache verify
Output:
Cache verified and compressed (~/.npm/_cacache)
Content verified: 25318 (10318517489 bytes)
Content garbage-collected: 3869 (3381348125 bytes)
Index entries: 32333
Finished in 32.699s
Second install attempt with @modelcontextprotocol/sdk@1.21.2 failed because @genkit-ai/mcp@1.35.0 requires @modelcontextprotocol/sdk@^1.29.0:
npm error ERESOLVE unable to resolve dependency tree
peer @modelcontextprotocol/sdk@"^1.29.0" from @genkit-ai/mcp@1.35.0
Installing with @modelcontextprotocol/sdk@1.29.0 succeeded:
added 490 packages, and audited 491 packages in 15s
23 vulnerabilities (16 moderate, 7 high)
Minimal Genkit MCP server
The sandbox defined one Genkit tool and one Genkit prompt, then exposed the Genkit instance with createMcpServer.
import { createMcpServer } from '@genkit-ai/mcp';
import { genkit, z } from 'genkit/beta';
const ai = genkit({});
ai.defineTool(
{
name: 'estimate_prompt_window',
description:
'Estimate prompt size and suggest whether the input should be summarized before sending to an LLM.',
inputSchema: z.object({
text: z.string(),
maxCharacters: z.number().int().positive().default(1200),
}),
outputSchema: z.object({
characters: z.number(),
words: z.number(),
withinLimit: z.boolean(),
recommendation: z.string(),
}),
},
async ({ text, maxCharacters }) => {
const words = text.trim().length === 0 ? 0 : text.trim().split(/\s+/).length;
const withinLimit = text.length <= maxCharacters;
return {
characters: text.length,
words,
withinLimit,
recommendation: withinLimit
? 'Send directly.'
: 'Summarize or chunk before sending to the model.',
};
},
);
const server = createMcpServer(ai, {
name: 'effloow-genkit-mcp-poc',
version: '0.1.0',
});
server.start();
Build result
npm run build
Output:
> effloow-genkit-mcp-poc@1.0.0 build
> tsc --noEmit
Exit code: 0.
Installed package check:
effloow-genkit-mcp-poc@1.0.0 /private/tmp/effloow-genkit-mcp-poc
├── @genkit-ai/mcp@1.35.0
├── @modelcontextprotocol/sdk@1.29.0
└── genkit@1.35.0
MCP client test
The test client used @modelcontextprotocol/sdk over stdio to start the Genkit MCP server, list tools, and call estimate_prompt_window.
npx tsx src/test-client.ts
Output:
TOOLS
[
"estimate_prompt_window"
]
CALL_RESULT
[
{
"type": "text",
"text": "{\"characters\":46,\"words\":8,\"withinLimit\":false,\"recommendation\":\"Summarize or chunk before sending to the model.\"}"
}
]
Verdict: the local Genkit MCP server worked. A real MCP client discovered the Genkit tool and executed it.
Security and dependency audit
npm audit --omit=dev --audit-level=high
Output summary:
23 vulnerabilities (16 moderate, 7 high)
High-severity findings included a Prometheus exporter crash advisory in OpenTelemetry dependencies pulled through Genkit/Google Cloud packages. npm reported no fix available for the highlighted OpenTelemetry chain at the time of the run.
This does not invalidate the local MCP PoC, but it means production teams should run their own audit, pin versions deliberately, and evaluate whether exposed telemetry endpoints exist in their deployment topology.
What worked
- Current
genkitand@genkit-ai/mcppackages installed after cache repair and correct MCP SDK peer version selection. - TypeScript strict build passed.
createMcpServerexposed a Genkit-defined tool over MCP stdio.- A real MCP SDK client listed and called the tool.
- The test required no model API key because the tool was deterministic local code.
What failed or was not tested
- Initial npm install failed due to a corrupt local npm cache object.
- Installing with
@modelcontextprotocol/sdk@1.21.2failed; Genkit MCP 1.35.0 requires^1.29.0. - Cloud Run deployment was not run.
- Genkit Monitoring and Cloud Trace were not configured or observed.
- No Gemini, Vertex AI, OpenAI, Anthropic, or other model API call was made.
- The Genkit docs call the separate Genkit MCP Server for AI-assisted development experimental; this run tested the
@genkit-ai/mcpapplication plugin path, not thegenkit mcpdeveloper-assistant server.
Limitations
This is enough evidence to say "Effloow Lab ran a local Genkit MCP sandbox PoC." It is not enough evidence to claim production Cloud Run readiness, Cloud Trace observability, model quality, latency, cost, or managed Firebase behavior.
Read the article
This note supports the public article and records what was actually checked.