mcpserver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 7 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 EmptyInput

type EmptyInput struct{}

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"`
	SelfURL     string `json:"selfUrl,omitempty"`
	DownloadURL string `json:"downloadUrl,omitempty"`
}

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)
}

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

type Options

type Options struct {
	Version string
}

type Server

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

func (*Server) GetProject

func (*Server) ListComponents

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

func (*Server) ListContributors

func (*Server) ListFiles

func (*Server) ListProjects

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