Skip to content

m-code-ing/mcp-server

Repository files navigation

MCP Server with OpenAI Agent

A Model Context Protocol (MCP) server with OpenAI integration example.

Setup

  1. Install dependencies:

    npm install
  2. Set up environment variables:

    cp .env.example .env
    # Edit .env and add your OpenAI API key
  3. Run the MCP server:

    npm start
  4. Test the OpenAI agent:

    npm run agent
  5. Interactive testing:

    npm run test-agent

Features

  • MCP Server: Provides a getWeather tool
  • 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 .env file is gitignored
  • Use .env.example as a template

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published