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.
npx agentmods add instructions/2xapi/2xapi.com-gpt-image-mcp-server/agents-mdgit clone --depth 1 https://github.com/2xapi/2Xapi.com-GPT-image-MCP-ServerWrote 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.
[](https://agentmods.dev/instructions/2xapi/2xapi.com-gpt-image-mcp-server/agents-md)<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>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.
| Model | Per session | Once 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 |
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.
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 开启),输出带结构化结果)。
关键规则
- API Key 必须由用户提供:不要编造、不要从仓库里找(仓库不含真实 key)。用户没说 key 时先询问。
- key 与端点必须配套:
IMAGE_API_KEY是哪家供应商的,IMAGE_API_BASE_URL就填哪家的(不填则用代码内置默认端点)。 - 默认端点是 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 版)。 - 优先 npm 版(
gpt-image-mcp-server/,TypeScript,Node 18+);Python 版(src/)作为备选,仅当用户环境没有 Node 时使用。 - 不要提交/外发
config.json:它含真实 key,已被.gitignore排除。 - 所有配置写在客户端配置里(环境变量方式),不要改仓库内文件。
部署步骤
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-xxxxxxxxIMAGE_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" }
}
}
}
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.
- 3d ago First seen · 103 lines · 1,436 tokens per session scan A 646354c0b551
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.
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).
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.
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.
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.
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).
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.