Skip to content

Conversation

digitzh
Copy link
Contributor

@digitzh digitzh commented Sep 9, 2025

Describe what this PR does / why we need it

This PR read config of MCP services from a database(MySQL, etc.).

Used in the module spring-ai-alibaba-mcp-router currently.

Does this pull request fix one issue?

Describe how you did it

在配置类DbMcpProperties中配置数据库信息,通过类DbMcpServiceDiscovery从数据库获取MCP服务信息(SQL查询)。

Describe how to verify it

example仓库:spring-ai-alibaba-mcp-example/spring-ai-alibaba-mcp-config-example(示例程序已提交PR,可能尚未合并)给出了测试方法。简单来说,配置连接信息,在数据库中创建示例数据;运行测试程序、发送HTTP GET请求即可查询到服务信息。

Special notes for reviews

@GTyingzi
Copy link
Collaborator

GTyingzi commented Sep 9, 2025

另外记得,每一个文件都末尾记得留一个空白行

@Aias00
Copy link
Collaborator

Aias00 commented Sep 16, 2025

hi. fix ci pls

@Aias00 Aias00 requested a review from Copilot September 18, 2025 06:15
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds database support for MCP (Model Context Protocol) service configuration, allowing services to be read from databases like MySQL instead of being limited to file-based configuration.

  • Introduces database-based service discovery via DbMcpServiceDiscovery with configurable SQL queries
  • Adds file-based service discovery as an alternative to the existing Nacos-based approach
  • Implements auto-configuration classes to support multiple discovery types (nacos, file, database)

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
DbMcpServiceDiscovery.java New service discovery implementation that queries database for MCP service configurations
FileConfigMcpServiceDiscovery.java New file-based service discovery implementation for local configuration
DbMcpProperties.java Configuration properties for database connection and query settings
McpRouterProperties.java Enhanced to support multiple discovery types and service configurations
pom.xml Added HikariCP dependency for database connection pooling
FileMcpRouterAutoConfiguration.java Auto-configuration for file-based service discovery
DbMcpRouterAutoConfiguration.java Auto-configuration for database-based service discovery
org.springframework.boot.autoconfigure.AutoConfiguration.imports Registered new auto-configuration classes
DashScopeMultiModalChatTests.java Updated comment to reference correct environment variable name

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core SAA Core module area/mcp SAA MCP Module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants