mcpserver

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mcpserver exposes gocrawl over the Model Context Protocol so agentic tools such as Conductor or Claude Code can drive crawls directly. It registers two tools: "crawl" (run a crawl + analysis and return a structured report) and "list_analyzers".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(version string) *mcp.Server

New builds the gocrawl MCP server.

Types

type CrawlInput

type CrawlInput struct {
	URL           string   `json:"url" jsonschema:"Seed URL to crawl (e.g. https://example.com)"`
	Depth         *int     `` /* 126-byte string literal not displayed */
	MaxPages      *int     `json:"max_pages,omitempty" jsonschema:"Hard cap on the number of pages crawled (default 500)"`
	Concurrency   *int     `json:"concurrency,omitempty" jsonschema:"Number of parallel fetch workers (default 4)"`
	Render        string   `json:"render,omitempty" jsonschema:"Rendering mode: 'raw' (default) or 'headless'"`
	Analyzers     []string `json:"analyzers,omitempty" jsonschema:"Subset of analyzer names to run; empty runs all"`
	Specialized   *bool    `` /* 140-byte string literal not displayed */
	RespectRobots *bool    `json:"respect_robots,omitempty" jsonschema:"Obey robots.txt while crawling (default true)"`
	Subdomains    *bool    `json:"subdomains,omitempty" jsonschema:"Follow links to subdomains of the seed host"`
	Include       []string `json:"include,omitempty" jsonschema:"Only crawl URLs matching at least one of these regexes"`
	Exclude       []string `json:"exclude,omitempty" jsonschema:"Skip URLs matching any of these regexes"`

	UserAgent         string   `json:"user_agent,omitempty" jsonschema:"User-Agent header sent on every request"`
	UserAgents        []string `json:"user_agents,omitempty" jsonschema:"Pool of User-Agent strings to rotate across (supersedes user_agent)"`
	UserAgentRotation string   `json:"user_agent_rotation,omitempty" jsonschema:"Rotation across user_agents: off, round-robin, or random"`
	Proxy             string   `json:"proxy,omitempty" jsonschema:"Route requests through this proxy URL (http(s):// or socks5://; supports user:pass@host)"`
	Proxies           []string `json:"proxies,omitempty" jsonschema:"Pool of proxy URLs to rotate across"`
	ProxyRotation     string   `json:"proxy_rotation,omitempty" jsonschema:"Rotation across proxies: off, round-robin, random, or sticky-host"`
}

CrawlInput is the MCP "crawl" tool input. Optional fields override the defaults.

type CrawlOutput

type CrawlOutput struct {
	Report *report.Report `json:"report"`
}

CrawlOutput is the MCP "crawl" tool output: the full crawl report.

type ListAnalyzersInput

type ListAnalyzersInput struct{}

ListAnalyzersInput is the (empty) input for the "list_analyzers" tool.

type ListAnalyzersOutput

type ListAnalyzersOutput struct {
	Analyzers []runner.AnalyzerInfo `json:"analyzers"`
}

ListAnalyzersOutput lists the available analyzers.

Jump to

Keyboard shortcuts

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