mcpserver

package
v1.0.0-rc.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(client OSFClient, opts Options) *mcp.Server

New returns an MCP server with read-only OSF tools registered.

Types

type ContributorOutput

type ContributorOutput struct {
	ID             string `json:"id"`
	Type           string `json:"type,omitempty"`
	FullName       string `json:"fullName,omitempty"`
	Bibliographic  bool   `json:"bibliographic"`
	Permission     string `json:"permission,omitempty"`
	ProfileSelfURL string `json:"profileSelfUrl,omitempty"`
}

type ContributorsResult

type ContributorsResult struct {
	Contributors []ContributorOutput `json:"contributors"`
}

type DOIInput added in v1.0.0

type DOIInput struct {
	Identifier string `json:"identifier" jsonschema:"DOI, doi.org URL, or OSF DOI URL"`
}

type DOIResult added in v1.0.0

type DOIResult struct {
	DOI         string `json:"doi"`
	ResolvedURL string `json:"resolvedUrl"`
}

type EmptyInput

type EmptyInput struct{}

type FileInput added in v1.0.0

type FileInput struct {
	ID string `json:"id" jsonschema:"OSF file id"`
}

type FileOutput

type FileOutput struct {
	ID          string `json:"id"`
	Type        string `json:"type,omitempty"`
	Name        string `json:"name,omitempty"`
	Kind        string `json:"kind,omitempty"`
	Size        int64  `json:"size,omitempty"`
	MD5         string `json:"md5,omitempty"`
	SelfURL     string `json:"selfUrl,omitempty"`
	DownloadURL string `json:"downloadUrl,omitempty"`
}

type FileVersionOutput added in v1.0.0

type FileVersionOutput struct {
	ID           string    `json:"id"`
	Type         string    `json:"type,omitempty"`
	Size         int64     `json:"size,omitempty"`
	DateCreated  time.Time `json:"dateCreated,omitempty"`
	DateModified time.Time `json:"dateModified,omitempty"`
	SelfURL      string    `json:"selfUrl,omitempty"`
}

type FileVersionsResult added in v1.0.0

type FileVersionsResult struct {
	Versions []FileVersionOutput `json:"versions"`
}

type FilesInput

type FilesInput struct {
	ID   string `json:"id" jsonschema:"OSF project/component id or URL"`
	Path string `json:"path,omitempty" jsonschema:"optional path below OSF Storage"`
}

type FilesResult

type FilesResult struct {
	Files []FileOutput `json:"files"`
}

type NodeInput

type NodeInput struct {
	ID string `json:"id" jsonschema:"OSF project/component id or URL"`
}

type NodeOutput

type NodeOutput struct {
	ID          string `json:"id"`
	Type        string `json:"type,omitempty"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Category    string `json:"category,omitempty"`
	SelfURL     string `json:"selfUrl,omitempty"`
}

type NodeResult

type NodeResult struct {
	Node NodeOutput `json:"node"`
}

type NodesResult

type NodesResult struct {
	Nodes []NodeOutput `json:"nodes"`
}

type OSFClient

type OSFClient interface {
	CurrentUser(context.Context) (osfapi.User, error)
	ListCurrentUserProjects(context.Context) ([]osfapi.Node, error)
	GetNode(context.Context, string) (osfapi.Node, error)
	ListNodeChildren(context.Context, string) ([]osfapi.Node, error)
	ListNodeContributors(context.Context, string) ([]osfapi.Contributor, error)
	ListStorageFiles(context.Context, string, ...string) ([]osfapi.StorageFile, error)
	ListFileVersions(context.Context, string) ([]osfapi.FileVersion, error)
	ListNodeAddons(context.Context, string) ([]osfapi.Node, error)
	ListWikiPages(context.Context, string) ([]osfapi.RelatedResource, error)
	ListNodeComments(context.Context, string) ([]osfapi.RelatedResource, error)
	ListNodeLogs(context.Context, string) ([]osfapi.RelatedResource, error)
	ListNodeIdentifiers(context.Context, string) ([]osfapi.RelatedResource, error)
	SearchOSF(context.Context, string, ...int) ([]osfapi.SearchResult, error)
	ListPreprints(context.Context, string, ...int) ([]osfapi.Node, error)
	SearchPreprints(context.Context, string, string, ...int) ([]osfapi.Preprint, error)
	ResolveDOI(context.Context, string) (osfapi.DOIResolution, error)
}

OSFClient is the read-only OSF API surface exposed through MCP tools.

type Options

type Options struct {
	Version string
	Events  observability.Emitter
}

type PreprintOutput added in v1.0.0

type PreprintOutput struct {
	ID            string `json:"id"`
	Type          string `json:"type,omitempty"`
	Title         string `json:"title,omitempty"`
	DatePublished string `json:"datePublished,omitempty"`
	Published     bool   `json:"published"`
	DOI           string `json:"doi,omitempty"`
	URL           string `json:"url,omitempty"`
	Source        string `json:"source"`
}

type PreprintSearchInput added in v1.0.0

type PreprintSearchInput struct {
	Query    string `json:"query" jsonschema:"title search query"`
	Provider string `json:"provider,omitempty" jsonschema:"optional preprint provider filter"`
	Limit    int    `json:"limit,omitempty" jsonschema:"maximum number of results; zero uses the server default"`
}

type PreprintsInput added in v1.0.0

type PreprintsInput struct {
	Provider string `json:"provider,omitempty" jsonschema:"optional preprint provider filter"`
	Limit    int    `json:"limit,omitempty" jsonschema:"maximum number of results; zero uses the server default"`
}

type PreprintsResult added in v1.0.0

type PreprintsResult struct {
	Preprints []PreprintOutput `json:"preprints"`
}

type RelatedResourceOutput added in v1.0.0

type RelatedResourceOutput struct {
	ID         string         `json:"id"`
	Type       string         `json:"type,omitempty"`
	Attributes map[string]any `json:"attributes,omitempty"`
	SelfURL    string         `json:"selfUrl,omitempty"`
}

type RelatedResourcesResult added in v1.0.0

type RelatedResourcesResult struct {
	Resources []RelatedResourceOutput `json:"resources"`
}

type SearchInput added in v1.0.0

type SearchInput struct {
	Query string `json:"query" jsonschema:"OSF search query"`
	Limit int    `json:"limit,omitempty" jsonschema:"maximum number of results; zero uses the server default"`
}

type SearchResult added in v1.0.0

type SearchResult struct {
	ID          string   `json:"id"`
	Type        string   `json:"type,omitempty"`
	Title       string   `json:"title,omitempty"`
	Description string   `json:"description,omitempty"`
	Category    string   `json:"category,omitempty"`
	URL         string   `json:"url,omitempty"`
	Keywords    []string `json:"keywords,omitempty"`
	Year        string   `json:"year,omitempty"`
}

type SearchResults added in v1.0.0

type SearchResults struct {
	Results []SearchResult `json:"results"`
}

type Server

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

func (*Server) GetProject

func (*Server) ListAddons added in v1.0.0

func (*Server) ListComments added in v1.0.0

func (*Server) ListComponents

func (s *Server) ListComponents(ctx context.Context, _ *mcp.CallToolRequest, in NodeInput) (*mcp.CallToolResult, NodesResult, error)

func (*Server) ListContributors

func (*Server) ListFileVersions added in v1.0.0

func (*Server) ListFiles

func (*Server) ListIdentifiers added in v1.0.0

func (*Server) ListLogs added in v1.0.0

func (*Server) ListPreprints added in v1.0.0

func (*Server) ListProjects

func (*Server) ListWikis added in v1.0.0

func (*Server) ResolveDOI added in v1.0.0

func (*Server) Search added in v1.0.0

func (*Server) SearchPreprints added in v1.0.0

func (*Server) Whoami

type UserOutput

type UserOutput struct {
	ID       string `json:"id"`
	Type     string `json:"type,omitempty"`
	FullName string `json:"fullName,omitempty"`
	SelfURL  string `json:"selfUrl,omitempty"`
}

type UserResult

type UserResult struct {
	User UserOutput `json:"user"`
}

Jump to

Keyboard shortcuts

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