mcp

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	ID             string    `json:"id"`
	SiteKey        string    `json:"site_key"`
	Status         JobStatus `json:"status"`
	StartedAt      time.Time `json:"started_at"`
	CompletedAt    time.Time `json:"completed_at,omitempty"`
	PagesProcessed int64     `json:"pages_processed"`
	PagesQueued    int64     `json:"pages_queued"`
	ErrorMessage   string    `json:"error_message,omitempty"`
	Incremental    bool      `json:"incremental"`
	// contains filtered or unexported fields
}

Job represents a background crawl job

type JobManager

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

JobManager manages background crawl jobs

func NewJobManager

func NewJobManager() *JobManager

NewJobManager creates a new job manager

func (*JobManager) CancelAll

func (m *JobManager) CancelAll()

CancelAll cancels all running jobs

func (*JobManager) CancelJob

func (m *JobManager) CancelJob(jobID string) bool

CancelJob cancels a running job

func (*JobManager) CreateJob

func (m *JobManager) CreateJob(siteKey string, incremental bool) (*Job, error)

CreateJob creates a new job for a site

func (*JobManager) GetContext

func (m *JobManager) GetContext(jobID string) context.Context

GetContext returns the context for a job (for running the crawler)

func (*JobManager) GetJob

func (m *JobManager) GetJob(jobID string) *Job

GetJob retrieves a job by ID

func (*JobManager) GetJobBySite

func (m *JobManager) GetJobBySite(siteKey string) *Job

GetJobBySite retrieves the current job for a site

func (*JobManager) IsRunning

func (m *JobManager) IsRunning(siteKey string) bool

IsRunning checks if a job is currently running for a site

func (*JobManager) ListJobs

func (m *JobManager) ListJobs() []*Job

ListJobs returns all jobs

func (*JobManager) UpdateProgress

func (m *JobManager) UpdateProgress(jobID string, processed, queued int64)

UpdateProgress updates the progress counters of a job

func (*JobManager) UpdateStatus

func (m *JobManager) UpdateStatus(jobID string, status JobStatus, errorMsg string)

UpdateStatus updates the status of a job

type JobStatus

type JobStatus string

JobStatus represents the current state of a crawl job

const (
	JobStatusPending   JobStatus = "pending"
	JobStatusRunning   JobStatus = "running"
	JobStatusCompleted JobStatus = "completed"
	JobStatusFailed    JobStatus = "failed"
	JobStatusCancelled JobStatus = "cancelled"
)

type Server

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

Server wraps the MCP server with doc-scraper specific functionality

func NewServer

func NewServer(cfg *ServerConfig) (*Server, error)

NewServer creates a new MCP server instance

func (*Server) Run

func (s *Server) Run() error

Run starts the MCP server with the configured transport

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server

type ServerConfig

type ServerConfig struct {
	AppConfig  *config.AppConfig
	ConfigPath string
	Transport  string // "stdio" or "sse"
	Port       int
	Logger     *logrus.Logger
}

ServerConfig holds configuration for the MCP server

Jump to

Keyboard shortcuts

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