m-code-ing/mcp-server
3.1
If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This document provides a structured overview of a Model Context Protocol (MCP) server integrated with OpenAI's GPT-4, designed to facilitate interaction with AI models through a standardized protocol.
Tools
1
Resources
0
Prompts
0
MCP Server with OpenAI Agent
A Model Context Protocol (MCP) server with OpenAI integration example.
Setup
-
Install dependencies:
npm install -
Set up environment variables:
cp .env.example .env # Edit .env and add your OpenAI API key -
Run the MCP server:
npm start -
Test the OpenAI agent:
npm run agent -
Interactive testing:
npm run test-agent
Features
- MCP Server: Provides a
getWeathertool - OpenAI Agent: Connects to MCP server and uses GPT-4 to call tools
- TypeScript: Full type safety
Environment Variables
OPENAI_API_KEY: Your OpenAI API key
Security
- Never commit your actual API keys
- The
.envfile is gitignored - Use
.env.exampleas a template