{
  "markdown": "# mcp-server-gpt-chat\n\nAn MCP (Model Context Protocol) server for the OpenAI ChatGPT API. Built in Rust, exposes chat completions, vision, embeddings, and model listing as MCP tools.\n\nCommunicates via stdio using JSON-RPC 2.0, like all MCP servers.\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `chat` | Send a chat completion request to ChatGPT with optional multi-turn history, system prompt, structured output (JSON schema), and model selection |\n| `chat_with_vision` | Analyse an image with ChatGPT's vision capabilities given an image URL and text prompt |\n| `embedding` | Generate text embeddings using OpenAI's embedding model |\n| `list_models` | List all available OpenAI models and their IDs |\n\n### chat\n\nSend 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.\n\n**Parameters:**\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `prompt` | string | yes | The user message to send |\n| `model` | string | no | Model to use (default: `gpt-4o`) |\n| `system_prompt` | string | no | System prompt to set context |\n| `messages` | string | no | Full conversation history as JSON array of `{role, content}` objects |\n| `temperature` | float | no | Sampling temperature (0.0 - 2.0) |\n| `max_tokens` | integer | no | Maximum tokens to generate |\n| `response_schema` | string | no | JSON schema string to enforce structured output |\n\n### chat_with_vision\n\nAnalyse an image using ChatGPT's vision capabilities.\n\n**Parameters:**\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `prompt` | string | yes | Text prompt describing what to analyse |\n| `image_url` | string | yes | URL of the image (must be http:// or https://) |\n| `model` | string | no | Model to use (default: `gpt-4o`) |\n| `detail` | string | no | Image detail level: `low` or `high` (default: `high`) |\n| `temperature` | float | no | Sampling temperature (0.0 - 2.0) |\n| `max_tokens` | integer | no | Maximum tokens to generate |\n\n### embedding\n\nGenerate text embeddings.\n\n**Parameters:**\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `input` | string | yes | Text to embed as JSON: a single string or array of strings |\n| `model` | string | no | Embedding model to use (default: `text-embedding-3-small`) |\n\n### list_models\n\nList all available OpenAI models. No parameters.\n\n## Prerequisites\n\n- Rust (edition 2024)\n- An OpenAI API key from [platform.openai.com](https://platform.openai.com/)\n\n## Setup\n\nCreate the config file:\n\n```bash\nmkdir -p ~/.config/mcp-server-gpt-chat\n```\n\nCreate `~/.config/mcp-server-gpt-chat/config.toml`:\n\n```toml\napi_key = \"sk-...\"\n```\n\n## Build\n\n```bash\ncargo build --release\n```\n\nThis produces `target/release/gpt-chat`.\n\nFor development:\n\n```bash\ncargo build              # debug build\ncargo run                # run in dev mode\nRUST_LOG=debug cargo run # run with debug logging\n```\n\n## MCP Configuration\n\nAdd to your Claude Desktop config (`~/.config/Claude/claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"gpt-chat\": {\n      \"command\": \"/path/to/gpt-chat\"\n    }\n  }\n}\n```\n\n## Project Structure\n\n```\nsrc/\n  main.rs    - entry point, config loading, stdio transport setup\n  server.rs  - MCP tool definitions (chat, chat_with_vision, embedding, list_models)\n  api.rs     - OpenAI HTTP client, request/response types, response formatters\n  params.rs  - tool parameter types with serde and JSON Schema derives\n  config.rs  - TOML config loading\n```\n\n## License\n\nMIT\n",
  "bytes": 3630,
  "sha": "81f59ae66f63f3efc445f488a13f6fef51cf57ef428fa779d76b4a45a2b6301c",
  "repo_slug": "codechap/mcp-server-gpt-chat",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_codechap_gpt_chat_45d944fc/readme"
}