Minor updates to client-starter/starter-default-client and starter-webflux-client

This commit is contained in:
Mark Pollack
2025-02-11 00:01:51 -05:00
parent e3f0bd1f8b
commit 4c00795154
4 changed files with 20 additions and 5 deletions

View File

@@ -6,16 +6,20 @@ Follow the [MCP Client Boot Starter](https://docs.spring.io/spring-ai/reference/
## Overview
The project uses Spring Boot and Spring AI to create a command-line application that:
The project uses Spring Boot and Spring AI to create a command-line application that demonstrates MCP server integration. The application:
- Connects to MCP servers using STDIO and/or SSE (HttpClient-based) transports
- Integrates with Spring AI's chat capabilities
- Demonstrates tool execution through MCP servers
- Takes a user-defined question via the `-Dai.user.input` command-line property, which is mapped to a Spring `@Value` annotation in the code
For example, running the application with `-Dai.user.input="Does Spring AI support MCP?"` will inject this question into the application through Spring's property injection, and the application will use it to query the MCP server.
## Prerequisites
- Java 17 or later
- Maven 3.6+
- Anthropic API key (for Claude AI model)
- Anthropic API key (Claude) (Get one at https://docs.anthropic.com/en/docs/initial-setup)
- Brave Search API key (Get one at https://brave.com/search/api/)
## Dependencies
@@ -107,7 +111,7 @@ The application demonstrates a simple command-line interaction with an AI model
1. The application starts and configures multiple MCP Clients (one for each provided STDIO or SSE connection configuration)
2. It builds a ChatClient with the configured MCP tools
3. Sends a predefined question (set vi the `ai.user.input` property) to the AI model
3. Sends a predefined question (set via the `ai.user.input` property) to the AI model
4. Displays the AI's response
5. Automatically closes the application
@@ -116,6 +120,7 @@ The application demonstrates a simple command-line interaction with an AI model
1. Set the required environment variable:
```bash
export ANTHROPIC_API_KEY=your-api-key
export BRAVE_API_KEY='your-brave-api-key-here'
```
2. Build the application:

View File

@@ -11,4 +11,7 @@ spring.ai.mcp.client.stdio.connections.brave-search.args=-y,@modelcontextprotoco
# spring.ai.mcp.client.stdio.connections.brave-search.env.FOO=BAAR
logging.level.io.modelcontextprotocol.client=WARN
logging.level.io.modelcontextprotocol.spec=WARN
ai.user.input=What tools are available?

View File

@@ -6,16 +6,20 @@ Follow the [MCP Client Boot Starter](https://docs.spring.io/spring-ai/reference/
## Overview
The project uses Spring Boot and Spring AI to create a command-line application that:
The project uses Spring Boot and Spring AI to create a command-line application that demonstrates MCP server integration with WebFlux. The application:
- Connects to MCP servers using STDIO and/or SSE (WebFlux-based) transports
- Integrates with Spring AI's chat capabilities
- Demonstrates tool execution through MCP servers
- Takes a user-defined question via the `-Dai.user.input` command-line property, which is mapped to a Spring `@Value` annotation in the code
For example, running the application with `-Dai.user.input="Does Spring AI support MCP?"` will inject this question into the application through Spring's property injection, and the application will use it to query the MCP server using WebFlux's reactive programming model.
## Prerequisites
- Java 17 or later
- Maven 3.6+
- Anthropic API key (for Claude AI model)
- Anthropic API key (Claude) (Get one at https://docs.anthropic.com/en/docs/initial-setup)
- Brave Search API key (Get one at https://brave.com/search/api/)
## Dependencies
@@ -116,6 +120,7 @@ The application demonstrates a simple command-line interaction with an AI model
1. Set the required environment variable:
```bash
export ANTHROPIC_API_KEY=your-api-key
export BRAVE_API_KEY='your-brave-api-key-here'
```
2. Build the application:

View File

@@ -10,5 +10,7 @@ spring.ai.mcp.client.stdio.connections.brave-search.command=npx
spring.ai.mcp.client.stdio.connections.brave-search.args=-y,@modelcontextprotocol/server-brave-search
# spring.ai.mcp.client.stdio.connections.brave-search.env.FOO=BAAR
logging.level.io.modelcontextprotocol.client=WARN
logging.level.io.modelcontextprotocol.spec=WARN
ai.user.input=What tools are available?