Skip to content

feat: add Model Context Protocol (MCP) server with HTTP transport and authentication#1468

Open
YuZhangLarry wants to merge 1 commit intoapache:aifrom
YuZhangLarry:mcp-to-ai
Open

feat: add Model Context Protocol (MCP) server with HTTP transport and authentication#1468
YuZhangLarry wants to merge 1 commit intoapache:aifrom
YuZhangLarry:mcp-to-ai

Conversation

@YuZhangLarry
Copy link
Copy Markdown

Summary

Implement Model Context Protocol (MCP) server for Dubbo Admin to enable AI integration through standardized tool interfaces. This allows AI assistants (like Claude) to directly interact with Dubbo resources.

Architecture

Core Components

  • Server (pkg/mcp/core/): MCP protocol implementation with JSON-RPC 2.0
  • Registry (pkg/mcp/registry/): Tool registration and management
  • Tools (pkg/mcp/tools/): 11 tools for Dubbo resource operations
  • Transport (pkg/mcp/transport/): Stdio and HTTP transport layers
  • Types (pkg/mcp/types/): Request/response schemas and validation

Transport Layers

  • Stdio: For local Claude Desktop integration via stdin/stdout
  • HTTP: For remote connections with CORS and SSE support
  • Authentication: Optional Bearer Token for HTTP endpoint

Tool Categories

  • Cluster: get_cluster_info, global_search
  • Service: search_services, get_service_detail, get_service_instances
  • Instance: search_instances, get_instance_detail, get_instance_metrics
  • Application: get_application_detail, get_application_instances, get_application_services

Configuration

mcp:
  enabled: true
  path: /api/mcp
  apiKey: "your-secret-key"  # Optional
**Please check any characteristics that apply to this pull request.**

…t and authentication

## Summary
Implement Model Context Protocol (MCP) server for Dubbo Admin to enable AI integration through standardized tool interfaces.

## Key Features
- **Modular Architecture**: Core components (server, registry, tools, transport, types)
- **Comprehensive Tool Support**: 11 tools covering cluster info, service discovery, instance management, metrics, and application details
- **Dual Transport Support**:
  - Stdio transport for local Claude Desktop integration
  - HTTP transport for remote connections with JSON-RPC 2.0
- **Security**: Optional Bearer Token authentication for HTTP endpoint

## Configuration

## Test plan
- [x] Unit tests for core components
- [x] Integration tests
- [x] Manual testing with Claude Desktop

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant