langchain4j-mcp-server-patterns — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited langchain4j-mcp-server-patterns (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill to design and implement Model Context Protocol (MCP) integrations with LangChain4j.
The main concerns are:
Keep SKILL.md focused on the implementation flow. Use the bundled references for expanded examples and API-level detail.
Use this skill when:
Typical trigger phrases include langchain4j mcp, java mcp server, mcp tool provider, spring boot mcp, and connect langchain4j to mcp.
Decide what the server should expose:
Keep names stable, descriptions concrete, and schemas small enough for a client or model to understand quickly.
Use separate classes for each concern:
Validate arguments before execution and return clear error messages for invalid input or unavailable dependencies.
Use:
Pin external server versions and document how the process is started, authenticated, and monitored.
When consuming MCP servers from LangChain4j:
At minimum:
Before shipping:
class WeatherToolProvider implements ToolProvider {
@Override
public List<ToolSpecification> listTools() {
return List.of(
ToolSpecification.builder()
.name("get_weather")
.description("Return the current weather for a city")
.inputSchema(Map.of(
"type", "object",
"properties", Map.of(
"city", Map.of("type", "string")
),
"required", List.of("city")
))
.build()
);
}
@Override
public String executeTool(String name, String arguments) {
return weatherService.lookup(arguments);
}
}
MCPServer server = MCPServer.builder()
.server(new StdioServer.Builder())
.addToolProvider(new WeatherToolProvider())
.build();
server.start();Use this pattern for local tool execution or a sidecar process started by another application.
McpToolProvider toolProvider = McpToolProvider.builder()
.mcpClients(mcpClients)
.failIfOneServerFails(false)
.filter((client, tool) -> !tool.name().startsWith("admin_"))
.build();
Assistant assistant = AiServices.builder(Assistant.class)
.chatModel(chatModel)
.toolProvider(toolProvider)
.build();Use this pattern when you want LangChain4j to consume external MCP servers while still enforcing trust boundaries.
references/ instead of expanding SKILL.md indefinitely.references/examples.mdreferences/api-reference.mdprompt-engineeringspring-aiclean-architecture~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.