MCP Server with OpenAI Integration
Uses Cloudflare Tunnel to expose the local MCP server publicly, enabling external API access and webhook integration for automated service communication
Enables automatic function calling integration with OpenAI's API, allowing the MCP server to respond to OpenAI requests through webhooks and Cloudflare tunnels for seamless AI-powered interactions
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Server with OpenAI Integrationwhat's the weather like in Tokyo right now?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server with OpenAI Integration
Este proyecto demuestra cómo crear un servidor MCP (Model Context Protocol) personalizado con una herramienta de clima e integrarlo con OpenAI usando Cloudflare Tunnel.
🚀 Características
Servidor MCP personalizado con herramienta de clima
Integración automática con OpenAI usando tu propio código
Túnel de Cloudflare para exposición pública
TypeScript completamente tipado
Function calling automático sin intervención manual
Related MCP server: Python Weather MCP Server
📁 Estructura del Proyecto
mcp-server-openai-sdk/
├── src/
│ ├── index.ts # Servidor MCP principal
│ ├── webhook-server.ts # Servidor webhook para OpenAI
│ └── test-method2.ts # Test de integración automática
├── package.json # Dependencias y scripts
├── tsconfig.json # Configuración TypeScript
├── .env # Variables de entorno (crear)
└── README.md # Este archivo🛠️ Instalación
Instalar dependencias:
npm installConfigurar variables de entorno:
# Crear archivo .env echo "OPENAI_API_KEY=tu-api-key-aqui" > .envCompilar el proyecto:
npm run build
🚀 Uso
Paso 1: Iniciar el servidor webhook
npm run webhookPaso 2: Crear túnel de Cloudflare
En otra terminal:
cloudflared tunnel --url http://localhost:3000Paso 3: Actualizar la URL del túnel
Edita src/test-method2.ts y actualiza la URL:
const webhookUrl = "https://tu-nueva-url.trycloudflare.com/webhook/weather";Paso 4: Probar la integración
npm run test🎯 Cómo Funciona
Flujo Automático (Método 2)
Usuario pregunta: "¿Cuál es el clima en Bogotá?"
OpenAI detecta: Necesita información del clima
Tu código llama automáticamente: Tu webhook de Cloudflare
Tu MCP server responde: Con datos del clima
Tu código envía: La respuesta de vuelta a OpenAI
OpenAI presenta: La respuesta final naturalmente
Ejemplo de Salida
👤 Usuario: ¿Cuál es el clima en Bogotá?
🔧 Paso 1: OpenAI detecta que necesita información del clima
✅ OpenAI quiere llamar la función get_weather
🔄 Paso 2: Tu código llama automáticamente tu webhook
📋 Argumentos: { "city": "Bogotá" }
✅ Paso 3: Tu MCP server responde: Weather in Bogotá: 15°C, cloudy
🔄 Paso 4: Tu código envía la respuesta de vuelta a OpenAI
🤖 Paso 5: OpenAI presenta la respuesta final:
El clima en Bogotá es de 15°C, nublado.🔧 Scripts Disponibles
npm run build- Compilar el proyectonpm run webhook- Iniciar servidor webhooknpm run test- Probar integración automáticanpm run dev- Modo desarrollo
🎯 Ventajas de esta Integración
✅ Completamente automático - No necesitas intervención manual
✅ Tu código controla todo - Manejas la comunicación
✅ Escalable - Puedes agregar más herramientas fácilmente
✅ Producción lista - Listo para usar en aplicaciones reales
🔍 Archivos Esenciales
src/index.ts- Servidor MCP con herramienta de climasrc/webhook-server.ts- Servidor webhook para OpenAIsrc/test-method2.ts- Test de integración automática
📝 Notas
El servidor webhook debe estar corriendo en puerto 3000
El túnel de Cloudflare debe estar activo
La URL del túnel debe actualizarse en el script de test
Esta integración funciona completamente automática sin intervención manual
🎉 ¡Listo!
Tu servidor MCP personalizado está completamente integrado con OpenAI y funcionando automáticamente. Puedes hacer preguntas sobre el clima y obtener respuestas naturales sin intervención manual.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- Alicense-qualityDmaintenanceA server that integrates the MCP library with OpenAI's API, allowing users to interact with various tools, such as the weather tool, through natural language queries.Last updatedMIT
- AlicenseBqualityDmaintenanceEnables AI agents to fetch real-time weather data for any location using the OpenWeatherMap API. Demonstrates how to build a simple MCP server that exposes weather information as a tool for LLMs.Last updated1GPL 3.0
- Flicense-qualityDmaintenanceAn MCP server that provides weather and web search tools, orchestrated by a LangGraph agent with OpenAI for natural language interaction.Last updated8
- Alicense-qualityBmaintenanceAn MCP server providing AI-powered weather tools via Google Generative AI, enabling real-time weather data retrieval through natural language queries.Last updatedMIT
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for OpenAI Sora AI video generation
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dagudelot/mcp-server-openai-sdk'
If you have feedback or need assistance with the MCP directory API, please join our Discord server