giuseppe-trisciuoglio avatar

Langchain4j Mcp Server Patterns

Java patterns for building MCP servers and wiring LangChain4j tools with trust-based filtering and fail-closed defaults.

CCM score
53 of 100
skills.sh installs
3.9K
GitHub stars
372
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers MCP tool, resource, and prompt design, plus stdio and HTTP/SSE transport selection for Java servers
  • Includes tool, resource, and prompt provider patterns, with two code examples for a stdio server and a filtered LangChain4j AI service
  • Enforces fail-closed filtering so privileged tools like admin_ prefixes stay hidden unless explicitly allowed
  • Designed for Java teams building MCP servers or connecting LangChain4j and Spring Boot apps to external MCP servers

Install

$ npx -y skills add giuseppe-trisciuoglio/developer-kit --skill langchain4j-mcp-server-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/giuseppe-trisciuoglio/developer-kit
Categories
Skill & Plugin Building, Java & JVM, AI Agents & LLM Apps
First seen
May 16, 2026

More from giuseppe-trisciuoglio/developer-kit

All 95

Similar to Langchain4j Mcp Server Patterns

More Skill & Plugin Building