MCPHero: The Bridge Between MCP and Traditional AI Libraries
2 min read

MCPHero: The Bridge Between MCP and Traditional AI Libraries

315 words

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:

  1. Backward compatibility - You don’t have to abandon your current OpenAI or Gemini code
  2. MCP ecosystem - You can leverage existing MCP servers
  3. Flexibility - Supports both OpenAI and Google Gemini
  4. 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

Latest Posts

8 min

1556 words

If you’ve been using Claude Code with Auto Memory enabled for a while, you’ve probably noticed that after several sessions, Claude’s notes about your project start accumulating contradictions. Entries saying “yesterday we decided to use Redis” without specifying which day “yesterday” was. Debugging notes referencing files that no longer exist. Three different entries about the same build quirk. What started as a useful notebook becomes noise.

Anthropic has just released Auto Dream, a feature that does exactly what its name suggests: it consolidates Claude Code’s memory the way the human brain consolidates memories during REM sleep.

5 min

1020 words

I have been using Claude Code daily for months, and there is one configuration that has completely changed how it works with my code. It is not a new plugin, a more powerful model, or a magic prompt. It is something that has existed since 2016 and that most developers use without knowing it every time they open VS Code: the Language Server Protocol (LSP).

Karan Bansal published an excellent article explaining in detail how to enable LSP in Claude Code and why it matters. After trying it, I can confirm the difference is real and significant.

3 min

591 words

Greg Brockman, President and Co-Founder of OpenAI, recently published a thread that perfectly describes the moment we’re living in software development. According to him, we’re witnessing a genuine renaissance in software development, driven by AI tools that have improved exponentially since December.

The qualitative leap

The most striking part of Brockman’s thread is how they describe the internal change at OpenAI: engineers who previously used Codex for unit tests now see the tool writing practically all code and handling a large portion of operations and debugging. This isn’t an incremental improvement, it’s a paradigm shift.

9 min

1747 words

If you’re using tools like Claude Code, GitHub Copilot Workspace, or similar, you’ve probably noticed there’s technical jargon that goes beyond simply “chatting with AI”. I’m talking about terms like rules, commands, skills, MCP, and hooks.

These concepts are the architecture that makes AI agents truly useful for software development. They’re not just fancy marketing words — each one serves a specific function in how the agent works.

Let’s break them down one by one in a clear way.

6 min

1205 words

After my previous article about agent-centric programming, I’ve been researching more advanced techniques for using Claude Code really productively. As a programmer with 30 years of experience, I’ve seen many promising tools that ultimately didn’t deliver on their promises. But Claude Code, when used correctly, is becoming a real game-changer.

Beyond the basics: The difference between playing and working seriously

One thing is using Claude Code for experiments or personal projects, and another very different thing is integrating it into a professional workflow. For serious projects, you need a different approach:

6 min

1097 words

Two protocols, two philosophies

In recent months, two protocols have emerged that will change how we build AI systems: Agent2Agent Protocol (A2A) from Google and Model Context Protocol (MCP) from Anthropic. But here’s the thing: they don’t compete with each other.

In fact, after analyzing both for weeks, I’ve realized that understanding the difference between A2A and MCP is crucial for anyone building AI systems beyond simple chatbots.

The key lies in one question: Are you connecting an AI with tools, or are you coordinating multiple intelligences?