feat(telegram): add /mcp list, add, remove commands#35
Merged
nnemirovsky merged 8 commits intomainfrom Apr 20, 2026
Merged
Conversation
Squashed review fixes across multiple iterations: - MCP upstream commands review findings - Iter 2 review findings - Iter 3 review findings - Smells review style fixes - Codex external review findings
- rename close shadows to closes in approval_test.go - lowercase error string in --header callback per ST1005 - remove unused sortedKVLine helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/mcp list,/mcp add,/mcp removeto the Telegram bot so MCP upstream management reaches parity with CLI and REST API./mcpto the Telegram command menu and help output.internal/flagutil/package used by both CLI and Telegram flag parsers.envandheadersvalues in/mcp listoutput (show onlyvault:<name>pointers verbatim; mask everything else) to prevent plaintext secrets from leaking to chat.ParseCommandvia a newtokenizeShellishhelper so quoted flag values like--args "a,b"and--header "Authorization=Bearer tok"parse correctly./mcp addmessages are auto-deleted from chat history because--env KEY=VALmay carry secrets, matching/cred addtreatment.--header KEY=VALflag to Telegram/mcp addfor parity with CLI.--timeout > 0validation to CLIsluice mcp add(previously accepted any value, persisted invalid timeouts that runtime silently ignored).mcp.DefaultTimeoutSecconstant shared across gateway, CLI, and Telegram handlers.Notes
/mcp add//mcp remove. Review found this was semantically wrong:WireMCPGatewaywritesmcp.servers.sluice = {url}to the agent (sluice itself, not individual upstreams), so re-calling it on every mutation only triggered agent restarts without surfacing the new upstream. Sluice multiplexes all upstreams behind one endpoint, so a sluice restart is the correct path. UX now says "Restart sluice for the new upstream to take effect."Test plan
go test ./... -timeout 30s) across all 13 packages/mcp add test-server --command "echo hello"in Telegram, verify it appears in/mcp list, then remove/mcp addmessage is deleted from chat history/mcp listmasks non-vault env/header values