Gpt Chat

io.github.codeChap由 GitHub 账号 codeChap 发布v0.1.0更新于 Oct 24, 2026

MCP server for the OpenAI ChatGPT API — chat, vision, and embeddings

已验证STDIO仅桌面媒体与设计AI 与机器学习

概览

AI 生成的概览

一个本地 MCP 服务器,将助手连接到 OpenAI ChatGPT API,用于对话补全、图像分析、嵌入和模型列表。

可以做什么
发送对话补全请求,可附带多轮历史、系统提示、温度、token 上限和 JSON Schema 结构化输出,并可选择模型(默认 gpt-4o)。根据 http 或 https 图片 URL 和文本提示分析图像,可选择低或高细节级别。为单个字符串或字符串数组生成文本嵌入。列出可用的 OpenAI 模型及其 ID。
适用场景
适合希望助手在本地环境中直接调用 OpenAI 模型的场景:起草或延续对话、按 URL 描述或分析图像、为搜索或聚类生成嵌入,或查看有哪些可用模型。
运行要求
以 stdio 方式作为本地进程运行。需要 Rust 工具链来构建可执行文件,以及来自 platform.openai.com 的 OpenAI API 密钥,放在 ~/.config/mcp-server-gpt-chat/config.toml 配置文件中。需要访问 OpenAI API 的网络连接,并在 MCP 客户端配置中登记可执行文件路径。
安装前请注意
OpenAI API 密钥以明文形式保存在配置文件中,请妥善保护该文件。请求会把提示、对话历史和图片 URL 发送给 OpenAI,API 用量会计入你的 OpenAI 账户费用。该服务器只从 OpenAI 读取,不会写入或删除本机数据。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Gpt Chat,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-server-gpt-chat

An MCP (Model Context Protocol) server for the OpenAI ChatGPT API. Built in Rust, exposes chat completions, vision, embeddings, and model listing as MCP tools.

Communicates via stdio using JSON-RPC 2.0, like all MCP servers.

Tools

ToolDescription
chatSend a chat completion request to ChatGPT with optional multi-turn history, system prompt, structured output (JSON schema), and model selection
chat_with_visionAnalyse an image with ChatGPT's vision capabilities given an image URL and text prompt
embeddingGenerate text embeddings using OpenAI's embedding model
list_modelsList all available OpenAI models and their IDs

chat

Send a chat completion request. Supports multi-turn conversations via a JSON message history array, system prompts, structured output via JSON schema, temperature control, and model selection.

Parameters:

NameTypeRequiredDescription
promptstringyesThe user message to send
modelstringnoModel to use (default: gpt-4o)
system_promptstringnoSystem prompt to set context
messagesstringnoFull conversation history as JSON array of {role, content} objects
temperaturefloatnoSampling temperature (0.0 - 2.0)
max_tokensintegernoMaximum tokens to generate
response_schemastringnoJSON schema string to enforce structured output

chat_with_vision

Analyse an image using ChatGPT's vision capabilities.

Parameters:

NameTypeRequiredDescription
promptstringyesText prompt describing what to analyse
image_urlstringyesURL of the image (must be http:// or https://)
modelstringnoModel to use (default: gpt-4o)
detailstringnoImage detail level: low or high (default: high)
temperaturefloatnoSampling temperature (0.0 - 2.0)
max_tokensintegernoMaximum tokens to generate

embedding

Generate text embeddings.

Parameters:

NameTypeRequiredDescription
inputstringyesText to embed as JSON: a single string or array of strings
modelstringnoEmbedding model to use (default: text-embedding-3-small)

list_models

List all available OpenAI models. No parameters.

Prerequisites

Setup

Create the config file:

bash
mkdir -p ~/.config/mcp-server-gpt-chat

Create ~/.config/mcp-server-gpt-chat/config.toml:

toml
api_key = "sk-..."

Build

bash
cargo build --release

This produces target/release/gpt-chat.

For development:

bash
cargo build              # debug buildcargo run                # run in dev modeRUST_LOG=debug cargo run # run with debug logging

MCP Configuration

Add to your Claude Desktop config (~/.config/Claude/claude_desktop_config.json):

json
{  "mcpServers": {    "gpt-chat": {      "command": "/path/to/gpt-chat"    }  }}

Project Structure

src/  main.rs    - entry point, config loading, stdio transport setup  server.rs  - MCP tool definitions (chat, chat_with_vision, embedding, list_models)  api.rs     - OpenAI HTTP client, request/response types, response formatters  params.rs  - tool parameter types with serde and JSON Schema derives  config.rs  - TOML config loading

License

MIT

来源:README.md,提交 1e8a772

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。