Commit Graph

22 Commits

Author SHA1 Message Date
Christian Tzolov
b98aecb03b Add MCP annotations sample project
Demonstrates the use of Spring AI MCP annotations for creating an MCP server.

- Add @McpComplete, @McpArg, @McpResource, @McpPrompt handlers

The project showcases how to use Spring AI's annotation-based approach to easily expose tools, resources, prompts, and completions through an MCP server.

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-05-06 14:20:57 +02:00
Christian Tzolov
2c9fa4d8fd Add dynamic tool update example for Model Context Protocol
Implement a new example demonstrating how MCP servers can dynamically update available tools
at runtime and how clients can detect these changes.

- Add Server implementation that starts with weather forecast tools and dynamically adds math operation tools
- Add Client implementation that detects tool changes via MCP notifications
- Complete client/server architecture with proper tool registration and discovery
- Add detailed README explaining the dynamic tool update process and implementation

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-05-02 11:27:30 +03:00
Christian Tzolov
5ca8720387 Add Prompt Egineering examples 2025-04-14 09:12:16 +02:00
Soby Chacko
7e04dc20f9 Update Spring AI dependencies to 1.0.0-SNAPSHOT (#21)
- Update Spring AI version from 1.0.0-M5 to 1.0.0-SNAPSHOT across all modules
- Update artifact IDs to match new naming convention (spring-ai-*-spring-boot-starter → spring-ai-starter-model-*)
- Add central-portal-snapshots repository to all projects for SNAPSHOT dependency resolution
- Standardize repository URLs to use repo.spring.io/milestone instead of libs-milestone-local
- Remove the obsolete spring-ai-core dependency in Kotlin modules
- Update QuestionAnswerAdvisor import path in rag-with-kotlin
- Reorganize root POM module ordering for better organization

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-04-10 20:27:35 +02:00
Christian Tzolov
804d3aadef add the starter-webmvc-oauth2-server to the pom
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-04-10 13:52:41 +02:00
Christian Tzolov
41c921bc33 refactor: update MCP API usage to version 0.8.0
- Remove all book-library MCP examples (servlet, webflux, and webmvc implementations)
- Update weather example to use MCP version 0.8.0-SNAPSHOT
- Refactor transport handling to use transport providers instead of direct transport objects
- Update method calls from toSyncToolRegistration to toSyncToolSpecifications
- Add central-portal-snapshots repository to pom.xml for dependency resolution
- Align with the new MCP client class names

Add MCP Sampling capability with weather example

Adds MCP Sampling implementation that demonstrates how to delegate LLM requests to multiple providers.

- add a weather server that retrieves data and uses MCP Sampling to generate creative content
- add a client that routes requests to different LLM providers (OpenAI and Anthropic) based on model hints
- add README documentation explaining the MCP Sampling workflow and implementation details

The MCP Sampling capability enables applications to leverage multiple LLM providers within a single workflow,
allowing for creative content generation, model comparison, and specialized task delegation.

refactor: migrate to spring-ai-mcp-client-spring-boot-starter

- Replace spring-ai-mcp dependency with spring-ai-mcp-client-spring-boot-starter
- Update import statements from org.springframework.ai.mcp.* to io.modelcontextprotocol.client.*
- Replace McpFunctionCallback with SyncMcpToolCallbackProvider
- Update Spring AI version from 1.0.0-M5 to 1.0.0-SNAPSHOT in multiple projects
- Enable tool callback auto-configuration with spring.ai.mcp.client.toolcallback.enabled

refactor: update Spring AI artifact IDs to new naming convention

- Update all Spring AI dependencies to use the new naming convention:
spring-ai-*-spring-boot-starter → spring-ai-starter-*
spring-ai-openai-spring-boot-starter → spring-ai-starter-model-openai
spring-ai-mcp-client-spring-boot-starter → spring-ai-starter-mcp-client
- And similar patterns for other artifacts
- Enable debug mode in brave module's application.properties

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-25 15:05:27 -04:00
Christian Tzolov
9da4fd9068 Add mcp weather webmvc starter example 2025-02-13 17:56:21 +01:00
Mark Pollack
430d886a3b fix pom 2025-02-10 21:46:01 -05:00
Christian Tzolov
cf529d6940 move the brave client starters under the web-search folder
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-10 11:41:45 +01:00
Christian Tzolov
a29ea2b743 Restructure
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-09 22:05:35 +01:00
Christian Tzolov
dac5e7bd6e Add MCP weather servers and Brave integration examples
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-05 17:39:31 -05:00
Christian Tzolov
28dd0728c6 Fix package name typo 2025-01-20 12:43:50 +01:00
Christian Tzolov
648b0ac822 Add Agentid System Patterns Demos
Based on the Building Effective Agents Cookbook

- https://www.anthropic.com/research/building-effective-agents
- https://github.com/anthropics/anthropic-cookbook/tree/main/patterns/agents
2025-01-20 10:40:21 +01:00
Christian Tzolov
ba07215c48 Add MCP Servlet SSE demo 2025-01-13 09:11:17 +01:00
Christian Tzolov
f753efc483 Add MCP WebFlux Client+Server example 2025-01-11 17:48:21 +01:00
Christian Tzolov
d5a016cbd2 Add MCP WebMvc Server + HttpClient sample 2025-01-11 17:31:35 +01:00
Christian Tzolov
6c301868e3 Add MCP Brave demo 2024-12-12 00:02:11 +01:00
Christian Tzolov
88eddf648e add mcp filesystem demo 2024-12-11 12:14:30 +01:00
Christian Tzolov
2e103b6245 improve the MCP sqlite demos 2024-12-11 10:52:16 +01:00
Soby Chacko
151d05bc09 Openai streaming data example 2024-11-21 17:01:27 -05:00
Soby Chacko
ec87de07ee Java based function callback demo 2024-11-21 16:40:42 -05:00
Soby Chacko
2643097094 Kotlin sample apps cleanup 2024-11-21 16:04:44 -05:00