mcp

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcp hosts an in-process Model Context Protocol server that gives Claude Code the same IDE loop it has in VS Code or GoLand: diagnostics flow to Claude, and Claude's edits open as a diff the user accepts or rejects. Claude auto-connects over SSE via a lockfile under ~/.claude/ide

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffRequest

type DiffRequest struct {
	TabName     string
	Path        string
	NewContents string
}

DiffRequest describes a proposed file change for editor review

type Session

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

Session owns the MCP server bound to an editor

func Attach

func Attach(_ context.Context, e *view.Editor, addr string) *Session

Attach creates the MCP server for the editor over SSE on addr and starts it. Disable or re-enable it later with SetEnabled

func (*Session) Close

func (s *Session) Close() error

Close shuts the MCP server down and removes the lockfile

func (*Session) Enabled

func (s *Session) Enabled() bool

Enabled reports whether the MCP server is currently serving

func (*Session) Port

func (s *Session) Port() int

Port is the loopback port the server listens on

func (*Session) SetDiffHandlers

func (s *Session) SetDiffHandlers(
	show func(context.Context, DiffRequest) bool, close func(tabName string),
)

SetDiffHandlers installs the hooks that show and close a read-only diff review in the editor UI, wired by the app so mcp stays decoupled from the UI

func (*Session) SetDispatcher

func (s *Session) SetDispatcher(d func(func()))

SetDispatcher installs the function that runs editor access on the Bubble Tea loop. Until it is set, access runs inline on the caller's goroutine

func (*Session) SetEnabled

func (s *Session) SetEnabled(enabled bool)

SetEnabled starts or stops the MCP server

func (*Session) URL

func (s *Session) URL() string

URL is the MCP endpoint clients connect to, empty while the server is stopped

Jump to

Keyboard shortcuts

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