feat: mcp create + plural --channel; mcp create polish#11
Open
ysyneu wants to merge 3 commits into
Open
Conversation
Migrate from singular Int64Var to StringVar + parseIntSlice, routing through ListChangesInput.ChannelIDs []int64 to match the MCP surface and mirror the existing alert list --channel pattern.
Move --server-name empty-check inside runCommand closure to match the project convention established in alert.go (validation flows through the same error formatter as all other business-logic errors). Rewrite TestMCPCreateRejectsEmptyServerName to use execCommand + mockClient injection so it survives the guard moving inside runCommand without depending on real config or network. Add TestParseKVSlice table-driven tests covering nil/empty/single/multi/ value-with-equals/empty-value/empty-key/missing-equals cases.
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
Three changes that close MCP feature parity for the fc-safari ai-sre agent path (see fc-safari PR for the consumer side).
mcp createnew command under a newmcpgroup. Registers an MCP server viaflashduty-sdk.CreateMCPServer. 11 flags:--server-name --description --transport --command --args --env --url --headers --connect-timeout --call-timeout --team-id.--envand--headersaccept repeatableKEY=VALUEparsed via a new sharedparseKVSlicehelper. Pre-flight rejects empty--server-nameinside therunCommandclosure to match the canonical project convention.change list --channelmigrated from singularInt64Varto comma-separatedStringVar, routed through the SDK's primaryListChangesInput.ChannelIDs []int64. Mirrorsalert list --channel(which already used the plural form) so both commands have identical filter semantics and match the MCPquery_changes.channel_idsschema.mcp create: validation moved insiderunCommandfor uniform error rendering; test migrated to thesaveAndResetGlobals+mockClientfixture so it exercises the actualRunEpath;parseKVSlicegets an 8-case table-driven test covering nil / empty / single / multi / value-with-equals / empty-value / empty-key / missing-equals.alert events <alert_id>was already onmain; no change needed there.Test plan
go test ./internal/cli -count=1greenmake checkclean (fmt + lint + test + build)make build && bin/flashduty mcp create --helpshows all 11 flagsbin/flashduty change list --channel 100,200 --since 1h --jsonagainst a dev account routes throughchannel_ids(notchannel_id)GOOS=linux GOARCH=amd64 make build && file bin/flashdutyreportsELF 64-bit ... x86-64— needed by the fc-safari sandbox image bake