mcp

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package mcp provides an MCP (Model Context Protocol) server for parse-dmarc. It exposes DMARC report data and analysis tools to MCP clients like Claude.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResultStatsOutput

type AuthResultStatsOutput struct {
	Results []storage.AuthResultStats `json:"results"`
	Count   int                       `json:"count"`
}

AuthResultStatsOutput wraps authentication result statistics response.

type Config

type Config struct {
	// HTTPAddr is the address for HTTP/SSE transport. If empty, only stdio is used.
	HTTPAddr string
	// Version info for the server implementation.
	Version string
	// Logger for the server
	Logger *zerolog.Logger
	// OAuth holds OAuth2 configuration for protected HTTP endpoints.
	OAuth *oauth.Config
}

Config holds MCP server configuration.

type DomainStatsOutput

type DomainStatsOutput struct {
	Domains []storage.DomainStats `json:"domains"`
	Count   int                   `json:"count"`
}

DomainStatsOutput wraps domain statistics response.

type EmptyInput

type EmptyInput struct{}

EmptyInput is used for tools that don't require any input.

type LimitInput

type LimitInput struct {
	Limit int `json:"limit,omitempty" jsonschema:"maximum number of results to return (default: 10)"`
}

LimitInput is used for tools that only need a limit parameter.

type OrgStatsOutput

type OrgStatsOutput struct {
	Organizations []storage.OrgStats `json:"organizations"`
	Count         int                `json:"count"`
}

OrgStatsOutput wraps organization statistics response.

type PaginationInput

type PaginationInput struct {
	Limit  int `json:"limit,omitempty" jsonschema:"maximum number of results to return (default: 50)"`
	Offset int `json:"offset,omitempty" jsonschema:"number of results to skip for pagination (default: 0)"`
}

PaginationInput is used for tools that support pagination.

type ParseReportInput

type ParseReportInput struct {
	ReportData string `json:"report_data" jsonschema:"base64 encoded DMARC report data (gzip/zip/XML)"`
}

ParseReportInput is used for parsing raw DMARC reports.

type ParsedReportOutput

type ParsedReportOutput struct {
	Report         *parser.Feedback `json:"report"`
	TotalMessages  int              `json:"total_messages"`
	CompliantCount int              `json:"compliant_count"`
	ComplianceRate float64          `json:"compliance_rate"`
	DateBegin      string           `json:"date_begin"`
	DateEnd        string           `json:"date_end"`
}

ParsedReportOutput wraps a parsed DMARC report response.

type ReportIDInput

type ReportIDInput struct {
	ID int64 `json:"id" jsonschema:"the database ID of the report to retrieve"`
}

ReportIDInput is used for tools that require a report ID.

type ReportOutput

type ReportOutput struct {
	Report *parser.Feedback `json:"report"`
}

ReportOutput wraps a single report response.

type ReportsOutput

type ReportsOutput struct {
	Reports []storage.ReportSummary `json:"reports"`
	Count   int                     `json:"count"`
}

ReportsOutput wraps the reports list response.

type Server

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

Server wraps the MCP server with storage access.

func NewServer

func NewServer(store *storage.Storage, cfg *Config) *Server

NewServer creates a new MCP server with all DMARC tools registered.

func (*Server) RunHTTP

func (s *Server) RunHTTP(ctx context.Context, addr string, oauthCfg *oauth.Config) error

RunHTTP runs the MCP server over HTTP/SSE transport.

func (*Server) RunStdio

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

RunStdio runs the MCP server over stdio transport.

type StatisticsOutput

type StatisticsOutput struct {
	Statistics *storage.Statistics `json:"statistics"`
}

StatisticsOutput wraps the statistics response.

type TopSourceIPsOutput

type TopSourceIPsOutput struct {
	SourceIPs []storage.TopSourceIP `json:"source_ips"`
	Count     int                   `json:"count"`
}

TopSourceIPsOutput wraps the top source IPs response.

Directories

Path Synopsis
Package oauth provides OAuth 2.1 authentication for MCP servers.
Package oauth provides OAuth 2.1 authentication for MCP servers.

Jump to

Keyboard shortcuts

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