https://code.visualstudio.com/docs/copilot/chat/mcp-servers
The Model Context Protocol (MCP) is a new protocol for integrating AI/LLMs with existing software services. MCP Server Tools allow LLMs get additional context-relevant data, write/change remote data, and to take actions.
Most current MCP servers declare their tools statically. When the MCP server starts up it's available tools and any tool meta-data (such as text descriptions of the tool behavior provided in decorators or annotations) are made available to MCP clients that connect to an MCP server. The MCP client (LLM) can then call an available tool at the appropriate time, providing tool-specific input data, and the tool can take actions, get additional data, and provide those data to the client.
OSGi Remote Services/Remote Service Admin provides a open, standardized, multi-protocol, modular, extensible way to discover, dynamically export and import, and secure inter-process communication between services. Combining Remote Services with MCP Tool meta-data allows the creation of dynamic remote tools.
Remote Tools for MCP Servers
This README.md shows an example 'Arithmetic' service, with 'add' and 'multiply' tools defined and described via Java annotations to an ArithmeticTools service. The python MCP Server communicates with the Java Server (startup and after) to dynamically add to/update from its set of tools that it exposes to MCP Clients.
Here is a simple diagram showing the communication between and MCP client, the Python MCP Server, and a Java Arithmetic Service Server.
MCP Client (LLM) <- MCP -> Python MCP Server <- Arithmetic Service -> Java Server
The ArithmeticTools service is a simple example, but exposes a powerful and general capability, Arbitrary remote tool services may be declared and provided with the appropriate tool description meta-data, and then made dynamically available to any MCP servers created in Python, Java, or other languages. Both the MCP and RS/RSA are transport agnostic, allowing the service developer and service provider to use the remote-tool-appropriate-and-secure communication protocol.