Provides LangChain4j patterns for implementing MCP (Model Context Protocol) servers, creating Java AI tools, exposing tool calling capabilities, and integrating MCP clients with AI services.
SkillScore95Maintained
Automatic
◆AI Engineer pack
Last verified 8/21/2026
What it changes
Passed 21 of 22 test cases with the skill, and 12 of 22 without it.
Without skill55%
With skill95%
Checks it passed that the model alone missed
The class implements ToolProvider
Separates state-changing actions into tools
Separates read-only data access into resources
and 13 more in the full report
9 fixed12 passed either way1 still failing0 broke
Pass-rate lift
+41 pp
Tokens
+14%
Agent turns
0%
Response time
-39%
Model gemini-3.6-flashMeasured 8/21/2026v121 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 9 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 9
Prompt
A team is exposing a `delete_user` database action and a `get_user_profile` read action through the exact same interface pattern with full write permissions. What core surface separation rule should be enforced?
What was checked, without and with the skill
Checked
Without skill
With skill
Separates read-only data access into resources
Missed
Passed
Separates state-changing actions into tools
Missed
Passed
case-22 · gemini-3.6-flash · 8/21/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md162 lines4 files
LangChain4j MCP Server Implementation Patterns
Overview
Use this skill to design and implement Model Context Protocol (MCP) integrations with LangChain4j.
The main concerns are:
defining a clean tool, resource, and prompt surface
choosing the right transport and bootstrap model
filtering unsafe capabilities before exposing them to agents or applications
Keep SKILL.md focused on the implementation flow. Use the bundled references for expanded examples and API-level detail.
When to Use
Use this skill when:
building a Java MCP server that exposes tools, resources, or prompts
integrating LangChain4j with one or more external MCP servers
wiring MCP support into a Spring Boot application
filtering available tools by tenant, user role, or runtime context
adding observability, resilience, and safe failure handling around MCP interactions
reviewing an MCP integration for prompt-injection and side-effect risks
Typical trigger phrases include langchain4j mcp, java mcp server, mcp tool provider, spring boot mcp, and connect langchain4j to mcp.
Instructions
1. Design the MCP surface before writing code
Decide what the server should expose:
tools for actions with clear inputs and side effects
resources for read-only or structured data access
prompts only when a reusable template adds real value
Keep names stable, descriptions concrete, and schemas small enough for a client or model to understand quickly.
2. Implement providers with narrow responsibilities
Provides unit test, integration test, and mock AI patterns for LangChain4j applications. Creates mock LLM responses, tests retrieval chains, validates RAG workflows, and implements Testcontainers-based integration tests for Java AI services. Use when unit testing AI services, integration testing LangChain4j components, mocking AI models, or testing LLM-based Java applications.