Help us shape the future of Go! Take the 2026 Go Developer Survey

mcpserver

package
v0.10.18 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package mcpserver serves vaults to MCP clients, such as Claude Desktop and other agents without a shell. Each tool runs the vaultmind command an agent with a shell would run, with --json, and returns its output, so a tool answers exactly what the CLI answers: same flags, config and access tracking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) *mcp.Server

New builds the server and its tools.

func Serve

func Serve(ctx context.Context, cfg Config) error

Serve runs the server on stdin and stdout until the client disconnects.

Types

type Config

type Config struct {
	// Vault is where writes, imports and links go.
	Vault string
	// Vaults, when set, is the set the read tools look across; Vault is
	// expected among them.
	Vaults []string
	// Version is reported to clients.
	Version string
	// NoVault keeps plugin startup informative before project setup.
	NoVault bool
	// Run runs a vaultmind command; ExecRunner in production.
	Run Runner
}

Config is what the server serves. The vaults are fixed when it starts, so a client can't point a tool at another directory.

func ProjectConfig added in v0.10.17

func ProjectConfig(project, version, bin string) (Config, error)

ProjectConfig keeps the plugin server available before setup. Calls explain the missing vault, then work as soon as setup creates ./knowledge. Explicit CLI vault flags continue to use the strict non-plugin configuration path.

type Runner

type Runner func(ctx context.Context, args []string) ([]byte, error)

Runner runs vaultmind with args and returns what it printed. A failed command returns an error carrying its output.

func ExecRunner

func ExecRunner(bin string) Runner

ExecRunner runs the binary at bin.

Jump to

Keyboard shortcuts

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