spring-projects / spring-projects/spring-ai

Bug description When both spring.application.name and spring.ai.mcp.server.name are configured in MCP server, client cannot connect to or call server tools due to name resolution conflict.

Open
#4,319 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 10h
Merged PRs (30d)
5

Description

Environment

Spring AI: 1.0.1

Spring Boot: 3.5.0

Java: 21

Transport: STDIO

Steps to reproduce

Configure server with both names:

yaml
spring:
application:
name: my-spring-app
ai:
mcp:
server:
name: my-mcp-server
transport: stdio
Start server and client applications

Client fails to connect with timeout or protocol errors

Server tools are not discoverable by client

Expected behavior

Client should successfully connect to server using configured name

Server tools should be discoverable and callable from client

Clear documentation on proper name configuration

Minimal example

Server config (problematic):

yaml

application.yml

spring:
application:
name: app-server
ai:
mcp:
server:
name: mcp-server # Conflict causes client connection failure

Client config:

yaml
spring:
ai:
mcp:
client:
servers:
mcp-server: # Cannot resolve due to server name conflict
command: "java"
args: ["-jar", "server.jar"]
Observed behavior:

Client timeout during connection attempt

Mono.deferContextual timeout errors

Server tools not registered in client tool registry

No protocol handshake completion

Workaround:
Use only one name configuration in server:

yaml

Option A: Use only MCP server name

spring:
ai:
mcp:
server:
name: mcp-server # Client uses this name

Option B: Use only Spring app name

spring:
application:
name: mcp-server # Client uses this name

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the server and client configurations shown, using both spring.application.name and spring.ai.mcp.server.name. Trace the name resolution and STDIO connection path to identify the conflict; done means the handshake completes and the client discovers and calls the server tools.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.