Announcing MCPHero Python Package - map MCP tools to OpenAI tools

Published: (January 31, 2026 at 03:53 PM EST)
1 min read
Source: Dev.to

Source: Dev.to

mcphero: Use MCP servers with native OpenAI clients

I released a small Python package that maps MCP servers to native OpenAI clients.

  • PyPI:
  • GitHub:

The problem

  • Native openai / gemini clients don’t support MCP.
  • Because of that, many projects don’t use MCP at all.
  • Or projects have to write a lot of custom mapping code.

What mcphero does

  • Converts MCP tools into OpenAI‑compatible tools/functions.
  • Sends LLM tool‑call results back to the MCP server for execution.
  • Returns updated message history.
  • Provides two‑way mapping in ~2 lines of code.

Minimal example

adapter = MCPToolAdapterOpenAI(
    "https://api.mcphero.app/mcp/your-server-id/mcp"
)
client = OpenAI()

tools = await adapter.get_tool_definitions()

response = client.chat.completions.create(
    model="gpt-5",
    messages=[{"role": "user", "content": "What's the weather in London?"}],
    tools=tools,
)

tool_calls = response.choices[0].message
result = await adapter.process_tool_calls(tool_calls)
  • Without get_tool_definitions(), MCP tools can’t be wired into the OpenAI tools argument.
  • Without process_tool_calls(), OpenAI tool_calls can’t be wired into the MCP server.

Feedback is welcome.

If you are looking for a managed solution for MCP servers, try mcphero.app – AI‑generated MCP servers built for developers.

Back to Blog

Related posts

Read more »

Claude Code Custom Agent 설계 여정: Agent 중심에서 Task 중심으로

들어가며 Design Doc 작성을 자동화하고 싶었다. 디자인 시안을 확인하고, 기획서를 읽고, 코드베이스를 파악해서 초안을 뽑아주는 것이 /design-doc Command의 목표였다. Command는 금방 만들었지만, 그 다음 단계인 Custom Agent 설계가 문제였다. 두 번...