dotrann1412
MCP Serverdotrann1412public

oai mcp

A Python package that enables OpenAI's Language Models to interact with Anthropic's Model Context Protocol (MCP) standard.

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
Python
Language
MIT License
License

About This Server

A Python package that enables OpenAI's Language Models to interact with Anthropic's Model Context Protocol (MCP) standard.

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

OpenAI LLM with MCP Integration

A Python package that enables OpenAI's Language Models to interact with Anthropic's Model Context Protocol (MCP) standard. This integration allows OpenAI models to use external tools and services through MCP servers.

Features

  • Seamless integration between OpenAI's chat completions and MCP servers
  • Support for multiple MCP servers simultaneously
  • Automatic tool conversion from Anthropic MCP format to OpenAI's toolcall format
  • Asynchronous execution of tools and completions

Installation

pip install git+https://github.com/dotrann1412/oai-mcp

Quick Demo

Here's a simple example that demonstrates how to use the package with MCP servers:

import oai_mcp
import asyncio
import openai 
from mcp import StdioServerParameters
import os

async def main():
    client = openai.AsyncOpenAI()
    
    # Create storage directory
    os.makedirs("storage", exist_ok=True)
    
    # Configure MCP servers
    mcp_servers = [
        # IP Info server
        StdioServerParameters( 
            command="mcp-server-ipinfo",
        ),
        
        # File System API server
        StdioServerParameters( 
            command="mcp-fsapi",
            env={
                "DIRECTORY": "storage"
            }
        ),
    ]

    # Get chat completion with MCP integration
    completion = await oai_mcp.get_chat_completion_with_mcp(
        messages=[
            {
                "role": "user",
                "content": "Inspect my current IP address and write the result to ip.txt"
            }
        ],
        client=client,
        mcp_servers=mcp_servers
    )

    print(completion.choices[0].message.content)
    # the file ip.txt should contains something!

if __name__ == "__main__":
    asyncio.run(main())

Prerequisites for the Demo

  1. Install the IP Info MCP server:
pip install git+https://github.com/briandconnelly/mcp-server-ipinfo
  1. Install the File System API MCP server:
cd mcps/fsapi && pip install . && cd -

License

This project is open source and available under the MIT License.

Quick Start

1

Clone the repository

git clone https://github.com/dotrann1412/oai-mcp
2

Install dependencies

cd oai-mcp
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerdotrann1412
Repooai-mcp
LanguagePython
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation