Zhianii opened a new pull request, #17:
URL: https://github.com/apache/pulsar-java-contrib/pull/17
<!--
### Contribution Checklist
- PR title format should be *[type][component] summary*. For details, see
*[Guideline - Pulsar PR Naming
Convention](https://pulsar.apache.org/contribute/develop-semantic-title/)*.
- Please fill out the template below to describe the changes contributed
by this pull request, so that reviewers have the necessary context.
- Each pull request should address only one issue, not mix code from
multiple issues.
- Each commit in the pull request must have a meaningful commit message.
- Once all checklist items are addressed, remove the above text and keep
only the filled-out template below.
-->
Fixes #PCIP-6 Implement the MCP for Pulsar Admin Tool
Main Issue: #PCIP-6 Implement the MCP for Pulsar Admin Tool
### Motivation
This PR introduces the **MCP (Model Context Protocol) server
implementation** for Pulsar Admin operations.
The motivation is to enable **AI assistants** (such as Claude Desktop) to
interact with Apache Pulsar clusters using natural language.
Through MCP, Pulsar administration capabilities are exposed via a
standardized protocol, improving automation and intelligent integration.
### Modifications
- Added **MCP server layer**: `StdioMCPServer` and `HttpMCPServer`,
supporting **STDIO** and **HTTP Streaming** transports
- Implemented **PulsarClientManager** to manage the lifecycle of
`PulsarAdmin` and `PulsarClient`, with lazy initialization and thread safety
- Developed **70 MCP tool commands**, covering:
- Cluster / Tenant / Namespace / Topic / Subscription management
- Schema operations
- Monitoring and backlog analysis
- Message send and receive
- Introduced **BasePulsarTools** base class for parameter validation, error
handling, and response encapsulation
- Enhanced documentation with **Quick Start, FAQ, and natural language
interaction demos** (README)
### Verifying this change
- Verified in local Standalone Pulsar environment
(`pulsar://localhost:6650`, `http://localhost:8080`)
- Tested both transport modes:
- **STDIO mode**: Successfully integrated with Claude Desktop
- **HTTP mode**: Server responded correctly at `/mcp`
- Example validation:
- Successfully executed `list-tenants`, `create-namespace`,
`get-topic-stats`, etc.
- Verified schema upload and compatibility checks
- Validated backlog analysis and health check tools
*(This change has been tested through new integration tests and validated
against a real Pulsar cluster.)*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]