Skip to content

🐛 fix(adminmcp): the HTTP endpoint answers ping and acknowledges notifications - #16893

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/adminmcp-http-ping
Nov 6, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/adminmcp-http-ping

Conversation

@Danathar

@Danathar Danathar commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Summary

The admin MCP HTTP endpoint (POST /api/admin/mcp) did not answer two messages every MCP client is allowed to send. It replied "method not found" to ping, and to every notification except notifications/initialized. This PR answers ping and acknowledges notifications. Tool calls are unchanged, and the stdio binary was never affected.

What went wrong

Checked against a live v6 hive:

-> {"jsonrpc":"2.0","id":1,"method":"ping"}
<- {"jsonrpc":"2.0","id":1,"error":{"code":-32601,"message":"method not found"}}
  • ping is MCP's liveness check. The receiver must answer with an empty result. A client that pings to see whether the server is still there was told the method does not exist, and can treat the hive as gone.
  • Notifications. A notification expects no answer. This endpoint always writes one, and for notifications/initialized it writes an empty result, which the docs record. Any other notification got an error. notifications/cancelled is the common one: a client sends it after it gives up on a slow tool call.

The public knowledge MCP endpoint in the same codebase already answers ping.

What changes

  • ping returns {}.
  • Any notifications/... method gets the same empty acknowledgement notifications/initialized always had.
  • An unknown request method still gets -32601.

Files

  • src/pkg/adminmcp/adminmcp.go: dispatch.
  • src/pkg/adminmcp/protocol_test.go: new.
  • src/docs/admin-mcp.md: one bullet under "HTTP endpoint".
  • changelog.d/fixed-admin-mcp-http-ping.md

Tests

  • TestHTTPEndpointAnswersPing
  • TestHTTPEndpointAcknowledgesEveryNotification: four notification methods.
  • TestHTTPEndpointStillRefusesUnknownMethods: five methods, including a bare notifications.
  • The first two fail on v6 without the change.
  • go test ./pkg/adminmcp/ ./cmd/hive-admin-mcp/ passes.

🤖 Generated with Claude Code

…fications

POST /api/admin/mcp answered MCP's ping with -32601 "method not found",
though the receiver must answer it with an empty result, and answered
every notification except notifications/initialized (notifications/cancelled
after an abandoned tool call, for one) with the same error.

ping now returns an empty result, and any notifications/* method gets the
empty acknowledgement notifications/initialized always had. Unknown
request methods are still -32601. The stdio binary uses the MCP SDK and was
not affected.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 6, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#16889 🐛 fix(adminmcp): reads stop masking values that cannot be a credential same files src/docs/admin-mcp.md
src/pkg/adminmcp/adminmcp.go
#16884 ✨ feat(adminmcp): read and act on the Activity monitor; writes run as the verified caller same files src/docs/admin-mcp.md
src/pkg/adminmcp/adminmcp.go
#16894 🐛 fix(adminmcp): issues_by_band accepts the outside band it reports same files src/pkg/adminmcp/adminmcp.go

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me.

Read dispatch at src/pkg/adminmcp/adminmcp.go:262-282. ping → empty result matches MCP; the notifications/ prefix check in the default arm subsumes the removed notifications/initialized case, so that path is unchanged in behaviour, and any other unknown method still gets -32601. The new protocol_test.go cases cover all three. One pre-existing note, not a finding of this PR: a notification carries no id, and rpcResponse.ID is omitempty (adminmcp.go:231), so the ack body is {"jsonrpc":"2.0","result":{}} — exactly what the doc line now says, so it's documented as intended.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 07cbaab into hivecommons:v6 Nov 6, 2026
71 of 74 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#16893750df50` sha256:a9c079e9a8ad2eaf402bdac5109c2da04829a461098bac136e049dea884aeffa — download from the dashboard or `hivectl review evidence #16893`.

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 6, 2026
Danathar added a commit to Danathar/hive that referenced this pull request Nov 6, 2026
…cker

src/docs/admin-mcp.md: kept the reorganized guide and carried over v6's changes to it: ping and notification answers (hivecommons#16893), version_read hash/short (hivecommons#16890), settings_read takes no limit and the triggers section (hivecommons#16892), What a read masks (hivecommons#16889), and write tools always listed with metadata.preview.enabled (hivecommons#16890); the troubleshooting row follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant