Langchain4j APP MCP HOST/Client For Spring boot MCP server

by thrkrdk

189 downloads
Not rated
GitHub

About

Model Context Protocol: Client application with Langchain4j for spring boot ai mcp server

Details

Author
thrkrdk
Downloads
189
Categories
Other

- Connects to private LLMs (e.g., Ollama Qwen2.5-coder:14b)
- Supports SSE and STDIO transport modes
- Creates MCP Client with ToolProvider integration
- Uses Langchain4j’s ChatLanguageModel and AI services
- Provides a Bot interface for tool‑calling assistants

The project provides branches with step‑by‑step examples. The final branch (03‑use‑mcp‑server‑stadio) shows the complete setup. You run an MCP server demo image in podman in either SSE or STDIO mode, obtain the server URL (SSE) or STDIO transport, then create a ChatLanguageModel for Ollama, an MCP Transport, an MCP Client, a ToolProvider to fetch tools from the server, and finally an AI services instance (Bot) to call the assistant with a tool.

Langchain4j APP MCP HOST/Client For Spring boot MCP server

- Main branch : Initial start.
- 01-connect-to-ai branch: Private LLM connection
- Create Bot Interface
- Connect to Ollama Qwen2.5-coder:14b
- Ask For the information of the number 1 star war character
- 02-use-mcp-server-sse: Connecting SSE Mcp Server
- Change Ollama url by using kaggle and ngrok
- Run Demo image in podman in SSE mode. Get the SSE URL from the podman image.
- Create ChatLanguageModel for Ollama
- Create Transport for MCP with SSE URL
- Create MCP Client
- MCP server needs ToolProvider to get the tools from the server.
- Create an aiservices instance with Bot type.
- Call the assistant with a tool.
- 03-use-mcp-server-stadio: Connecting Stdio Mcp Server
- Change Ollama url by using kaggle and ngrok
- Run Demo image in podman in STDIO mode.
- Create ChatLanguageModel for Ollama
- Create Transport for MCP with STDIO
- Create MCP Client
- MCP server needs ToolProvider to get the tools from the server.
- Create an aiservices instance with Bot type.
- Call the assistant with a tool.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.