alexanderhupfer
MCP Serveralexanderhupferpublic

openai mcp client

一个使用 Model Context Protocol (MCP) 与 OpenAI API 创建简单聊天代理的示例项目。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
TypeScript
Language
-
License

About This Server

一个使用 Model Context Protocol (MCP) 与 OpenAI API 创建简单聊天代理的示例项目。

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

Intro

This is a simple example of how to use the Model Context Protocol (MCP) with OpenAI's API to create a simple agent acting from a chat context. Feel free to use this as a starting point for your own projects.

Setup Guide

  • Ensure Deno v2 is installed
  • Run deno install to install dependencies
  • Copy .env.example to .env and fill in the values
    • You can choose any MCP server you like - bring your own or use one from the official MCP server list
  • Run deno run dev to start the application

Warning

Chat messages are appended and currently the entire conversation is always sent to the server. This can rack up a lot of tokens and cost a lot of money, depending on the length of the conversation, the model you are using, and the size of the context.

Limitations

This implementation currently only supports tool call responses of type text. Other resource can be implemented in applyToolCallIfExists in src/openai-utils.ts.

Notes

You latest messages are saved in messages.json for debugging purposes. These messages will be overwritten every time you run the application, so make sure to create a copy of the file before running the application again, if you want to keep the previous messages.

If you want to run the application in debug mode, set the DEBUG environment variable to true in your .env file. This will print out more information about the messages and tool calls.

Quick Start

1

Clone the repository

git clone https://github.com/alexanderhupfer/openai-mcp-client
2

Install dependencies

cd openai-mcp-client
npm install
3

Follow the documentation

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

Repository Details

Owneralexanderhupfer
Repoopenai-mcp-client
LanguageTypeScript
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