Model Context Protocol: conceptual foundations and implementation in Java

Keywords: Model Context Protocol, large language models, Spring AI, Java, MCP server, MCP client, resources, tools, prompts

Abstract

The article discusses the Model Context Protocol (MCP) as the latest open standard for integrating large language models (LLMs) with external data, services, and tools. It emphasizes that one of the main problems with LLMs is their limited knowledge at the time of training and their inability to interact directly with the real world. MCP, proposed by Anthropic in 2024, creates a secure and standardized mechanism for communication between models and the external environment, ensuring interoperability, scalability, and flexibility of integrations. The paper systematizes the conceptual foundations of the protocol, including the host-client-server architecture, the role of transport mechanisms, and support for three basic primitives: resources, prompts, and tools. It is shown that MCP forms a unified approach to creating agent systems that are capable of obtaining context in real time, performing actions in external services, and significantly reducing the cost of integration solutions. A practical aspect is analyzed separately: the implementation of an MCP server prototype in Java using Spring AI and the official MCP Java SDK. Examples are given of exposing resources, connecting tools, creating prompts, and testing using MCP Inspector. The results confirm the effectiveness of the protocol in software engineering tasks, demonstrating the performance, convenience, scalability, and reliability of integrations. Thus, the article contributes to the development of the theory and practice of building intelligent systems that go beyond static knowledge and open up a new level of automation and collaboration between humans and artificial intelligence.

References

1. Anthropic. Introducing the Model Context Protocol. URL
2. GitHub репозиторій з вихідним кодом реалізації MCP. URL
3. GitHub репозиторій протоколу. URL
4. MCP Inspector URL
5. MCP документація. URL
Published
2025-12-05
How to Cite
Petrenko , S. (2025). Model Context Protocol: conceptual foundations and implementation in Java. COMPUTER-INTEGRATED TECHNOLOGIES: EDUCATION, SCIENCE, PRODUCTION, (61), 185-192. https://doi.org/10.36910/6775-2524-0560-2025-61-26
Section
Computer science and computer engineering