filesystemserver

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Maximum size for inline content (5MB)
	MAX_INLINE_SIZE = 5 * 1024 * 1024
	// Maximum size for base64 encoding (1MB)
	MAX_BASE64_SIZE = 1 * 1024 * 1024
	// Maximum number of search results to return (prevent excessive output)
	MAX_SEARCH_RESULTS = 1000
	// Maximum file size in bytes to search within (10MB)
	MAX_SEARCHABLE_SIZE = 10 * 1024 * 1024
)

Variables

View Source
var Version = "dev"

Functions

func NewFilesystemServer

func NewFilesystemServer(allowedDirs []string) (*server.MCPServer, error)

Types

type FileInfo

type FileInfo struct {
	Size        int64     `json:"size"`
	Created     time.Time `json:"created"`
	Modified    time.Time `json:"modified"`
	Accessed    time.Time `json:"accessed"`
	IsDirectory bool      `json:"isDirectory"`
	IsFile      bool      `json:"isFile"`
	Permissions string    `json:"permissions"`
}

type FileNode

type FileNode struct {
	Name     string      `json:"name"`
	Path     string      `json:"path"`
	Type     string      `json:"type"` // "file" or "directory"
	Size     int64       `json:"size,omitempty"`
	Modified time.Time   `json:"modified,omitempty"`
	Children []*FileNode `json:"children,omitempty"`
}

FileNode represents a node in the file tree

type FilesystemHandler added in v0.8.1

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

func NewFilesystemHandler added in v0.8.1

func NewFilesystemHandler(allowedDirs []string) (*FilesystemHandler, error)

type SearchResult added in v0.11.0

type SearchResult struct {
	FilePath    string
	LineNumber  int
	LineContent string
	ResourceURI string
}

SearchResult represents a single match in a file

Jump to

Keyboard shortcuts

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