Skip to main content
Glama

Genkit MCP

Official
by firebase
main.go1.34 kB
// Copyright 2025 Google LLC // SPDX-License-Identifier: Apache-2.0 // [START main] package main import ( "context" "errors" // Import Genkit and the Google AI plugin "github.com/firebase/genkit/go/ai" "github.com/firebase/genkit/go/genkit" "github.com/firebase/genkit/go/plugins/googlegenai" ) func main() { ctx := context.Background() g := genkit.Init(ctx, genkit.WithPlugins(&googlegenai.GoogleAI{}), genkit.WithPromptDir("prompts"), ) type greetingStyle struct { Style string `json:"style"` Location string `json:"location"` Name string `json:"name"` } type greeting struct { Greeting string `json:"greeting"` } // Define a simple flow that prompts an LLM to generate greetings using a // given style. genkit.DefineFlow(g, "assistantGreetingFlow", func(ctx context.Context, input greetingStyle) (string, error) { // Look up the prompt by name prompt := genkit.LookupPrompt(g, "example") if prompt == nil { return "", errors.New("assistantGreetingFlow: failed to find prompt") } // Execute the prompt with the provided input resp, err := prompt.Execute(ctx, ai.WithInput(input)) if err != nil { return "", err } var output greeting if err = resp.Output(&output); err != nil { return "", err } return output.Greeting, nil }) <-ctx.Done() } // [END main]

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/firebase/genkit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server