AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Spring Ai Mcp Server Client

mcp-stylepatrick-spring-ai-mcp-server-client · by stylepatrick

Spring AI MCP Server and Client

No reviews yet
0 installs
38 views
0.0% view→install

Install

$ agentstack add mcp-stylepatrick-spring-ai-mcp-server-client

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-stylepatrick-spring-ai-mcp-server-client)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
stale · 1y ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Spring Ai Mcp Server Client? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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:

``bash git clone https://github.com/stylepatrick/spring-ai-mcp-server-client.git cd spring-ai-mcp-server-client ``

  1. Build the server component:

``bash cd mcp-server mvn clean install ``

  1. Build the client component:

``bash cd ../mcp-client mvn clean install ``

  1. Update the OpenAI API key in mcp-client/src/main/resources/application.yml with your own API key.

Usage

  1. Start the server component:

``bash cd mcp-server mvn spring-boot:run ``

  1. Start the client component:

``bash cd mcp-client mvn spring-boot:run ``

  1. Send a question to the client component:

``bash 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](LICENSE) file for details.

Copyright (c) 2025 stylepatrick

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.