Borrowing it
Nothing to install: this file belongs to ranbo12138/mcp-image-gen. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ranbo12138/mcp-image-gen/main/AGENTS.mdgit clone --depth 1 https://github.com/ranbo12138/mcp-image-genWrote 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/ranbo12138/mcp-image-gen/agents-md)<a href="https://agentmods.dev/instructions/ranbo12138/mcp-image-gen/agents-md"><img src="https://agentmods.dev/badge/instructions/ranbo12138/mcp-image-gen/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.
<a href="https://agentmods.dev/instructions/ranbo12138/mcp-image-gen/agents-md"><img src="https://agentmods.dev/badge/instructions/ranbo12138/mcp-image-gen/agents-md.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.02111 | $0.02111 |
| Opus 5.5 | $0.00844 | $0.00844 |
| Sonnet 5.5 | $0.00422 | $0.00422 |
| Haiku 4.5 | $0.00211 | $0.00211 |
Grade A, and why
mcp-image-gen 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.
How it starts
The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
项目概述
这是一个基于 ** Model Context Protocol(MCP)** 的图像生成服务器项目。项目作为中间件,将 MCP 协议请求转换为标准的 OpenAI 兼容格式(/v1/images/generations)调用上游图像生成 API。专为云端部署场景设计,通过 Streamable HTTP 提供服务,支持 Claude Desktop、RikkaHub 等 MCP 客户端远程连接。
技术栈
- 运行时环境:Node.js >= 18.0.0
- 语言:TypeScript 5.4+
- Web 框架:Express.js 4.18.2
- MCP 协议 SDK:
@modelcontextprotocol/sdk^1.0.0 - 参数验证:Zod ^3.23.8
- 环境配置:dotenv ^16.4.5
- 跨域支持:cors ^2.8.5
- 模块格式:ES Module(
"type": "module")
核心文件结构
mcp-image-gen/
├── src/
│ ├── index.ts # Express 服务器入口,Streamable HTTP 传输层实现
│ └── config.ts # 配置管理,环境变量定义和类型
├── dist/ # TypeScript 编译输出(由 npm run build 生成)
│ ├── index.js
│ └── config.js
├── .env.example # 环境变量配置模板
├── Dockerfile # Docker 镜像构建文件
├── package.json # 项目依赖声明和 npm 脚本
├── tsconfig.json # TypeScript 编译配置
├── .github/workflows/
│ └── docker-publish.yml # GitHub Actions 自动构建 Docker 镜像工作流
└── README.md # 项目使用文档
构建和运行
本地开发
# 安装项目依赖
npm install
# 复制环境变量模板并配置
cp .env.example .env
# 编辑 .env 文件,填入 API_KEY 等必要配置
# 构建 TypeScript
npm run build
# 启动服务(前台运行)
npm start
# 开发模式(监听文件变化自动重启)
npm run dev
# 使用 MCP Inspector 测试
npm run inspect
Docker 部署
# 构建 Docker 镜像
docker build -t mcp-image-gen .
# 运行容器
docker run -d -p 3000:3000 -e API_KEY=your_api_key mcp-image-gen
# 使用 GitHub Container Registry 镜像
docker run -d -p 3000:3000 -e API_KEY=your_api_key ghcr.io/ranbo12138/mcp-image-gen:latest
服务端点
| 端点 | 方法 | 说明 |
|---|---|---|
/mcp |
POST | MCP 协议主端点,处理客户端请求和初始化 |
/mcp |
GET | SSE 通知端点,服务器向客户端推送消息 |
/mcp |
DELETE | 会话终止端点 |
/health |
GET | 健康检查端点,返回服务状态和活跃会话数 |
开发约定
代码风格规范
- 使用 TypeScript,启用严格模式(
strict: true) - 模块导入导出采用 ES Module 形式
- 变量和函数命名使用 camelCase 风格
- 常量命名使用大写字母加下划线
- 所有配置和类型在
config.ts中集中定义
MCP 服务器架构
项目采用 MCP SDK 推荐的高级 API 模式:
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import { z } from "zod";
// 创建服务器实例
const server = new McpServer({
name: "cloud-image-generator",
version: "3.0.0",
});
// 使用 Zod 定义参数 Schema
server.registerTool("generate_image", {
title: "Generate Image",
description: "...",
inputSchema: {
prompt: z.string().describe("..."),
size: z.enum(["16:9", "9:16", "1:1", "2:3", "3:2"]).default("2:3"),
},
}, async (params) => {
// 工具实现
return { content: [{ type: "text", text: "..." }] };
});
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.
- 2mo ago First seen · 227 lines · 2,111 tokens per session scan A 2c0769a3bcd7
mcp-image-gen AGENTS.md is an instructions file published in the GitHub repository ranbo12138/mcp-image-gen (2 stars, last pushed 7mo ago), licensed MIT. It adds 2,111 tokens to every session, about $0.0084 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.
mcp-image-gen AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| mcp-image-gen AGENTS.mdranbo12138/mcp-image-gen | Instructions file | 2 | 7mo ago | MIT | A | 2,111 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,649 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| vscode model-prompts.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 2,022 | GitHub Copilot |