api2mcp4j CLAUDE.md

api2mcp4j CLAUDE.md is an instructions file for coding agents from TheEterna/api2mcp4j. It costs 5,501 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for developing api2mcp4j, a Spring Boot Starter that exposes Java controller methods as MCP tools, resources, prompts, and completions. A Spring Boot Starter is a package that adds configured features to a Spring Boot application.

In plain words
What is it for?
Use it when changing api2mcp4j code, deciding which project rules apply, or following the required developer, tester, and reviewer workflow.
Why use it?
It explains the project's architecture, authorization rules, development process, review responsibilities, and coding conventions so agents can work within the repository's rules.

Instructions file

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/theeterna/api2mcp4j/claude-md
Clone the repo
git clone --depth 1 https://github.com/TheEterna/api2mcp4j

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 api2mcp4j CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/theeterna/api2mcp4j/claude-md.svg)](https://agentmods.dev/instructions/theeterna/api2mcp4j/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/theeterna/api2mcp4j/claude-md"><img src="https://agentmods.dev/badge/instructions/theeterna/api2mcp4j/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 5,501 This file is loaded in full into every session.
When invoked 5,501 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.05501 $0.05501
Opus 5 $0.02750 $0.02750
Sonnet 5 $0.01100 $0.01100
Haiku 4.5 $0.00550 $0.00550

Measured 4d ago against content hash 25182ec25a8d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api2mcp4j CLAUDE.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 4d 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.

CLAUDE.md · 274 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

项目概述

api2mcp4j(内部名称 server2mcp)是一个 Spring Boot Starter 框架,能自动将 Java Spring Controller 接口暴露为 MCP(Model Context Protocol)的 Tool、Resource、Prompt 和 Complete。设计理念是非侵入式、纯增强——类似 MyBatis-Plus 与 MyBatis 的关系。

核心思想:在 interface 作用域模式下,现有 @RestController 方法无需改动即可成为 MCP 工具。自定义 MCP 实体则使用专用注解(@McpTool@McpResource@McpPrompt@McpComplete)。


顶层授权框架(必读)

本项目 2026-06-24 全面继承姊妹项目 ../real-agent 的「开发心法」(董事长批准·方案 B)。本节及下方红线、审查、导航均在「自决默认协议」框架下解读。 协议正本:~/.claude/CLAUDE.md 顶部 · [ENFORCED] · 优先级高于本文件以下所有具体规范。

核心契约

  • 红线场景(不可逆操作 / 跨系统协议变更 / 全局规范修改 / 战役级启停 / 生产部署 / 删公开 API / 升级 SNAPSHOT 依赖的破坏性变更)→ 必须事前请示董事长,按下方「开发红线总表」执行多源验证等慢档流程。
  • 红线之外 → AI 自决,不推送选项给董事长,事后简报([DONE] 做了 X · 因 Y · 风险 Z · 回滚成本 W)。

三方独立制衡(中等以上复杂度任务,全局 Rule #6):架构师(开发,不自写测试)/ 御史台(独立测试 + Code Review,不参与开发)/ CEO(协调验证闭环)。本项目质检 agent 见 .claude/agents/(御史台 imperial-censor)。

Briefback 宣誓:所有 agent 执行前须输出工作协议宣誓六项(任务理解 / 红线清单 / 交付标准 / 绝不会做的事 / 偏离预案 / 环境能力自检),未宣誓 = 产出作废。

开发心法与规范导航

心法继承自 ../real-agent,已剥离前端/设计招式、适配本 Java 库语境。单一权威源原则:下方「开发红线总表」是本项目红线的唯一权威源,各 spec 只引用不重复。

通用心法(docs/rules/global/,所有会话默认生效)

规则 路径 核心
搜索工具序位 docs/rules/global/search-tool-parity.md grep(字面量)/ 结构层 / LSP(语义)/ 多模块(图谱)四维不互替
破坏性删除多源验证 docs/rules/global/destructive-deletion.md [ENFORCED] 删公开 API 前 grep 多形式 + LSP + 跨模块/下游兼容性评估
Session 续接铁律 docs/rules/global/session-continuity.md [ENFORCED] 续接先 git log/status 验证,禁凭记忆断言状态
重构 commit 顺序 docs/rules/global/refactor-ordering.md [ENFORCED] 契约提供者先行 / 原子 commit,避免契约真空期
Agent 能力声明 docs/rules/global/agent-capability-declaration.md [ENFORCED] 物理不可能性原则,Briefback 第六项环境自检
工作留痕 docs/rules/global/work-log.md [ENFORCED] 报告类产出 / >30 行结构化产出落 docs/logs/

核心规范(docs/specs/

规范 路径 核心
注册纪律宪法 docs/specs/REGISTRATION_DISCIPLINE_SPEC.md [ENFORCED] 六维成熟度 Rubric + 三把利器(本框架灵魂:注册不遗漏)
文件头规范 docs/specs/FILE_HEADER_SPEC.md [ENFORCED] AI 可读性文件头 @header-start/@header-end 分级模板
测试规范 docs/specs/TEST_SPEC.md [ENFORCED] 测试金字塔 + TDD 双 commit([RED]/[GREEN]
工作留痕规范 docs/specs/WORK_LOG_SPEC.md [ENFORCED] 落文件模板 + Agent 五要素总结 + MUST-WIN 三源验证

Read the full file on GitHub · 274 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. 4d ago First seen · 274 lines · 5,501 tokens per session scan A 25182ec25a8d

Subscribe to this mod's changes

api2mcp4j CLAUDE.md is an instructions file published in the GitHub repository TheEterna/api2mcp4j (110 stars, last pushed 9d ago), licensed Apache-2.0. It adds 5,501 tokens to every session, about $0.0275 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-30.