Skip to main content
Glama

Genkit MCP

Official
by firebase
// Copyright 2024 Google LLC // SPDX-License-Identifier: Apache-2.0 package core // Middleware is a function that wraps an action execution, similar to HTTP middleware. // It can modify the input, output, and context, or perform side effects. type Middleware[In, Out, Stream any] = func(StreamingFunc[In, Out, Stream]) StreamingFunc[In, Out, Stream] // Middlewares returns an array of middlewares that are passes in as an argument. // core.Middlewares(apple, banana) is identical to []core.Middleware[InputType, OutputType]{apple, banana} func Middlewares[In, Out, Stream any](ms ...Middleware[In, Out, Stream]) []Middleware[In, Out, Stream] { return ms } // ChainMiddleware creates a new Middleware that applies a sequence of // Middlewares, so that they execute in the given order when handling action // request. // In other words, ChainMiddleware(m1, m2)(handler) = m1(m2(handler)) func ChainMiddleware[In, Out, Stream any](middlewares ...Middleware[In, Out, Stream]) Middleware[In, Out, Stream] { return func(h StreamingFunc[In, Out, Stream]) StreamingFunc[In, Out, Stream] { for i := range middlewares { h = middlewares[len(middlewares)-1-i](h) } return h } }

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