2Xapi.com-GPT-image-MCP-Server: Instructions file for Codex

AGENTS.md

2Xapi.com-GPT-image-MCP-Server AGENTS.md is an instructions file for Codex, OpenCode from 2xapi/2Xapi.com-GPT-image-MCP-Server. It costs 1,436 tokens per session, scanned A, original, Apache-2.0.

A set of deployment instructions for an MCP server that connects AI clients to image-generation APIs. The server can create or edit images through an OpenAI-compatible service.

In plain words
What is it for?
Use it when deploying the GPT-image MCP Server to Codex, Claude Code, Claude Desktop, or Cursor, including text-to-image generation and image editing.
Why use it?
It explains the required runtime, API-key setup, endpoint pairing, and client configuration, reducing setup mistakes and preventing accidental key exposure.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Claude Code; mentions AGENTS.md; mentions Codex.

This is 2xapi/2Xapi.com-GPT-image-MCP-Server's own configuration. It tells Codex and OpenCode how to work on 2Xapi.com-GPT-image-MCP-Server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything 2Xapi.com-GPT-image-MCP-Server configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/xxx/2Xapi.com-GPT-image-MCP-Server.

Reuse

Borrowing it

Nothing to install: this file belongs to 2xapi/2Xapi.com-GPT-image-MCP-Server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/2xapi/2Xapi.com-GPT-image-MCP-Server/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/2xapi/2Xapi.com-GPT-image-MCP-Server

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 2Xapi.com-GPT-image-MCP-Server AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/2xapi/2xapi.com-gpt-image-mcp-server/agents-md/github.svg)](https://agentmods.dev/instructions/2xapi/2xapi.com-gpt-image-mcp-server/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/2xapi/2xapi.com-gpt-image-mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/2xapi/2xapi.com-gpt-image-mcp-server/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 2Xapi.com-GPT-image-MCP-Server AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/2xapi/2xapi.com-gpt-image-mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/2xapi/2xapi.com-gpt-image-mcp-server/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,436 This file is loaded in full into every session.
When invoked 1,436 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01436 $0.01436
Opus 5.5 $0.00574 $0.00574
Sonnet 5.5 $0.00287 $0.00287
Haiku 4.5 $0.00144 $0.00144

Measured 2mo ago against content hash 646354c0b551, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

2Xapi.com-GPT-image-MCP-Server AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — AI 部署指南

本仓库是 GPT-image MCP Server:把 OpenAI 兼容的文生图/图生图接口封装成 MCP 工具。

你的任务(当用户说“部署 / 一键部署 / 配置这个 MCP / 帮我接入”时): 把本项目作为 MCP server 接入用户指定的客户端(Codex / Claude Code / Claude Desktop / Cursor),让用户能在对话里说「画一只柴犬」直接出图、发一张图说「改成动漫风」就能改图(edit_image,图片支持本地路径 / URL / data URI / base64,支持 mask 局部重绘;内联图片预览默认关闭(include_preview=true 开启),输出带结构化结果)。

关键规则

  1. API Key 必须由用户提供:不要编造、不要从仓库里找(仓库不含真实 key)。用户没说 key 时先询问。
  2. key 与端点必须配套:IMAGE_API_KEY 是哪家供应商的,IMAGE_API_BASE_URL 就填哪家的(不填则用代码内置默认端点)。
  3. 默认端点是 2xapi.com 中转站方案:内置默认端点为 https://2xa.cc.cd/v1(2xapi.com 中转站,官网 https://2Xapi.com),本 MCP 默认配套该中转站的生图方案;用户使用 2xapi.com 的 key 时无需配置端点。如果要使用其他 API 端点(OpenAI 官方 / Azure / 其他中转站),需要用户自行更换:设置 IMAGE_API_BASE_URL 环境变量(npm 版),或修改 config.json 的 api_base_url(Python 版)。
  4. 优先 npm 版(gpt-image-mcp-server/,TypeScript,Node 18+);Python 版(src/)作为备选,仅当用户环境没有 Node 时使用。
  5. 不要提交/外发 config.json:它含真实 key,已被 .gitignore 排除。
  6. 所有配置写在客户端配置里(环境变量方式),不要改仓库内文件。

部署步骤

1. 确认环境

node -v   # 需要 >= 18

没有 Node:提示用户安装 Node.js 18+(或改用 Python 版:python3 --version + uv --version)。

2. 安装依赖并构建 npm 版

cd gpt-image-mcp-server
npm install
npm run build     # 生成 dist/index.js

3. 获取用户的 API Key

向用户询问(一次性):

  • IMAGE_API_KEY(必填)— 形如 sk-xxxxxxxx
  • IMAGE_API_BASE_URL(可选)— 到 /v1 一级;不填用内置默认

4. 接入客户端(关键命令)

  • Codex(推荐,先问用户用什么客户端):
codex mcp add GPT-image --env IMAGE_API_KEY=用户的key -- node /绝对路径/gpt-image-mcp-server/dist/index.js

(/绝对路径 = 仓库的绝对路径,例如 /Users/xxx/2Xapi.com-GPT-image-MCP-Server)

  • Claude Code:
claude mcp add -s user gpt-image --env IMAGE_API_KEY=用户的key -- node /绝对路径/gpt-image-mcp-server/dist/index.js
  • Claude Desktop:编辑 ~/Library/Application Support/Claude/claude_desktop_config.json,在顶层 mcpServers 加:
{
  "mcpServers": {
    "GPT-image": {
      "command": "node",
      "args": ["/绝对路径/gpt-image-mcp-server/dist/index.js"],
      "env": { "IMAGE_API_KEY": "用户的key" }
    }
  }
}

Read the full file on GitHub · 103 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 103 lines · 1,436 tokens per session scan A 646354c0b551

Subscribe to this mod's changes

2Xapi.com-GPT-image-MCP-Server AGENTS.md is an instructions file published in the GitHub repository 2xapi/2Xapi.com-GPT-image-MCP-Server (1 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 1,436 tokens to every session, about $0.0057 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

2Xapi.com-GPT-image-MCP-Server AGENTS.md compared with instructions from other repositories

2Xapi.com-GPT-image-MCP-Server AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
2Xapi.com-GPT-image-MCP-Server AGENTS.md2xapi/2Xapi.com-GPT-image-MCP-ServerInstructions file12mo agoApache-2.0A1,436Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode