Skip to content

feat: gomcp call - #22

Merged
StevenCyb merged 3 commits into
mainfrom
feat/call
Nov 17, 2026
Merged

StevenCyb merged 3 commits into
mainfrom
feat/call

Conversation

@StevenCyb

Copy link
Copy Markdown
Owner

What

gomcp call ./proj lists the tools, gomcp call ./proj add_note '{"text":"hi"}' calls one, so a project can be tried without an AI client.

How

  • New internal/caller: small stdio client (stateless protocol, tools/list paging, input_required handling) and Run, which builds via runner.Serve over io.Pipe and closes stdin at the end.
  • Text content blocks go to stdout, --json prints the indented raw result. Exit 1 on tool error (message on stderr) or protocol error (code and message).
  • Arguments: JSON object, - reads stdin; invalid JSON fails before building.
  • input_required (elicitation, sampling, roots) is reported by kind instead of hanging; --root <dir> answers roots/list. The client declares roots, sampling and elicitation capabilities so tools reach the point of asking (with empty capabilities the server rejects them earlier).
  • GoCLI cannot take optional positional arguments or flags after them, so call parses its own line (flags in any position) and is registered with the library for help only.
  • Docs: README CLI section, README_DEV.

Tested

Unit tests (caller against an in-process server, cmd with fake actions), e2e against example/, vet, golangci-lint 0 issues, go test -race ./... green.

🤖 Generated with Claude Code

@StevenCyb
StevenCyb enabled auto-merge (squash) November 17, 2026 08:44
StevenCyb and others added 3 commits November 17, 2026 09:45
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@StevenCyb
StevenCyb merged commit e114fff into main Nov 17, 2026
11 checks passed
@StevenCyb
StevenCyb deleted the feat/call branch November 17, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant