Spring AI and Java MCP ChatBot Prototype #11783
Draft
+901
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Spring AI integration with database query tools for REST API and MCP protocol
Overview
This PR integrates Spring AI into cBioPortal to enable AI-powered natural language querying of the cancer genomics database. The implementation is built on our existing backend infrastructure and supports two deployment modes.
Usage
MCP Server Mode
application-mcp.propertiesmvn clean package -Pmcp -DskipTests{ "mcpServers": { "cbioportal-assistant": { "command": "java", "args": [ "-jar", "/path/to/cbioportal/target/cbioportal-mcp-server-exec.jar", "--spring.profiles.active=mcp,clickhouse" ] } } }REST API Mode
application.properties:mvn spring-boot:run -Dspring-boot.run.profiles=clickhousecurl -X POST http://localhost:8080/api/ai/chat \ -H "Content-Type: application/json" \ -d '{"message": "How many cancer studies are in the database?"}'curl -N http://localhost:8080/api/ai/chat/stream \ -H "Content-Type: application/json" \ -d '{"message": "Show me the top 5 mutation types"}'What's Implemented
Core AI Tools
REST API Mode
/api/ai/chatendpoint for conversational database queriesMCP Server Mode
Advantages
Technical Details
mcpfor standalone packagingTesting Status