From 18024471cfdb5e9e05328faa131399891c876da2 Mon Sep 17 00:00:00 2001 From: Sam Morrow Date: Mon, 8 Dec 2025 11:25:07 +0100 Subject: [PATCH] fix: update get-me script for go-SDK MCP protocol The go-SDK migration changed MCP protocol handling to require proper initialization before tool calls. This updates the script to: - Add initialize request with protocol version and client info - Add notifications/initialized notification - Add arguments field to tools/call params - Keep stdin open with sleep for response - Gracefully handle missing jq dependency --- script/get-me | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/script/get-me b/script/get-me index 46339ae53..954f57cec 100755 --- a/script/get-me +++ b/script/get-me @@ -1,3 +1,17 @@ #!/bin/bash -echo '{"jsonrpc":"2.0","id":3,"params":{"name":"get_me"},"method":"tools/call"}' | go run cmd/github-mcp-server/main.go stdio | jq . +# MCP requires initialize -> notifications/initialized -> tools/call +output=$( + ( + echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"get-me-script","version":"1.0.0"}}}' + echo '{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}' + echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_me","arguments":{}}}' + sleep 1 + ) | go run cmd/github-mcp-server/main.go stdio 2>/dev/null | tail -1 +) + +if command -v jq &> /dev/null; then + echo "$output" | jq '.result.content[0].text | fromjson' +else + echo "$output" +fi