1. Conduid
  2. Documentation
  3. Spring AI MCP Server Client
MCP server · Documentation

Spring AI MCP Server Client

Spring AI MCP Server and Client

34Low

Scored 6 months ago · breakdown

About Spring AI MCP Server Client

Spring AI MCP Server Client is an MCP server in the Documentation category: spring AI MCP Server and Client.

Install

From source
git clone https://github.com/stylepatrick/spring-ai-mcp-server-client

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Spring AI MCP Server Client

Powered by Claude · Grounded in docs

I know everything about Spring AI MCP Server Client. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

Spring AI MCP Server and Client

A demonstration project showcasing the integration of Spring AI's Model Completion Provider (MCP) protocol for building AI-powered applications. This project consists of a server component that provides AI model completion services with function-calling capabilities, and a client component that consumes these services.

Overview

This project demonstrates how to use Spring AI's MCP protocol to create a server that exposes AI model completion services and a client that consumes these services. The server component provides mathematical tools (sum and multiply) that can be called by AI models, while the client component exposes a REST endpoint for users to submit questions.

Features

  • MCP Server: Provides AI model completion services with function-calling capabilities
  • MCP Client: Consumes AI model completion services from the server
  • Tool Integration: Demonstrates how to expose Java methods as callable tools for AI models
  • REST API: Exposes a REST endpoint for users to submit questions
  • Server-Sent Events (SSE): Uses SSE for communication between server and client

Prerequisites

  • Java 17 or higher
  • Maven 3.6 or higher
  • OpenAI API key (for the client component)

Installation and Setup

  1. Clone the repository:

    git clone https://github.com/stylepatrick/spring-ai-mcp-server-client.git
    cd spring-ai-mcp-server-client
    
  2. Build the server component:

    cd mcp-server
    mvn clean install
    
  3. Build the client component:

    cd ../mcp-client
    mvn clean install
    
  4. Update the OpenAI API key in mcp-client/src/main/resources/application.yml with your own API key.

Usage

  1. Start the server component:

    cd mcp-server
    mvn spring-boot:run
    
  2. Start the client component:

    cd mcp-client
    mvn spring-boot:run
    
  3. Send a question to the client component:

    curl -X POST "http://localhost:8081/question?question=What%20is%202%20plus%203?"
    

Configuration

Server Configuration

The server component is configured in mcp-server/src/main/resources/application.yaml:

spring:
  application:
    name: mcp-server
  ai:
    mcp:
      server:
        sse-endpoint: /api/v1/sse
        sse-message-endpoint: /api/v1/mcp
        type: sync

logging:
  level:
    io.modelcontextprotocol: TRACE
    org.springframework.ai.mcp: TRACE

Client Configuration

The client component is configured in mcp-client/src/main/resources/application.yml:

spring:
  application:
    name: mcp-client
  ai:
    openai:
      api-key: your-api-key
    mcp:
      client:
        toolcallback:
          enabled: true
        sse:
          connections:
            server1:
              url: http://localhost:8080
              sse-endpoint: /api/v1/sse

server:
  port: 8081

Project Structure

  • mcp-server: Server component that provides AI model completion services

    • McpServerApplication.java: Main application class
    • tools/MathTools.java: Mathematical tools that can be called by AI models
    • tools/ToolConfig.java: Configuration for tool callback provider
  • mcp-client: Client component that consumes AI model completion services

    • McpClientApplication.java: Main application class
    • resource/MyController.java: REST controller for handling user questions
    • service/MyService.java: Service for processing questions using ChatClient

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2025 stylepatrick

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About Spring AI MCP Server Client

How do I install Spring AI MCP Server Client?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Spring AI MCP Server Client safe to use with an AI agent?

Its trust score is 34 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Spring AI MCP Server Client still maintained?

Conduid hasn't recorded a commit date for this repository yet. Check the repository directly for recent activity.