Skip to content

[Feature] Dubbo MCP Integration Proposal #15332

@RainYuY

Description

@RainYuY

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in 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

  • 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

  • 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

  1. During application startup, verify mcp.server.enabled=true
  2. If enabled, automatically register a Triple protocol server
  3. Expose the configured SSE endpoint

Service Registration

  1. Scan services for @DubboService annotations
  2. Validate methods to ensure Triple protocol compatibility
  3. For annotated services:
    • Register name and description with MCP
    • Convert method parameters to JSON Schema
    • Register with McpServer using mcp-java-sdk

Impact

  • New feature addition
  • No breaking changes to existing functionality
  • Requires Triple protocol support

Alternatives Considered

  • 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

Sub-issues

Metadata

Metadata

Labels

type/enhancementEverything related with code enhancement or performancetype/proposalEverything you want Dubbo have

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions