-
Notifications
You must be signed in to change notification settings - Fork 617
Add MCP support for Redpanda Cloud #25802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
a2aa6a8
to
b3f3616
Compare
@@ -41,6 +42,7 @@ require ( | |||
github.com/pkg/errors v0.9.1 | |||
github.com/prometheus/client_model v0.6.1 | |||
github.com/prometheus/common v0.62.0 | |||
github.com/redpanda-data/common-go/proto v0.0.0-20250416183016-0cd4089182bd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to pull *pb.mcp.go
files
this is currently on a branch, i will update before merging
Organization iamv1connect.OrganizationServiceClient | ||
ResourceGroup controlplanev1connect.ResourceGroupServiceClient | ||
Serverless controlplanev1connect.ServerlessClusterServiceClient | ||
Region controlplanev1connect.RegionServiceClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added missing clients
@@ -33,6 +33,15 @@ func newAuthInterceptor(token string) connect.UnaryInterceptorFunc { | |||
} | |||
} | |||
|
|||
func newReloadingAuthInterceptor(f func() string) connect.UnaryInterceptorFunc { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is a specialized interceptor, that does not use a static token. instead, it can call a function that provides the token (which can be refreshed in the background)
8022cf2
to
875fa5d
Compare
Use: "install [claude]", | ||
Short: "Install Redpanda Cloud MCP server. Only Claude Desktop is supported at this time.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use: "install [claude]", | |
Short: "Install Redpanda Cloud MCP server. Only Claude Desktop is supported at this time.", | |
Use: "install [MCP-SERVER]", | |
Short: "Install Redpanda Cloud MCP server", | |
Long: `Install Redpanda Cloud MCP server. | |
Only Claude Desktop is supported at this time.` |
And if you can, more documentation on what this command does, i.e: sets a configuration file in the user configuration directory, etc...
cfg, err := p.Load(fs) | ||
out.MaybeDie(err, "Failed to load rpk config: %w", err) | ||
|
||
if args[0] != "claude" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out.DieString("Argument claude is missing") | ||
} | ||
configDir, err := os.UserConfigDir() | ||
out.MaybeDie(err, "failed to load file: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit]
out.MaybeDie(err, "failed to load file: %w", err) | |
out.MaybeDie(err, "failed to get user configuration directory: %w", err) |
jsonStr, err = sjson.Set(jsonStr, "mcpServers.redpandaCloud.env", map[string]any{ | ||
"RPK_CLOUD_URL": "https://cloud-api.ign.cloud.redpanda.com", | ||
"RPK_CLOUD_AUTH_URL": "https://integration-cloudv2.us.auth0.com", | ||
"RPK_CLOUD_AUTH_AUDIENCE": "cloudv2-ign.redpanda.cloud", | ||
"CLOUD_URL": "https://cloud-api.ign.cloud.redpanda.com/api/v1", | ||
"RPK_AUTH_APP_CLIENT_ID": "OQJLrKFCXuCMfGfMfnIqzgiwiyDfoxEV", | ||
"RPK_PUBLIC_API_URL": "https://api.ign.cloud.redpanda.com", | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the new RPK_CLOUD_ENVIRONMENT=integration
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how can i programmatically access the -X cloud_environment flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It gets added on load to the profile https://github.com/redpanda-data/redpanda/blob/dev/src/go/rpk/pkg/config/rpk_yaml.go#L148
It was not intended to be documented nor part of the dev overrides as we didn't see a use for it, but feel free to explore if this suits you or if we need to make a change.
out.MaybeDie(err, "failed to patch Claude Desktop config: %v", err) | ||
|
||
// Set dev overrides | ||
if cfg.DevOverrides().PublicAPIURL != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] Why do we set explicitly integration if the PublicAPIURL != "" ? what if it's preprod?
Shouldn't it be
RPK_CLOUD_URL = cfg.DevOverrides().CloudAPIURL
And so on ... ?
That's if RPK_CLOUD_ENVIRONMENT
is not enough though.
Use: "stdio", | ||
Short: `MCP stdio server. Can be used by MCP clients.`, | ||
Args: cobra.NoArgs, | ||
Run: func(cmd *cobra.Command, args []string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run: func(cmd *cobra.Command, args []string) { | |
Run: func(_ *cobra.Command, args []string) { |
}, | ||
} | ||
|
||
cmd.Flags().BoolVarP(&allowDelete, "allow-delete", "", false, "Allow delete RPCs. Off by default.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd.Flags().BoolVarP(&allowDelete, "allow-delete", "", false, "Allow delete RPCs. Off by default.") | |
cmd.Flags().BoolVarP(&allowDelete, "allow-delete", "", false, "Allow delete RPCs. Off by default") |
We don't add a period in the flag help text (sorry, we don't have a linter for this yet).
- Add command to install the MCP server. Currently, only claude desktop is supported. - Add command to serve the stdio server. MCP clients launch it as a subprocess, and interact over stdin/stdout with it. - Authentication to cloud is completely re-used from rpk.
I would like to avoid introducing a plugin for this for now, we'll be fine with the release cycle of core. We're not expecting this to change very often (and want to spare all the time required to do a plugin).
Backports Required
Release Notes