2Xapi.com-GPT-image-MCP-Server 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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/2xapi/2xapi.com-gpt-image-mcp-server/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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.01436 $0.01436
Opus 5 $0.00718 $0.00718
Sonnet 5 $0.00287 $0.00287
Haiku 4.5 $0.00144 $0.00144

Measured 3d ago against content hash 646354c0b551, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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.jsonapi_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. 3d 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 (2 stars, last pushed 6d ago), licensed Apache-2.0. It adds 1,436 tokens to every session, about $0.0072 per session on Opus 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

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens