Skip to main content
The Serve module enables developers to expose components built with the BeeAI Framework through a server to external clients. Out of the box, we provide implementations for prominent protocols such as A2A and MCP, allowing you to quickly serve existing functionalities. You can also create your own custom adapter if needed.
Location within the framework: beeai_framework/serve.

Supported Providers

The following table lists the currently supported providers:
Click on the provider name to see a dedicate page how to use it.

How it works

Once you initiate the appropriate server class (eg: AgentStackServer, OpenAIServer, …) you can do the following.
  • Register a new member (register method).
  • Deregister an existing member (deregister method).
  • List existing members (members property).
  • Run the server (serve method / aserve method).
You can typically register one of the followings: If the given instance is not supported, the register method will raise an exception. Nevertheless, you can easily register a custom factory to make it supported.

Register a custom factory

If the given server doesn’t support (or you just want to override the conversion is done) you can register a custom factory function which takes the instance of a given type and converts it into an instance that the server knows how to work with. The following example showcases how we can add a support for PromptTemplate class (which exists in BeeAI Framework) so that it gets exposed as a Prompt in the MCP Server.
Python

Examples

Python

Explore usage of the Serve module in Python

TypeScript

Explore usage of the Serve module in TypeScript