github/github-mcp-server · error

failed to build JSON-RPC request: %w

Error message

failed to build JSON-RPC request: %w

What it means

Error "failed to build JSON-RPC request: %w" thrown in github/github-mcp-server.

Source

Thrown at cmd/mcpcurl/main.go:132

			return nil
		},
	}

	// Add schema command
	schemaCmd = &cobra.Command{
		Use:   "schema",
		Short: "Fetch schema from MCP server",
		Long:  "Fetches the tools schema from the MCP server specified by --stdio-server-cmd",
		RunE: func(cmd *cobra.Command, _ []string) error {
			serverCmd, _ := cmd.Flags().GetString("stdio-server-cmd")
			if serverCmd == "" {
				return fmt.Errorf("--stdio-server-cmd is required")
			}

			// Build the JSON-RPC request for tools/list
			jsonRequest, err := buildJSONRPCRequest("tools/list", "", nil)
			if err != nil {
				return fmt.Errorf("failed to build JSON-RPC request: %w", err)
			}

			// Execute the server command and pass the JSON-RPC request
			response, err := executeServerCommand(serverCmd, jsonRequest)
			if err != nil {
				return fmt.Errorf("error executing server command: %w", err)
			}

			// Output the response
			fmt.Println(response)
			return nil
		},
	}

	// Create the tools command
	toolsCmd = &cobra.Command{
		Use:   "tools",
		Short: "Access available tools",

View on GitHub (pinned to 0ea1f775a7)

When it happens

Trigger: Thrown at cmd/mcpcurl/main.go:132 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of github/github-mcp-server@0ea1f775a7 (2026-08-15). Data as JSON: /api/errors/7b7c079b7db220d8. Report an issue: GitHub.