Model Context Protocol with Spring AI: Building MCP Clients and Servers in Java

In the previous article, we explored how to build AI agents with Spring AI using:

LLMs
 ↓
RAG
 ↓
Tool Calling
 ↓
Memory
 ↓
Agent Workflows

Tool calling gives an AI application the ability to interact with external capabilities.

But another problem appears as AI systems become larger.

Imagine you have:

Customer Service Agent
        ↓
Order APIs
Payment APIs
CRM APIs
Knowledge Base
Email Service

And another application has:

Sales Agent
        ↓
CRM
Calendar
Email
Customer Database

And another has:

Developer Agent
        ↓
Git Repository
Issue Tracker
CI/CD
Documentation

If every AI application implements every integration differently, the architecture quickly becomes difficult to maintain.