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:| Name | Installation |
|---|---|
| A2A | pip install beeai-framework[a2a] |
| Agent Stack | pip install beeai-framework[agentstack] |
| MCP | pip install beeai-framework[mcp] |
| IBM watsonx Orchestrate | pip install beeai-framework |
| OpenAI Chat Completion API | pip install beeai-framework |
| OpenAI Responses API | pip install beeai-framework |
How it works
Once you initiate the appropriate server class (eg:AgentStackServer, OpenAIServer, …) you can do the following.
- Register a new member (
registermethod). - Deregister an existing member (
deregistermethod). - List existing members (
membersproperty). - Run the server (
servemethod /aservemethod).
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 forPromptTemplate class (which exists in BeeAI Framework) so that it gets exposed as a Prompt in the MCP Server.
Python