Skip to content

Feature Request: Bundle a MCP Server With the CLI #27146

@njayp

Description

@njayp

Feature request description

Bundling an MCP server with the CLI has some advantages:

  1. Gives the agent direct access to the CLI without access to shell
  2. Limited CLI access, to non-destructive commands
  3. The user does not have to install additional binaries

Ophis converts cobra.Command trees to mcp tools, each command is a tool, with flags and args as input objects. The user can add the mcp server to Claude or VSCode with podman mcp claude enable or podman mcp vscode enable

Suggest potential solution

// podman/cmd/mcp/command.go
package mcp

import (
	"github.com/containers/podman/v5/cmd/podman/registry"
	"github.com/njayp/ophis"
)

var mcpCommands = ophis.Command(&ophis.Config{
	Filters: []ophis.Filter{
		ophis.AllowFilter([]string{
			"podman ps",
			"podman logs",
			"podman inspect",
			"podman stats",
			"podman top",
			"podman port",
			"podman images",
		}),
	},
})

func init() {
	registry.Commands = append(registry.Commands, registry.CliCommand{
		Command: mcpCommands,
	})
}

Have you considered any alternatives?

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions