feat: split MCP tools for Claude connector#101
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the StreamNative MCP Server tool surface to better match Claude connector review requirements by splitting previously mixed read/write admin tools into separate MCP tools and by consistently setting MCP tool safety annotations (read-only vs destructive), with read-only mode excluding write-capable tools.
Changes:
- Split multiple Kafka and Pulsar admin tools into distinct
*_readand*_writetools with mode-specificoperationenums. - Introduce a shared
pkg/mcp/toolannotationshelper and apply annotations across static tools, builders, and dynamic Functions-as-Tools. - Add compliance-focused tests to ensure titles/annotations are present and write tools are excluded in
--read-only, plus doc updates reflecting the new tool naming.
Reviewed changes
Copilot reviewed 68 out of 72 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Document Claude connector compatibility behavior and tool split semantics |
| PLAN.md | Add implementation plan and compliance checklist for tool split/annotations |
| pkg/mcp/toolannotations/annotations.go | New helper for consistent MCP tool safety annotations |
| pkg/mcp/streamnative_resources_tools.go | Apply destructive annotation helper to SN Cloud resource tools |
| pkg/mcp/streamnative_resources_log_tools.go | Mark SN Cloud logs tool as read-only via helper |
| pkg/mcp/static_tool_annotations_test.go | Add tests validating StreamNative static/context tool annotations |
| pkg/mcp/sncontext_tools.go | Add annotations + gate context-mutation tools behind read-only |
| pkg/mcp/pftools/manager.go | Mark dynamic function tools destructive; skip registration in read-only |
| pkg/mcp/builders/pulsar/topic.go | Split Pulsar topic tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/topic_test.go | Update tests for split topic tool + updated error text |
| pkg/mcp/builders/pulsar/topic_policy.go | Split topic policy tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/topic_policy_test.go | Update tests for split topic policy tool + updated error text |
| pkg/mcp/builders/pulsar/tool_mode.go | Add shared read/write mode helpers for Pulsar builders |
| pkg/mcp/builders/pulsar/tenant.go | Split tenant tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/subscription.go | Split subscription tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/status.go | Add read-only annotation/title to status tool |
| pkg/mcp/builders/pulsar/sources.go | Split sources tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/sinks.go | Split sinks tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/schema.go | Split schema tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/resourcequotas.go | Split resource quota tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/produce.go | Mark Pulsar produce tool destructive with title |
| pkg/mcp/builders/pulsar/packages.go | Split packages tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/nsisolationpolicy.go | Split ns-isolation-policy tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/namespace.go | Split namespace tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/namespace_policy.go | Add annotations/titles to namespace policy get/set/remove tools |
| pkg/mcp/builders/pulsar/functions.go | Split functions tool into read/write variants; adjust download classification |
| pkg/mcp/builders/pulsar/functions_worker.go | Add read-only annotation/title to functions worker tool |
| pkg/mcp/builders/pulsar/functions_test.go | Update functions builder test for read/write tool list |
| pkg/mcp/builders/pulsar/functions_parity_test.go | Update parity expectations for download being read-mode |
| pkg/mcp/builders/pulsar/feature_gates_test.go | Update feature-gate tests for read/write tool pairs |
| pkg/mcp/builders/pulsar/consume.go | Mark Pulsar consume tool destructive; skip in read-only mode |
| pkg/mcp/builders/pulsar/cluster.go | Split cluster tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/brokers.go | Split brokers tool into read/write variants with enums + annotations |
| pkg/mcp/builders/pulsar/brokers_stats.go | Add read-only annotation/title to broker stats tool |
| pkg/mcp/builders/pulsar/annotation_compliance_test.go | Add Pulsar-wide annotation/mode compliance tests |
| pkg/mcp/builders/kafka/topics.go | Split Kafka topics tool into read/write variants with enums + annotations |
| pkg/mcp/builders/kafka/tool_mode.go | Add shared read/write mode helpers for Kafka builders |
| pkg/mcp/builders/kafka/schema_registry.go | Split schema registry tool into read/write variants with enums + annotations |
| pkg/mcp/builders/kafka/produce.go | Mark Kafka produce tool destructive with title |
| pkg/mcp/builders/kafka/partitions.go | Rename partitions tool to write-only; skip in read-only; annotate destructive |
| pkg/mcp/builders/kafka/groups.go | Split Kafka groups tool into read/write variants with enums + annotations |
| pkg/mcp/builders/kafka/consume.go | Mark Kafka consume tool destructive; skip in read-only mode |
| pkg/mcp/builders/kafka/connect.go | Split Kafka connect tool into read/write variants with enums + annotations |
| pkg/mcp/builders/kafka/connect_test.go | Update Kafka connect tests for split tool behavior |
| pkg/mcp/builders/kafka/annotation_compliance_test.go | Add Kafka-wide annotation/mode compliance tests |
| pkg/cmd/mcp/server.go | Plumb read-only flag into context tool registration |
| docs/tools/streamnative_cloud.md | Whitespace cleanup; keep docs aligned |
| docs/tools/pulsar_client_produce.md | Minor formatting cleanup |
| docs/tools/pulsar_client_consume.md | Document destructive + read-only-mode exclusion |
| docs/tools/pulsar_admin_topics.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_topic_policy.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_tenants.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_subscriptions.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_sources.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_sinks.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_schemas.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_resource_quotas.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_packages.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_nsisolationpolicy.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_namespaces.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_functions.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_clusters.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_brokers.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/pulsar_admin_broker_stats.md | Formatting cleanup |
| docs/tools/kafka_client_produce.md | Minor formatting cleanup |
| docs/tools/kafka_client_consume.md | Document destructive + read-only-mode exclusion |
| docs/tools/kafka_admin_topics.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/kafka_admin_schema_registry.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/kafka_admin_partitions.md | Note write-only tool name + read-only-mode exclusion |
| docs/tools/kafka_admin_groups.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/kafka_admin_connect.md | Note actual *_read/*_write tools for Claude safety |
| docs/tools/functions_as_tools.md | Document destructive + read-only-mode exclusion for dynamic tools |
jiangpengcheng
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.