market

package
v1.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeEndpoint

func NormalizeEndpoint(raw string) string

func ServerKey

func ServerKey(endpoint string) string

Types

type CLIFlagHint

type CLIFlagHint struct {
	Shorthand string `json:"shorthand"`
	Alias     string `json:"alias"`
}

type CLIFlagOverride

type CLIFlagOverride struct {
	Alias         string         `json:"alias"`
	Transform     string         `json:"transform,omitempty"`
	TransformArgs map[string]any `json:"transformArgs,omitempty"`
	EnvDefault    string         `json:"envDefault,omitempty"`
	Hidden        bool           `json:"hidden,omitempty"`
	Default       string         `json:"default,omitempty"`
}

CLIFlagOverride describes how to map an MCP parameter to a CLI flag.

type CLIGroupDef

type CLIGroupDef struct {
	Description string `json:"description"`
}

CLIGroupDef defines a sub-command group within a CLI module.

type CLIOverlay

type CLIOverlay struct {
	ID            string                     `json:"id"`
	Command       string                     `json:"command"`
	Parent        string                     `json:"parent,omitempty"`
	Description   string                     `json:"description"`
	Prefixes      []string                   `json:"prefixes"`
	Aliases       []string                   `json:"aliases"`
	Group         string                     `json:"group"`
	Skip          bool                       `json:"skip"`
	Hidden        bool                       `json:"hidden"`
	Tools         []CLITool                  `json:"tools"`
	Groups        map[string]CLIGroupDef     `json:"groups,omitempty"`
	ToolOverrides map[string]CLIToolOverride `json:"toolOverrides,omitempty"`
}

type CLITool

type CLITool struct {
	Name        string                 `json:"name"`
	CLIName     string                 `json:"cliName"`
	Title       string                 `json:"title"`
	Description string                 `json:"description"`
	IsSensitive bool                   `json:"isSensitive"`
	Category    string                 `json:"category"`
	Hidden      bool                   `json:"hidden"`
	Flags       map[string]CLIFlagHint `json:"flags"`
}

type CLIToolOverride

type CLIToolOverride struct {
	CLIName      string                     `json:"cliName"`
	Description  string                     `json:"description,omitempty"`
	Group        string                     `json:"group,omitempty"`
	IsSensitive  bool                       `json:"isSensitive,omitempty"`
	Hidden       bool                       `json:"hidden,omitempty"`
	Flags        map[string]CLIFlagOverride `json:"flags,omitempty"`
	OutputFormat map[string]any             `json:"outputFormat,omitempty"`
}

CLIToolOverride maps an MCP tool to a CLI command with flag aliases and transforms.

type Client

type Client struct {
	BaseURL    string
	HTTPClient *http.Client
}

func NewClient

func NewClient(baseURL string, httpClient *http.Client) *Client

func (*Client) FetchDetail

func (c *Client) FetchDetail(ctx context.Context, mcpID int) (DetailResponse, error)

func (*Client) FetchDetailByURL

func (c *Client) FetchDetailByURL(ctx context.Context, detailURL string) (DetailResponse, error)

func (*Client) FetchServers

func (c *Client) FetchServers(ctx context.Context, limit int) (ListResponse, error)

func (*Client) FetchServersFromURL

func (c *Client) FetchServersFromURL(ctx context.Context, fullURL string) (ListResponse, error)

FetchServersFromURL fetches the server list from a full URL (no path appending). This is used when DWS_SERVERS_URL is set to a complete endpoint.

type DetailLocator

type DetailLocator struct {
	MCPID     int    `json:"mcp_id,omitempty"`
	DetailURL string `json:"detail_url,omitempty"`
}

type DetailResponse

type DetailResponse struct {
	Result  DetailResult `json:"result"`
	Success bool         `json:"success"`
}

type DetailResult

type DetailResult struct {
	MCPID       int          `json:"mcpId"`
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Tools       []DetailTool `json:"tools"`
}

type DetailTool

type DetailTool struct {
	ToolName      string `json:"toolName"`
	ToolTitle     string `json:"toolTitle"`
	ToolDesc      string `json:"toolDesc"`
	IsSensitive   bool   `json:"isSensitive"`
	ToolRequest   string `json:"toolRequest"`
	ToolResponse  string `json:"toolResponse"`
	ActionVersion string `json:"actionVersion"`
}

type EnvelopeMeta

type EnvelopeMeta struct {
	Registry RegistryMetadata `json:"com.dingtalk.mcp.registry/metadata"`
	CLI      CLIOverlay       `json:"com.dingtalk.mcp.registry/cli"`
}

type LifecycleInfo

type LifecycleInfo struct {
	DeprecatedBy        int    `json:"deprecatedBy"`
	DeprecationDate     string `json:"deprecationDate"`
	MigrationURL        string `json:"migrationUrl"`
	DeprecatedCandidate bool   `json:"deprecatedCandidate,omitempty"`
}

type ListMetadata

type ListMetadata struct {
	Count      int    `json:"count"`
	NextCursor string `json:"nextCursor"`
}

type ListResponse

type ListResponse struct {
	Metadata ListMetadata     `json:"metadata"`
	Servers  []ServerEnvelope `json:"servers"`
}

type QualityMetadata

type QualityMetadata struct {
	HighQuality bool `json:"highQuality"`
	Official    bool `json:"official"`
	DTBiz       bool `json:"dtBiz"`
}

type RegistryMetadata

type RegistryMetadata struct {
	IsLatest    bool            `json:"isLatest"`
	PublishedAt string          `json:"publishedAt"`
	UpdatedAt   string          `json:"updatedAt"`
	Status      string          `json:"status"`
	MCPID       int             `json:"mcpId"`
	DetailURL   string          `json:"detailUrl"`
	Quality     QualityMetadata `json:"quality"`
	Lifecycle   LifecycleInfo   `json:"lifecycle"`
}

type RegistryRemote

type RegistryRemote struct {
	Type string `json:"type"`
	URL  string `json:"url"`
}

type RegistryServer

type RegistryServer struct {
	SchemaURI   string           `json:"$schema"`
	Name        string           `json:"name"`
	Description string           `json:"description"`
	Remotes     []RegistryRemote `json:"remotes"`
}

type ServerDescriptor

type ServerDescriptor struct {
	Key                       string            `json:"key"`
	SourceServerID            string            `json:"source_server_id,omitempty"`
	DisplayName               string            `json:"display_name"`
	Description               string            `json:"description,omitempty"`
	Endpoint                  string            `json:"endpoint"`
	SchemaURI                 string            `json:"schema_uri,omitempty"`
	NegotiatedProtocolVersion string            `json:"negotiated_protocol_version,omitempty"`
	UpdatedAt                 time.Time         `json:"updated_at,omitempty"`
	PublishedAt               time.Time         `json:"published_at,omitempty"`
	Status                    string            `json:"status,omitempty"`
	Source                    string            `json:"source"`
	Degraded                  bool              `json:"degraded"`
	DetailLocator             DetailLocator     `json:"detail_locator,omitempty"`
	Lifecycle                 LifecycleInfo     `json:"lifecycle,omitempty"`
	CLI                       CLIOverlay        `json:"cli,omitempty"`
	HasCLIMeta                bool              `json:"has_cli_meta,omitempty"`
	AuthHeaders               map[string]string `json:"auth_headers,omitempty"` // plugin-level auth headers for third-party MCP servers
}

func NormalizeServers

func NormalizeServers(response ListResponse, source string) []ServerDescriptor

type ServerEnvelope

type ServerEnvelope struct {
	Server RegistryServer `json:"server"`
	Meta   EnvelopeMeta   `json:"_meta"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL