Documentation
¶
Index ¶
- func New(client OSFClient, opts Options) *mcp.Server
- type ContributorOutput
- type ContributorsResult
- type EmptyInput
- type FileOutput
- type FilesInput
- type FilesResult
- type NodeInput
- type NodeOutput
- type NodeResult
- type NodesResult
- type OSFClient
- type Options
- type Server
- func (s *Server) GetProject(ctx context.Context, _ *mcp.CallToolRequest, in NodeInput) (*mcp.CallToolResult, NodeResult, error)
- func (s *Server) ListComponents(ctx context.Context, _ *mcp.CallToolRequest, in NodeInput) (*mcp.CallToolResult, NodesResult, error)
- func (s *Server) ListContributors(ctx context.Context, _ *mcp.CallToolRequest, in NodeInput) (*mcp.CallToolResult, ContributorsResult, error)
- func (s *Server) ListFiles(ctx context.Context, _ *mcp.CallToolRequest, in FilesInput) (*mcp.CallToolResult, FilesResult, error)
- func (s *Server) ListProjects(ctx context.Context, _ *mcp.CallToolRequest, _ EmptyInput) (*mcp.CallToolResult, NodesResult, error)
- func (s *Server) Whoami(ctx context.Context, _ *mcp.CallToolRequest, _ EmptyInput) (*mcp.CallToolResult, UserResult, error)
- type UserOutput
- type UserResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContributorOutput ¶
type ContributorsResult ¶
type ContributorsResult struct {
Contributors []ContributorOutput `json:"contributors"`
}
type EmptyInput ¶
type EmptyInput struct{}
type FileOutput ¶
type FilesInput ¶
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 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 Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetProject ¶
func (s *Server) GetProject(ctx context.Context, _ *mcp.CallToolRequest, in NodeInput) (*mcp.CallToolResult, NodeResult, error)
func (*Server) ListComponents ¶
func (s *Server) ListComponents(ctx context.Context, _ *mcp.CallToolRequest, in NodeInput) (*mcp.CallToolResult, NodesResult, error)
func (*Server) ListContributors ¶
func (s *Server) ListContributors(ctx context.Context, _ *mcp.CallToolRequest, in NodeInput) (*mcp.CallToolResult, ContributorsResult, error)
func (*Server) ListFiles ¶
func (s *Server) ListFiles(ctx context.Context, _ *mcp.CallToolRequest, in FilesInput) (*mcp.CallToolResult, FilesResult, error)
func (*Server) ListProjects ¶
func (s *Server) ListProjects(ctx context.Context, _ *mcp.CallToolRequest, _ EmptyInput) (*mcp.CallToolResult, NodesResult, error)
func (*Server) Whoami ¶
func (s *Server) Whoami(ctx context.Context, _ *mcp.CallToolRequest, _ EmptyInput) (*mcp.CallToolResult, UserResult, error)
type UserOutput ¶
type UserResult ¶
type UserResult struct {
User UserOutput `json:"user"`
}
Click to show internal directories.
Click to hide internal directories.