java-sdk: Instructions file for Codex

AGENTS.md

java-sdk AGENTS.md is an instructions file for Codex, OpenCode from modelcontextprotocol/java-sdk. It costs 839 tokens per session, scanned A, original, MIT.

Project instructions for the MCP Java SDK, a Java library for building clients and servers that exchange tools and data through a shared protocol over several connection types.

In plain words
What is it for?
Use them when building or changing the SDK's core protocol, JSON handling, transports, client and server implementations, test fixtures, or protocol conformance tests.
Why use it?
They describe the SDK modules, Java and build requirements, formatting checks, and testing process, including tests that use Docker and npx.

Instructions file for CodexOpenCode ✓ vendor

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Codex.

This is modelcontextprotocol/java-sdk's own configuration. It tells Codex and OpenCode how to work on java-sdk itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything java-sdk configures →

About the project

The MCP Java SDK is a set of Java libraries for building applications that communicate with AI models, tools, and Model Context Protocol servers through a standard interface. Java developers use it to create MCP clients and servers, with synchronous or asynchronous communication.

modelcontextprotocol/java-sdk · 3,759 stars · on GitHub · java.sdk.modelcontextprotocol.io

Reuse

Borrowing it

Nothing to install: this file belongs to modelcontextprotocol/java-sdk. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/modelcontextprotocol/java-sdk/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/modelcontextprotocol/java-sdk

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 java-sdk AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/modelcontextprotocol/java-sdk/agents-md/github.svg)](https://agentmods.dev/instructions/modelcontextprotocol/java-sdk/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/modelcontextprotocol/java-sdk/agents-md"><img src="https://agentmods.dev/badge/instructions/modelcontextprotocol/java-sdk/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.

agentmods 80×15 button for java-sdk AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/modelcontextprotocol/java-sdk/agents-md"><img src="https://agentmods.dev/badge/instructions/modelcontextprotocol/java-sdk/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 839 This file is loaded in full into every session.
When invoked 839 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00839 $0.00839
Opus 5.5 $0.00336 $0.00336
Sonnet 5.5 $0.00168 $0.00168
Haiku 4.5 $0.00084 $0.00084

Measured 2mo ago against content hash fd0ab747a14a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 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.

AGENTS.md · 81 lines

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, transports
  • mcp-json, mcp-json-jackson2, mcp-json-jackson3 — JSON binding abstraction + Jackson implementations
  • mcp — pom-only project, single dependency pulling both mcp-core and mcp-json-jackson3
  • mcp-bom — Maven BOM for dependency management
  • mcp-test — test fixtures shared across modules
  • mcp-test — test fixtures shared across modules
  • conformance-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.

Read the full file on GitHub · 81 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. 2mo ago First seen · 81 lines · 839 tokens per session scan A fd0ab747a14a

Subscribe to this mod's changes

java-sdk AGENTS.md is an instructions file published in the GitHub repository modelcontextprotocol/java-sdk (3,759 stars, last pushed 3d ago), licensed MIT. It adds 839 tokens to every session, about $0.0034 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-30.

Related

java-sdk AGENTS.md compared with instructions from other repositories

java-sdk AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
java-sdk AGENTS.mdmodelcontextprotocol/java-sdkInstructions file3.8k3d agoMITA839Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode