mcpfs

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewObjectFromURI

func NewObjectFromURI(mcpURL string) storage.Object

NewObjectFromURI builds a minimal storage.Object for a given mcp URL. It is useful for direct downloads when a full Resource descriptor is not available.

func ResolveSnapshotPath

func ResolveSnapshotPath(ctx context.Context, template string) string

ResolveSnapshotPath resolves a snapshot cache root template using env overrides and defaults.

Types

type Composite

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

Composite implements embedius fs.Service delegating to MCP or AFS depending on the URI scheme.

func NewComposite

func NewComposite(mgr *mcpmgr.Manager, opts ...Option) *Composite

NewComposite constructs a composite fs service.

func (*Composite) Download

func (c *Composite) Download(ctx context.Context, object storage.Object) ([]byte, error)

func (*Composite) List

func (c *Composite) List(ctx context.Context, location string) ([]storage.Object, error)

func (*Composite) SnapshotUpToDate

func (c *Composite) SnapshotUpToDate(ctx context.Context, location string) (bool, error)

SnapshotUpToDate forwards snapshot checks to the MCP fs when applicable.

type Option

type Option func(*Service)

Option configures an MCP fs service.

func WithSnapshotCacheRoot

func WithSnapshotCacheRoot(template string) Option

WithSnapshotCacheRoot overrides the snapshot cache root template.

func WithSnapshotManifestResolver

func WithSnapshotManifestResolver(resolver SnapshotManifestResolver) Option

WithSnapshotManifestResolver instructs the MCP fs to use snapshot MD5 manifests when enabled.

func WithSnapshotResolver

func WithSnapshotResolver(resolver SnapshotResolver) Option

WithSnapshotResolver instructs the MCP fs to prefer snapshot reads when available.

type Service

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

Service implements embedius fs.Service for MCP resources. It lists and downloads resources via a per-conversation MCP client manager.

func New

func New(mgr *mcpmgr.Manager, opts ...Option) *Service

New returns an MCP-backed fs service.

func (*Service) Download

func (s *Service) Download(ctx context.Context, object storage.Object) ([]byte, error)

Download reads the MCP resource contents for the given object.

func (*Service) DownloadDirect

func (s *Service) DownloadDirect(ctx context.Context, object storage.Object) ([]byte, error)

DownloadDirect bypasses snapshot resolution and fetches the resource directly.

func (*Service) List

func (s *Service) List(ctx context.Context, location string) ([]storage.Object, error)

List returns MCP resources under the given location prefix. Accepts formats: mcp://server/path or mcp:server:/path

func (*Service) SetSnapshotManifestResolver

func (s *Service) SetSnapshotManifestResolver(resolver SnapshotManifestResolver)

SetSnapshotManifestResolver updates the snapshot manifest resolver for an existing MCP fs service.

func (*Service) SetSnapshotResolver

func (s *Service) SetSnapshotResolver(resolver SnapshotResolver)

SetSnapshotResolver updates the snapshot resolver for an existing MCP fs service.

func (*Service) SnapshotUpToDate

func (s *Service) SnapshotUpToDate(ctx context.Context, location string) (bool, error)

SnapshotUpToDate reports whether a cached snapshot matches the remote size.

type SnapshotManifestResolver

type SnapshotManifestResolver func(location string) bool

SnapshotManifestResolver reports whether a location should use snapshot MD5 manifests.

type SnapshotResolver

type SnapshotResolver func(location string) (snapshotURI, rootURI string, ok bool)

SnapshotResolver maps a location to an MCP snapshot URI and its root.

Jump to

Keyboard shortcuts

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