Technology Sharing | How to quickly build OpenAI-compatible Agent services using the Agno framework

Written by
Silas Grey
Updated on:July-02nd-2025
Recommendation

Explore how the Agno framework simplifies the development process of OpenAI-compatible agent services.
Core content:
1. Implement OpenAI API-compatible tool calls without modifying the client
2. The three-tier architecture design of the project and its key technical point analysis
3. Quick experience guide and scenario extension application to demonstrate the unique advantages of the Agno framework

Yang Fangxian
Founder of 53AI/Most Valuable Expert of Tencent Cloud (TVP)

Today I will share with you a technical demo, showing how to quickly build an OpenAI-compatible API service based on the Agno framework , and implement functional expansion through MCP tool calls . The greatest value of this solution is that the client does not need to be modified in any way , as long as it is compatible with the OpenAI API, it can directly call the configured tool capabilities!

https://github.com/lemonhall/agno_mcp_openai_demo

Cherry studio configuration

The effect of operation

Functional description of mcp service


Note: caldav-mcp has not been released yet due to functional testing.

Core Values ​​?

In traditional Agent development, the client needs to:

  1. Understand tool calling conventions
  2. Handling complex tool registration processes
  3. Implement tool calling and result analysis

The solution demonstrated by this project: ✅ The client only needs to call the standard OpenAI API ✅ All tool call logic is encapsulated on the server ✅ No need for the client to mount any MCP tools ✅ Maintain full API compatibility

Technical implementation analysis?

1. Architecture Design

The project adopts a three-tier architecture:

  1. API compatibility layer : fully simulate the OpenAI Chat Completions interface
  2. Agent core layer : Agent implementation based on Agno framework
  3. Tool service layer : integrating MCP tool services (taking CalDAV as an example)
Client → OpenAI compatible API → Agno Agent → MCP tool service

2. Key technical points

  • OpenAI API fully compatible : support synchronous/streaming responses
  • Transparent tool call : the client does not need to be aware of the existence of the tool
  • Flexible tool configuration : unified management tool registration on the server side

3. Code Structure

.
├── simple_openai_agent_api.py   # Main service entry
└── agno_openai_adapter.py       # OpenAI adapter layer implementation

Quick experience ?

  1. Install Dependencies
pip install fastapi uvicorn agno mcp
  1. Start the service
python simple_openai_agent_api.py
  1. Calling example (using any OpenAI compatible client)
response = client.chat.completions.create(
    model = "agno-agent" ,
    messages=[{ "role""user""content""Check my schedule" }]
)

Scene expansion?

Although the demo uses calendar management as an example (because this scenario is simple and easy to understand), this solution is applicable to:

  • Database query tools
  • E-commerce order management
  • Internal system integration
  • Any scenario that requires tool calling

Design concept ?

  1. Separation of concerns : The client only cares about the business dialogue, not the tool implementation
  2. Smooth migration : Existing OpenAI applications can be migrated seamlessly
  3. Flexible expansion : The server can dynamically increase or decrease tool capabilities

Conclusion

This demo demonstrates the unique advantages of the Agno framework in building enterprise-level Agent services. Through the OpenAI compatibility layer, we can:

  1. Greatly reduce client access costs
  2. Maintain API stability and compatibility
  3. Flexible expansion of backend tool capabilities