Skip to content
Open
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
1 change: 1 addition & 0 deletions cmd/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Manual smoke test:
For agent registration use:
codag setup`,
RunE: func(cmd *cobra.Command, args []string) error {
mcp.Version = Version
s := mcp.NewServer()
mcp.RegisterAll(s)
return s.Serve()
Expand Down
6 changes: 5 additions & 1 deletion internal/mcp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ var (
// since are backward-compatible at the level of methods we use.
const ProtocolVersion = "2025-03-26"

// Version is the CLI version reported in the MCP initialize response.
// Set by the cmd package before Serve() is called; defaults to "dev".
var Version = "dev"

// jrpcRequest is a JSON-RPC 2.0 request frame.
type jrpcRequest struct {
JSONRPC string `json:"jsonrpc"`
Expand Down Expand Up @@ -184,7 +188,7 @@ func (s *Server) dispatch(req jrpcRequest) {
},
"serverInfo": map[string]interface{}{
"name": "codag",
"version": "0.1.5",
"version": Version,
},
})
case "notifications/initialized":
Expand Down