Lately I’ve been closely following everything around the MCP protocol (Model Context Protocol), and recently I found a project that makes a lot of sense: MCPHero.
The reality is that although MCP is taking off, many “traditional” AI libraries like openai or google-genai still don’t have native MCP support. They only support tool/function calls. MCPHero comes to solve exactly this: make a bridge between MCP servers and these libraries.
What is MCPHero?
MCPHero is a Python library that lets you use MCP servers as tools/functions in native AI libraries. Basically, it lets you connect to any MCP server and use its tools as if they were native OpenAI or Google Gemini tools.
How It Works: Two Main Flows
1. list_tools - Get Definitions
tools = await adapter.get_tool_definitions()
MCPHero calls the MCP server via HTTP, gets tool definitions, and maps them to the AI library’s format.
2. process_tool_calls - Execute Calls
tool_results = await adapter.process_tool_calls(tool_calls)
When the AI decides to use a tool, MCPHero intercepts those calls, executes them on the MCP server, and returns results in the expected format.
Quick Example with OpenAI
import asyncio
from openai import OpenAI
from mcphero.adapters.openai import MCPToolAdapterOpenAI
async def main():
adapter = MCPToolAdapterOpenAI("https://api.mcphero.app/mcp/your-server-id")
client = OpenAI()
tools = await adapter.get_tool_definitions()
messages = [{"role": "user", "content": "What's the weather in London?"}]
response = client.chat.completions.create(
model="gpt-4o",
messages=messages,
tools=tools,
)
if response.choices[0].message.tool_calls:
tool_results = await adapter.process_tool_calls(
response.choices[0].message.tool_calls
)
# Continue conversation...
asyncio.run(main())
Why It Interests Me
I have several reasons for keeping MCPHero on my radar:
- Backward compatibility - You don’t have to abandon your current OpenAI or Gemini code
- MCP ecosystem - You can leverage existing MCP servers
- Flexibility - Supports both OpenAI and Google Gemini
- Pure Python - Easy to integrate into existing projects
References
MCPHero is an interesting tool for those who want to leverage the MCP ecosystem without abandoning their existing AI libraries.













Comments