Skip to main content
Glama

MCPJungle mcp gateway

by mcpjungle
Mozilla Public License 2.0
638
  • Apple
version.go•1.49 kB
package cmd import ( "context" "time" "github.com/mcpjungle/mcpjungle/pkg/version" "github.com/spf13/cobra" ) var versionCmd = &cobra.Command{ Use: "version", Short: "Print version information", Long: `Print version information for the CLI and the connected mcpjungle server.`, Run: func(cmd *cobra.Command, args []string) { // We want the extra newline for proper formatting cmd.Print(asciiArt) //nolint:staticcheck // Display CLI version cliVersion := version.GetVersion() cmd.Printf("CLI Version: %s\n", cliVersion) // Try to fetch server version serverVersion, ok := getServerVersion() if ok { cmd.Printf("Server Version: %s\n", serverVersion) } else { cmd.Printf("Couldn't retrieve Server version at this time\n") } cmd.Println("Server URL: ", apiClient.BaseURL()) }, Annotations: map[string]string{ "group": string(subCommandGroupBasic), "order": "7", }, } func init() { rootCmd.AddCommand(versionCmd) rootCmd.Flags().BoolP("version", "v", false, "Display version information") } // getServerVersion attempts to fetch the server version from the configured server. // Returns the version string and a boolean indicating success. func getServerVersion() (string, bool) { // Try to get server metadata with timeout ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() metadata, err := apiClient.GetServerMetadata(ctx) if err != nil { return "", false } return metadata.Version, true }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcpjungle/MCPJungle'

If you have feedback or need assistance with the MCP directory API, please join our Discord server