Help us shape the future of Go! Take the 2026 Go Developer Survey

uri

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Canonical

func Canonical(server, resourceURI string) string

Canonical builds a normalized MCP URI in the form: mcp:<server>://<resource> If resourceURI already carries the same scheme as the server, the scheme is stripped from the canonical form (e.g. github://host/path -> host/path).

func CompareParts

func CompareParts(value string) (server string, paths []string)

CompareParts returns the MCP server and a set of normalized resource paths suitable for matching roots across shorthand and fully-qualified forms. For example: - mcp://github/owner/repo -> server=github, paths=["/owner/repo"] - mcp:github:github://github.vianttech.com/owner/repo -> server=github, paths=["/owner/repo"] - mcp:github:github://owner/repo -> server=github, paths=["/owner/repo"]

func Is

func Is(uri string) bool

Is reports whether the URI uses the MCP scheme (mcp: or mcp://).

func JoinResourcePath

func JoinResourcePath(baseURI, rel string) string

JoinResourcePath appends a relative path to a resource URI. It preserves the scheme/host when the base URI is fully qualified.

func NormalizeForCompare

func NormalizeForCompare(value string) string

NormalizeForCompare returns a canonical MCP URI string for comparisons. It collapses legacy forms into mcp:<server>://<resource> and trims trailing slashes.

func Parse

func Parse(src string) (server, uri string)

Parse splits an MCP URI into (server, resourceURI). Supports: - mcp://server/path - mcp:server:/path - mcp:server://<resource> When parsing fails, empty strings are returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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