Genkit

by firebase

Community Developer Tools 6k likes

The @genkit-ai/mcp plugin lets a Genkit app consume any MCP server's tools directly, or expose its own Genkit tools and prompts as an MCP server for other clients.

Install the plugin

npm i genkit @genkit-ai/mcp

Source: https://github.com/firebase/genkit/tree/main/js/plugins/mcp

About

Genkit is Firebase's open-source framework for building AI features in Node.js and Go, and its MCP plugin is the bridge between Genkit and the wider MCP ecosystem. On the consuming side, createMcpHost manages connections to multiple MCP servers at once and hands their combined tool sets to a Genkit model call, while createMcpClient does the same for a single server when you don't need the extra management overhead.

On the other side, createMcpServer takes tools and prompts you've already defined in Genkit and republishes them as a standard MCP server, so any MCP-compatible client, including Claude Desktop, VS Code, or Cursor, can call into your Genkit app the same way it would call any other MCP tool. That symmetry is the plugin's main value: the same abstractions, tools and prompts, move in either direction between Genkit and MCP without a translation layer you have to write yourself.

Key features

  • createMcpHost manages multiple MCP server connections at once for a Genkit model
  • createMcpClient handles a single MCP server connection for simpler cases
  • createMcpServer republishes existing Genkit tools/prompts as a standard MCP server
  • Works with any Genkit-supported model, including Gemini and OpenAI-compatible backends
  • Available for both the JavaScript/TypeScript and Go Genkit runtimes

Use cases

  • Giving a Genkit-based agent access to a filesystem or database MCP server without writing a custom adapter
  • Exposing an existing Genkit app's tools so Claude Desktop or another MCP client can call into it
  • Consolidating several MCP servers' tools behind one Genkit model call via createMcpHost
  • Migrating a Genkit tool-calling app toward the MCP standard for interoperability with other agent frameworks

Available tools

createMcpHost

Opens and manages connections to multiple MCP servers, exposing their combined tools and resources to a Genkit model.

createMcpClient

Connects to a single MCP server, the simpler option when you only need one integration.

createMcpServer

Wraps Genkit-defined tools and prompts as a standard MCP server for external clients to call.

Frequently asked questions

Can a Genkit app both use MCP tools and expose its own?

Yes. createMcpHost and createMcpClient consume external MCP servers, while createMcpServer separately exposes your Genkit tools and prompts to outside MCP clients. Nothing stops you doing both in the same app.

Which languages does the plugin support?

There are parallel implementations for Genkit's JavaScript/TypeScript runtime and its Go runtime, so you're not limited to one language.