tools

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 31 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 tools exposes a JMAP mailbox as a small set of MCP tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Email   string
	Client  *jmapc.Client
	Default bool
}

Account is a connected mail login.

type Backend

type Backend interface {
	Accounts(ctx context.Context) ([]*Account, error)
	SetDefault(ctx context.Context, email string) error
	// AttachmentLink makes an attachment too large to inline reachable as a URL or a local path.
	AttachmentLink(ctx context.Context, req *mcp.CallToolRequest, acct *Account, accountID jmap.ID, att mailview.Attachment) (string, error)
}

Backend gives the tools access to the accounts of the current user.

type Connector

type Connector interface {
	Connect(ctx context.Context, email string, deviceFlow bool) (string, error)
}

Connector links new accounts; only the stdio mode provides one.

type Options

type Options struct {
	Backend     Backend
	Connector   Connector
	SendEnabled bool
	Mode        string
	Version     string
	Logger      *slog.Logger
	Now         func() time.Time
}

Options configures the MCP server.

type Server

type Server struct {
	*mcp.Server
	// contains filtered or unexported fields
}

Server is an MCP server whose optional tools follow the capabilities of the connected accounts.

func New

func New(opts Options) *Server

New builds the MCP server and registers the tools.

func (*Server) Sync

func (s *Server) Sync(ctx context.Context)

Sync registers the optional tools announced by at least one connected account.

Jump to

Keyboard shortcuts

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