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/modelcontextprotocol/java-sdk/agents-mdgit clone --depth 1 https://github.com/modelcontextprotocol/java-sdkWhat 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.00839 | $0.00839 |
| Opus 5 | $0.00419 | $0.00419 |
| Sonnet 5 | $0.00168 | $0.00168 |
| Haiku 4.5 | $0.00084 | $0.00084 |
Grade A, and why
java-sdk 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 yesterday.
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 — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MCP Java SDK
Java SDK for the Model Context Protocol, enabling Java applications to implement MCP clients and servers (sync and async) over stdio, SSE, and Streamable HTTP transports.
Modules
mcp-core— protocol types, schema, client/server implementation, transportsmcp-json,mcp-json-jackson2,mcp-json-jackson3— JSON binding abstraction + Jackson implementationsmcp— pom-only project, single dependency pulling bothmcp-coreandmcp-json-jackson3mcp-bom— Maven BOM for dependency managementmcp-test— test fixtures shared across modulesmcp-test— test fixtures shared across modulesconformance-tests— client/server implementations run against the MCP conformance suite
Prerequisites
- Java 17 or above
- Docker
npx
Build & Test
./mvnw clean compile -DskipTests # build
./mvnw test # tests (requires Docker + npx)
Formatting (spring-javaformat) is validated automatically as part of every build (bound to the
validate phase), so a formatting violation fails ./mvnw test before any tests run. Fix violations with:
./mvnw spring-javaformat:apply
Evolving McpSchema records
Records in McpSchema are serialized directly to the MCP JSON wire format, so changing one is a wire-format
change, not a routine refactor. Whether a field is optional (Java may leave it null) or spec-required
by MCP determines a different set of rules — field ordering, @JsonCreator placement, default handling, and
required test coverage. See the "Evolving wire-serialized records" section of
CONTRIBUTING.md before touching a record in McpSchema; do not guess at the pattern from
a single existing field.
Versioning & dependencies
- The SDK follows semver; see VERSIONING.md for exactly what counts as a breaking change (it's broader than the obvious API removals — e.g. dropping a Java LTS version or a transport type also counts).
- Dependency bumps require a concrete reason (security, bug, needed feature) — see DEPENDENCY_POLICY.md. Don't bump a dependency just because a newer version exists.
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.
- yesterday First seen · 81 lines · 839 tokens per session scan A fd0ab747a14a
java-sdk AGENTS.md is an instructions file published in the GitHub repository modelcontextprotocol/java-sdk (3,674 stars, last pushed 3d ago), licensed MIT. It adds 839 tokens to every session, about $0.0042 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.
Other instructions, from other repositories
mcp-for-beginners AGENTS.md
Instructions for microsoft/mcp-for-beginners, covering agents.md, project overview, key technologies, architecture and setup commands.
mcp-dotnet-samples AGENTS.md
Instructions for microsoft/mcp-dotnet-samples, covering agents.md - mcp .net samples, project overview, project structure and architecture, repository organization and sample components.
Cobalt CLAUDE.md
Instructions for Auties00/Cobalt, covering cobalt, build, maven modules, architecture and client hierarchy.
Embody AGENTS.md
Instructions for dylanroscover/Embody, covering embody + envoy - ai instructions, critical rules, td python rules, network layout rules and mcp server safety rules.
imgui-java CLAUDE.md
Instructions for SpaiR/imgui-java: This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
toBeBetterJavaer AGENTS.md
AGENTS.md instructions for itwanger/toBeBetterJavaer, covering 工具权限设置, 工具使用规则, 获取网页内容 and 图片生成 / 文章配图.