Skip to content

Conversation

@freeznet
Copy link
Member

making pulsar functions be able to exported as MCP tools

@freeznet freeznet self-assigned this May 19, 2025
@freeznet freeznet requested a review from a team as a code owner May 19, 2025 14:33
@freeznet freeznet marked this pull request as draft May 20, 2025 05:03
@freeznet freeznet marked this pull request as ready for review May 20, 2025 17:28
@freeznet freeznet requested a review from Copilot May 20, 2025 17:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors various MCP tool handlers to use helper functions from the common package and adds the new "functions-as-tools" feature, enabling Pulsar Functions to be dynamically exposed as MCP tools. Key changes include updating function calls (e.g. getOptions, requiredParam, optionalParam) to their common counterparts, bumping the mcp-go dependency version, and documentation and Makefile updates for licensing and feature support.

Reviewed Changes

Copilot reviewed 68 out of 68 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/mcp/prompts.go Replace local utility calls with common.* helper functions
pkg/mcp/kafka_client_produce_tools.go Update parameter retrieval to use common.RequiredParam/OptionalParam
pkg/mcp/kafka_client_consume_tools.go Update parameter retrieval to use common.RequiredParam/OptionalParam
pkg/mcp/kafka_admin_topics_tools.go Replace local utility calls with common.* helper functions
pkg/mcp/kafka_admin_sr_tools.go Update parameter retrieval to use common.RequiredParam/OptionalParam
pkg/mcp/kafka_admin_partitions_tools.go Replace local utility calls with common.* helper functions
pkg/mcp/kafka_admin_groups_tools.go Replace local utility calls with common.* helper functions
pkg/mcp/kafka_admin_connect_tools.go Update parameter retrieval and conversion to use common.* functions
pkg/mcp/features.go Add new feature constant "functions-as-tools"
pkg/mcp/context_utils.go Replace internal calls with common.* helper functions
pkg/mcp/context_tools.go Replace context value retrieval and parameter functions with common.*
pkg/common/utils.go Rename utility functions for consistency and add numeric type checks
pkg/cmd/mcp/stdio.go Update context key usage to refer to common.OptionsKey
pkg/cmd/mcp/sse.go Update context key and server shutdown calls to use common values
go.work.sum & go.mod Bump mcp-go dependency to v0.28.0 and add additional dependencies
docs/tools/functions_as_tools.md Add documentation for dynamically exposing Pulsar Functions as tools
README.md Update feature table with "functions-as-tools" entry
Makefile & .licenserc.yaml Add/update licensing tasks and configuration

@freeznet freeznet merged commit 372c548 into main May 28, 2025
9 checks passed
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.

3 participants