[Feature] Dubbo MCP Integration Proposal
Pre-check
Before we dive into the proposal, we've made sure to:
- Ensure all content is in English.
- Search the issues and found no similar feature requirement.
Apache Dubbo Component
Java SDK (apache/dubbo)
Descriptions
Background
To better help developers expose Dubbo services as AI capabilities and enhance the integration with AI systems, we propose integrating the MCP (Model Control Protocol) with Dubbo. This integration will:
- Support automatic service export as MCP tools
- Enable client-side invocation based on MCP SSE mode
Overview
This proposal outlines the integration of Apache Dubbo with MCP, enabling Dubbo services to be exposed as MCP tools. This integration facilitates seamless communication between Dubbo services and MCP-compatible systems.
Features
1. Configuration Options
The following configuration options will be available to enable MCP integration:
dubbo.mcp.enabled
: Enable/disable MCP integration (default: false)dubbo.mcp.sse.endpoint
: Server-Sent Events (SSE) endpoint path (default:/dubbo/mcp/sse
)
Note: These configuration options are only available when using the Triple protocol. Non-Triple protocols will result in an error. This version only supports the Triple-REST protocol.
2. Core Functionality
The core functionality of the MCP integration will include:
- Automatic SSE connection establishment through the configured endpoint
- Support for
@DubboService
annotation to register Dubbo interface methods as MCP tools - Annotation attributes:
mcp
: Enable/disable MCP server (default: false)
- Automatic data retrieval from Triple OpenAPI when annotation attributes are empty
Implementation Details
Service Initialization
- During application startup, verify
mcp.server.enabled=true
- If enabled, automatically register a Triple protocol server
- Expose the configured SSE endpoint
Service Registration
- Scan services for
@DubboService
annotations - Validate methods to ensure Triple protocol compatibility
- For annotated services:
- Register name and description with MCP
- Convert method parameters to JSON Schema
- Register with McpServer using mcp-java-sdk
Impact
The MCP integration will have the following impact:
- New feature addition
- No breaking changes to existing functionality
- Requires Triple protocol support
Alternatives Considered
We considered the following alternatives:
- Direct integration without MCP protocol
- Custom protocol implementation
References
- MCP Protocol Specification
- Triple Protocol Documentation
Related issues
No response
Are you willing to submit a pull request to fix on your own?
- [ ] Yes I am willing to submit a pull request on my own!
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Benefits of MCP Integration
The MCP integration will provide several benefits, including:
- Improved AI capabilities: By exposing Dubbo services as MCP tools, can enhance the integration with AI systems.
- Seamless communication: The integration facilitates seamless communication between Dubbo services and MCP-compatible systems.
- Easy service export: The automatic service export feature makes it easy to expose Dubbo services as MCP tools.
Implementation Roadmap
The implementation roadmap for the MCP integration will include the following steps:
- Design and planning: Define the architecture and requirements for the MCP integration.
- Implementation: Implement the MCP integration, including the configuration options, core functionality, and service registration.
- Testing: Test the MCP integration to ensure it works as expected.
- Deployment: Deploy the MCP integration to the Dubbo ecosystem.
Conclusion
Frequently Asked Questions
We've compiled a list of frequently asked questions to help you better understand the Dubbo MCP integration proposal.
Q: What is the MCP integration proposal?
A: The MCP integration proposal is a feature that enables Dubbo services to be exposed as MCP tools, facilitating seamless communication between Dubbo services and MCP-compatible systems.
Q: What are the benefits of the MCP integration?
A: The MCP integration provides several benefits, including:
- Improved AI capabilities: By exposing Dubbo services as MCP tools, can enhance the integration with AI systems.
- Seamless communication: The integration facilitates seamless communication between Dubbo services and MCP-compatible systems.
- Easy service export: The automatic service export feature makes it easy to expose Dubbo services as MCP tools.
Q: What are the configuration options for the MCP integration?
A: The following configuration options will be available to enable MCP integration:
dubbo.mcp.enabled
: Enable/disable MCP integration (default: false)dubbo.mcp.sse.endpoint
: Server-Sent Events (SSE) endpoint path (default:/dubbo/mcp/sse
)
Q: What is the core functionality of the MCP integration?
A: The core functionality of the MCP integration includes:
- Automatic SSE connection establishment through the configured endpoint
- Support for
@DubboService
annotation to register Dubbo interface methods as MCP tools - Annotation attributes:
mcp
: Enable/disable MCP server (default: false)
- Automatic data retrieval from Triple OpenAPI when annotation attributes are empty
Q: How will the MCP integration be implemented?
A: The implementation roadmap for the MCP integration will include the following steps:
- Design and planning: Define the architecture and requirements for the MCP integration.
- Implementation: Implement the MCP integration, including the configuration options, core functionality, and service registration.
- Testing: Test the MCP integration to ensure it works as expected.
- Deployment: Deploy the MCP integration to the Dubbo ecosystem.
Q: What are the alternatives to the MCP integration?
A: We considered the following alternatives:
- Direct integration without MCP protocol
- Custom protocol implementation
Q: What are the references for the MCP integration?
A: The following references will be used for the MCP integration:
- MCP Protocol Specification
- Triple Protocol Documentation
Q: What is the impact of the MCP integration?
A: The MCP integration will have the following impact:
- New feature addition
- No breaking changes to existing functionality
- Requires Triple protocol support
Q: How can I get involved in the MCP integration?
A: If you're interested in contributing to the MCP integration, please submit a pull request or join the discussion on the Dubbo issue tracker.
Related Resources
Conclusion
The MCP proposal provides a valuable addition to the Dubbo ecosystem, enabling seamless communication between Dubbo services and MCP-compatible systems. We hope this Q&A article has helped you better understand the proposal and its benefits. If you have any further questions, please don't hesitate to reach out.