Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ require (
charm.land/lipgloss/v2 v2.0.6
github.com/basecamp/actioncable-client/go/v2 v2.0.2
github.com/basecamp/hey-sdk/go v0.35.0
github.com/basecamp/mcp v0.0.0-20260828100356-2d6f44b51e9d
github.com/basecamp/mcp v0.0.0-20261118214004-663b2e5d2836
Comment thread
jeremy marked this conversation as resolved.
Resolved
Comment thread
jeremy marked this conversation as resolved.
Resolved
Comment thread
jeremy marked this conversation as resolved.
Resolved
Comment thread
jeremy marked this conversation as resolved.
Resolved
github.com/charmbracelet/x/ansi v0.11.9
github.com/fsnotify/fsnotify v1.10.1
github.com/gofrs/flock v0.13.2
github.com/itchyny/gojq v0.12.20
github.com/mattn/go-runewidth v0.0.31
github.com/modelcontextprotocol/go-sdk v1.8.0
github.com/modelcontextprotocol/go-sdk v1.8.1-0.20261014132652-7c486efa8223
github.com/rivo/uniseg v0.4.7
github.com/sigstore/sigstore-go v1.4.0
github.com/spf13/cobra v1.10.2
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ github.com/basecamp/actioncable-client/go/v2 v2.0.2 h1:h2Sl15gj2lI/EX5E0EUxjyYgf
github.com/basecamp/actioncable-client/go/v2 v2.0.2/go.mod h1:3Y0N9V5LXclT5nQWcPhq/+6rj4eKXgKAX8dx15X8yB8=
github.com/basecamp/hey-sdk/go v0.35.0 h1:gV9Y8JweijV8vKeIQvkYj1Kk+liq3iuJNoOnUgVD4BA=
github.com/basecamp/hey-sdk/go v0.35.0/go.mod h1:ILC2upnVketSzbZTcN1iICeCpjCqvYpIflYcEVrgigw=
github.com/basecamp/mcp v0.0.0-20260828100356-2d6f44b51e9d h1:zEQVGq1x1nhKMZ2TudFAcSJ32CHT8richI1vQakIKz4=
github.com/basecamp/mcp v0.0.0-20260828100356-2d6f44b51e9d/go.mod h1:Ee2c/q1/pg+5T5741PIuA3s6VJMQC7I0XBNXIHIujzA=
github.com/basecamp/mcp v0.0.0-20261118214004-663b2e5d2836 h1:ND4te8b+HVFFrgcm7+n8P83MKKPqBpIyoJ63tT9liRU=
github.com/basecamp/mcp v0.0.0-20261118214004-663b2e5d2836/go.mod h1:K3sgTH90CIR6Ed0XPnivIBqNIpw6aeOlcXThBrZ+2gc=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
Expand Down Expand Up @@ -287,8 +287,8 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modelcontextprotocol/go-sdk v1.8.0 h1:KIvahhYqwtbeniWVPs3TcXEA7b8jEtwfBpOTAI+Urx4=
github.com/modelcontextprotocol/go-sdk v1.8.0/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts=
github.com/modelcontextprotocol/go-sdk v1.8.1-0.20261014132652-7c486efa8223 h1:THyv0oM2i7h3ezGwwXWCOqwsh/C2rUTabh+ukQCiClE=
github.com/modelcontextprotocol/go-sdk v1.8.1-0.20261014132652-7c486efa8223/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/natefinch/atomic v1.0.1 h1:ZPYKxkqQOx3KZ+RsbnP/YsgvxWQPGxjC0oBt2AhwV0A=
Expand Down
23 changes: 22 additions & 1 deletion internal/mcpserver/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,30 @@ func loadCatalog(readOnly bool) (*catalog.Catalog, error) {
if err != nil {
return nil, fmt.Errorf("embedded model: %w", err)
}
return catalog.Load(catalog.Spec{
cat, err := catalog.Load(catalog.Spec{
ToolPrefix: "hey_",
Domains: domainSpecs(readOnly),
Model: model,
})
if err != nil {
return nil, err
}
hideWireMechanics(cat)
return cat, nil
}

// hideWireMechanics drops each operation's HTTP pagination and retry policy
// from what describe serves. They are how this server talks to HEY, not how a
// client talks to it: a paged read answers its next page as a cursor in the
// result (dispatch.go), never as the Link or X-Total-Count headers the model
// describes, and every write goes out once (the CLI's single-shot client), so
// a client that followed a write's retry policy could save or toggle twice.
// Paginated stays: it says a read has more pages.
func hideWireMechanics(cat *catalog.Catalog) {
for _, d := range cat.Domains {
for _, op := range d.Operations {
op.Pagination = nil
op.Retry = nil
}
}
}
11 changes: 9 additions & 2 deletions internal/mcpserver/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,45 @@ import (
// is a one-line change here plus a snapshot refresh.
var DomainSpecs = []catalog.DomainSpec{
{
Key: "boxes",
Tags: []string{"Boxes"},
Key: "boxes",
Title: "HEY Boxes",
Tags: []string{"Boxes"},
Blurb: "HEY mail boxes: the Imbox, The Feed, the Paper Trail, Reply Later, Set Aside and Bubble Up, box groups and designations, and incremental posting changes. " +
boxPaging,
},
{
Key: "search",
Title: "HEY Search",
Tags: []string{"Search"},
Blurb: "Search HEY mail: advanced search with the same refinements the search page offers.",
},
{
Key: "threads",
Title: "HEY Threads",
Tags: []string{"Topics", "Entries", "Messages"},
Blurb: "HEY email threads: topics and their entries, renaming a thread, full message content, replies and forwards, drafts, and triage (trash, spam, restore, move). create_message, create_reply and update_message only ever save drafts: they never send or schedule mail, and a request to send, schedule or triage in the same call is refused. Updating a scheduled draft clears its schedule. The person can have a draft shown or revised as they like, and sends it with one press of their own: from its page in HEY (app_url), with `hey draft send <id>`, or on a confirmation this assistant asks for, where it can. Each draft save's note says which this client has.",
},
{
Key: "contacts",
Title: "HEY Contacts & Screener",
Tags: []string{"Contacts"},
Blurb: "HEY contacts and The Screener: contact records and notes, bundling, and clearance (screening) decisions.",
},
{
Key: "todos",
Title: "HEY Calendar To-dos",
Tags: []string{"Calendar Todos"},
Blurb: "HEY Calendar to-dos: create, update, complete, uncomplete, and delete. Read existing to-dos through the calendar domain's get_calendar_recordings.",
},
{
Key: "calendar",
Title: "HEY Calendars",
Tags: []string{"Calendars"},
Blurb: "HEY Calendars: list calendars, read their recordings (to-dos and events — the to-do read path), and toggle calendar visibility.",
},
{
Key: "identity",
Title: "HEY Identity",
Tags: []string{"Identity"},
Blurb: "Your HEY identity: accounts, senders, and preferences — the acting_sender_id and acting_user_id lookups that replies and contact writes ask for.",
},
Expand Down
36 changes: 36 additions & 0 deletions internal/mcpserver/drafts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,39 @@ func TestEveryServedOpenWorldOperationIsDraftFirst(t *testing.T) {
}
}
}

// describe serves what a client can use. A paged read answers its next page as
// a cursor in the result, not the Link or X-Total-Count headers HEY's wire
// uses, and writes go out once, so neither HTTP pagination nor a retry policy
// is described.
func TestDescribeServesNoWireMechanics(t *testing.T) {
_, session := connect(t, &fakeAPI{}, Config{})
for tool, actions := range map[string][]string{
"hey_contacts": {"list_contacts"},
"hey_threads": {"create_message", "update_message"},
"hey_calendar": {"toggle_calendar"},
} {
for _, action := range actions {
t.Run(action, func(t *testing.T) {
text, isError := mcptest.CallText(t, session, tool, map[string]any{
"action": "describe", "params": map[string]any{"action": action},
})
if isError {
t.Fatal(text)
}
var op map[string]any
if err := json.Unmarshal([]byte(text), &op); err != nil {
t.Fatalf("describe %s: %v", action, err)
}
for _, key := range []string{"pagination", "retry"} {
if _, ok := op[key]; ok {
t.Errorf("describe %s serves %s: %v", action, key, op[key])
}
}
if strings.Contains(text, "X-Total-Count") {
t.Errorf("describe %s names a header the result never carries", action)
}
})
}
}
}
2 changes: 1 addition & 1 deletion nix/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ buildGoModule.override { inherit go; } (finalAttrs: {

# To update: run `make update-nix-hash` (Docker). It rewrites this quoted
# value in place, so keep it a string literal rather than lib.fakeHash.
vendorHash = "sha256-eoXYLU8rnusqti2qAtNhIr175ab+MxAQORkn6Kn9AK0=";
vendorHash = "sha256-Ar/FktmqlSCvtrkCwy6zDMpHygeCFPozGzlHjB4kHzQ=";

subPackages = [ "cmd/hey" ];

Expand Down
Loading