server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package server wires the pkgsite client to an MCP server, exposing each pkg.go.dev API endpoint as a tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(client *pkgsite.Client, name, version string) *mcp.Server

New returns an MCP server that exposes the pkg.go.dev API as tools, backed by the given client.

Types

type GetImportedByInput

type GetImportedByInput struct {
	Path    string `json:"path" jsonschema:"import path of the package to find importers of, e.g. github.com/google/uuid"`
	Version string `json:"version,omitempty" jsonschema:"module version, e.g. v1.6.0; omit for the latest"`
	Module  string `` /* 139-byte string literal not displayed */
	Limit   int    `json:"limit,omitempty" jsonschema:"maximum importers to return; omit for a server-side default"`
	Token   string `json:"token,omitempty" jsonschema:"pagination token: pass nextPageToken from a previous response to fetch the next page"`
}

GetImportedByInput is the input for the get_imported_by tool.

type GetModuleInput

type GetModuleInput struct {
	Path     string `json:"path" jsonschema:"module path, e.g. github.com/google/uuid (the module, not a package within it)"`
	Version  string `json:"version,omitempty" jsonschema:"module version, e.g. v1.6.0; omit for the latest"`
	Readme   bool   `json:"readme,omitempty" jsonschema:"include the module's README contents"`
	Licenses bool   `json:"licenses,omitempty" jsonschema:"include full license info (types and text)"`
}

GetModuleInput is the input for the get_module tool.

type GetPackageInput

type GetPackageInput struct {
	Path     string `json:"path" jsonschema:"import path of the package, e.g. github.com/google/uuid (or a standard-library path like net/http)"`
	Version  string `json:"version,omitempty" jsonschema:"module version, e.g. v1.6.0; omit for the latest"`
	Module   string `` /* 139-byte string literal not displayed */
	Doc      string `` /* 129-byte string literal not displayed */
	Examples bool   `json:"examples,omitempty" jsonschema:"include runnable examples in the documentation (requires doc)"`
	Imports  bool   `json:"imports,omitempty" jsonschema:"include the list of packages this package imports"`
	Licenses bool   `json:"licenses,omitempty" jsonschema:"include full license info (types and text)"`
	GOOS     string `json:"goos,omitempty" jsonschema:"target GOOS for build-constrained docs, e.g. linux"`
	GOARCH   string `json:"goarch,omitempty" jsonschema:"target GOARCH for build-constrained docs, e.g. amd64"`
}

GetPackageInput is the input for the get_package tool.

type GetSymbolsInput

type GetSymbolsInput struct {
	Path    string `json:"path" jsonschema:"import path of the package, e.g. github.com/google/uuid (or a standard-library path like net/http)"`
	Version string `json:"version,omitempty" jsonschema:"module version, e.g. v1.6.0; omit for the latest"`
	Module  string `` /* 139-byte string literal not displayed */
	GOOS    string `json:"goos,omitempty" jsonschema:"target GOOS, e.g. linux"`
	GOARCH  string `json:"goarch,omitempty" jsonschema:"target GOARCH, e.g. amd64"`
	Limit   int    `json:"limit,omitempty" jsonschema:"maximum symbols to return; omit for a server-side default"`
	Token   string `json:"token,omitempty" jsonschema:"pagination token: pass nextPageToken from a previous response to fetch the next page"`
}

GetSymbolsInput is the input for the get_package_symbols tool.

type GetVulnsInput

type GetVulnsInput struct {
	Path    string `json:"path" jsonschema:"module path, e.g. github.com/google/uuid (the module, not a package within it)"`
	Version string `json:"version,omitempty" jsonschema:"module version, e.g. v1.6.0; omit for the latest"`
	Limit   int    `json:"limit,omitempty" jsonschema:"maximum vulnerabilities to return; omit for a server-side default"`
	Token   string `json:"token,omitempty" jsonschema:"pagination token: pass nextPageToken from a previous response to fetch the next page"`
}

GetVulnsInput is the input for the get_vulnerabilities tool.

type ListPackagesInput

type ListPackagesInput struct {
	ModulePath string `json:"modulePath" jsonschema:"module path, e.g. github.com/google/uuid (the module, not a package within it)"`
	Version    string `json:"version,omitempty" jsonschema:"module version, e.g. v1.6.0; omit for the latest"`
	Limit      int    `json:"limit,omitempty" jsonschema:"maximum packages to return; omit for a server-side default"`
	Token      string `json:"token,omitempty" jsonschema:"pagination token: pass nextPageToken from a previous response to fetch the next page"`
}

ListPackagesInput is the input for the list_module_packages tool.

type ListVersionsInput

type ListVersionsInput struct {
	Path  string `json:"path" jsonschema:"module path, e.g. github.com/google/uuid (the module, not a package within it)"`
	Limit int    `json:"limit,omitempty" jsonschema:"maximum versions to return; omit for a server-side default"`
	Token string `json:"token,omitempty" jsonschema:"pagination token: pass nextPageToken from a previous response to fetch the next page"`
}

ListVersionsInput is the input for the list_module_versions tool.

type SearchInput

type SearchInput struct {
	Query  string `json:"query" jsonschema:"search query: a package name or keywords, e.g. yaml or http router"`
	Symbol string `json:"symbol,omitempty" jsonschema:"restrict results to packages that export this symbol, e.g. Marshal"`
	Limit  int    `json:"limit,omitempty" jsonschema:"maximum results to return; omit for a server-side default"`
	Token  string `json:"token,omitempty" jsonschema:"pagination token: pass nextPageToken from a previous response to fetch the next page"`
}

SearchInput is the input for the search tool.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server holds the dependencies shared by all tool handlers.

Jump to

Keyboard shortcuts

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