mcptui

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMcpToolRenderers

func CreateMcpToolRenderers(label string) *extension.ToolRenderers

CreateMcpToolRenderers returns the renderers of calls to an MCP tool, labeled `server/tool`, also used before the tool is registered. upstream: packages/coding-agent/src/extensions/mcp/tools.ts:createMcpToolRenderers

func ShowManager

func ShowManager(ctx context.Context, ui extension.UIContext, events mcpext.EventContext, copyToClipboard func(text string) error, manage func(mcpext.McpUi) error) error

ShowManager runs manage in the manager view until it returns (showMcpManager). upstream: packages/coding-agent/src/extensions/mcp/ui.ts:showMcpManager

func Terminal

func Terminal() *mcpext.Terminal

Terminal is the terminal presentation to set as mcpext.Options.Terminal: the tool renderers, the resolver and the `/mcp` manager view.

func ToolRendererResolver

func ToolRendererResolver(toolName string, next func() *extension.ToolRenderers) *extension.ToolRenderers

ToolRendererResolver renders calls to MCP tools before their server connected (a resumed session), if it ever does. upstream: packages/coding-agent/src/extensions/mcp/index.ts (pi.registerToolRenderer, #10285)

Types

type ManagerHost

type ManagerHost interface{ RequestRender(force ...bool) }

ManagerHost is the terminal the manager view asks to draw again.

type McpManagerView

type McpManagerView struct {
	// contains filtered or unexported fields
}

McpManagerView is the `/mcp` manager view: menus that rebuild while servers connect, a read-only status screen, and the sign-in screen that accepts a pasted redirect URL. The manager calls Menu, Status and RedirectURL from its own goroutine; Render and HandleInput run on the interactive loop. upstream: packages/coding-agent/src/extensions/mcp/ui.ts:McpManagerView

func NewMcpManagerView

func NewMcpManagerView(host ManagerHost, theme *tui.Theme, keybindings *tui.TUIKeybindingsManager) *McpManagerView

NewMcpManagerView returns the view, showing "Loading…" until the manager shows its first menu.

func (*McpManagerView) Dispose

func (*McpManagerView) Dispose()

Dispose releases nothing: the view's work runs in the manage goroutine that Custom waits for.

func (*McpManagerView) HandleInput

func (v *McpManagerView) HandleInput(data string)

HandleInput passes a key to what the view is showing.

func (*McpManagerView) Invalidate

func (v *McpManagerView) Invalidate()

Invalidate clears what the content cached.

func (*McpManagerView) Menu

func (v *McpManagerView) Menu(ctx context.Context, build func() mcpext.McpMenu, subscribe func(listener func()) (unsubscribe func())) (string, bool)

Menu shows a menu, rebuilding it on every change and keeping the selected item.

func (*McpManagerView) RedirectURL

func (v *McpManagerView) RedirectURL(ctx context.Context, title, authorizationURL string) (string, bool)

RedirectURL shows the authorization URL and waits for a pasted redirect URL.

func (*McpManagerView) Render

func (v *McpManagerView) Render(width int) []string

Render draws the current content, cutting rows to the width.

func (*McpManagerView) SetCopyToClipboard

func (v *McpManagerView) SetCopyToClipboard(copyToClipboard func(text string) error)

SetCopyToClipboard supplies the clipboard writer `app.message.copy` uses for the authorization URL on the sign-in screen. Without one, the key is ignored.

func (*McpManagerView) SetFocused

func (v *McpManagerView) SetFocused(focused bool)

SetFocused records whether the view holds focus, and passes it on to the input that is showing.

func (*McpManagerView) Status

func (v *McpManagerView) Status(title, message string, onCancel func())

Status shows a message while an operation runs. With onCancel, the cancel key calls it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL