mcpserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 34 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 mcpserver exposes wassup as Model Context Protocol tools, resources and prompts, over stdio (Claude Code, Desktop, Codex, Cursor) or HTTP (claude.ai and other remote clients).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts Options) (*mcp.Server, error)

New builds the MCP server with every tool, resource and prompt registered.

func RunStdio

func RunStdio(ctx context.Context, opts Options) error

RunStdio serves one client over stdin/stdout.

func Schemas

func Schemas() (map[string]any, error)

Schemas returns the JSON Schema of every method's params, for `wassup schema`.

Types

type Backend

type Backend interface {
	Call(ctx context.Context, method string, params any, meta api.Meta) (json.RawMessage, error)
	Stream(ctx context.Context, method string, params any, meta api.Meta, onEvent func(json.RawMessage) error) (json.RawMessage, error)
}

Backend reaches the engine, either in-process (daemon) or over the socket (stdio server).

type EngineBackend

type EngineBackend struct{ E *engine.Engine }

EngineBackend calls the engine directly (the remote server runs inside the daemon).

func (EngineBackend) Call

func (b EngineBackend) Call(ctx context.Context, method string, params any, meta api.Meta) (json.RawMessage, error)

func (EngineBackend) Stream

func (b EngineBackend) Stream(ctx context.Context, method string, params any, meta api.Meta, onEvent func(json.RawMessage) error) (json.RawMessage, error)

type Options

type Options struct {
	Backend           Backend
	Source            string // "mcp" (stdio) or "remote" (HTTP)
	Profile           string
	AllTools          bool
	Fence             bool
	ApprovalWait      time.Duration
	WhatsAppApprovals bool
	// TrustClientApproval: the client relays the user's answer to approval prompts. A client
	// could fake that answer, so only enable it for apps the user trusts; others get the
	// out-of-band WhatsApp prompt, which the client can't forge.
	TrustClientApproval bool
}

Options configures one MCP server.

type RPCBackend

type RPCBackend struct {
	Client *rpc.Client
	Ensure func() error
}

RPCBackend calls the daemon over its socket; Ensure (optional) starts it on demand.

func (RPCBackend) Call

func (b RPCBackend) Call(ctx context.Context, method string, params any, meta api.Meta) (json.RawMessage, error)

func (RPCBackend) Stream

func (b RPCBackend) Stream(ctx context.Context, method string, params any, meta api.Meta, onEvent func(json.RawMessage) error) (json.RawMessage, error)

Jump to

Keyboard shortcuts

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