mcpserver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package mcpserver exposes GitContribute application capabilities through the Model Context Protocol.

Reader tools and resources are local and offline. Operator tools declare network reads, local writes, durable jobs, or process execution through distinct interfaces and MCP annotations. Protocol payloads are mapped to product-owned application contracts rather than implementing use cases here.

Index

Constants

View Source
const (
	// ToolListConcerns searches the offline local concern ledger.
	ToolListConcerns = "corpus.list_concerns"
	// ToolCreateConcern records one local concern.
	ToolCreateConcern = "workflow.create_concern"
	// ToolUpdateConcern updates concern content.
	ToolUpdateConcern = "workflow.update_concern"
	// ToolSetConcernState transitions concern status.
	ToolSetConcernState = "workflow.set_concern_status"
	// ToolLinkConcern stores an explicit concern relationship.
	ToolLinkConcern = "workflow.link_concern"
	// ToolPromoteConcern creates downstream workflow atomically.
	ToolPromoteConcern = "workflow.promote_concern"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CIFailureOperator added in v0.16.0

type CIFailureOperator interface {
	SyncCIFailures(context.Context, mcpcontract.SyncCIFailuresInput) (mcpcontract.JobReference, error)
}

type CodeIndexReader added in v0.17.0

type CodeIndexReader interface {
	CodeIndexArtifact(context.Context, string) (mcpcontract.CodeIndexArtifact, error)
}

CodeIndexReader exposes one immutable indexed-commit handoff through the resource plane. It is intentionally separate from the acquisition writer.

type CodeIndexer added in v0.10.0

type CodeIndexer interface {
	IndexRepositories(context.Context, mcpcontract.IndexRepositoriesInput) (mcpcontract.JobReference, error)
}

CodeIndexer safely acquires and indexes repository code.

type CodeSearchBatchReader added in v0.18.0

type CodeSearchBatchReader interface {
	SearchCodeBatch(context.Context, mcpcontract.SearchCodeBatchInput) (mcpcontract.SearchCodeBatchOutput, error)
}

CodeSearchBatchReader exposes one bounded offline batch over a shared code snapshot scope. It remains separate from Reader so existing local readers can retain the single-query compatibility tool.

type CommitPlannerReader added in v0.10.0

CommitPlannerReader performs local, read-only Git inspection and planning.

type ConcernReader added in v0.10.0

type ConcernReader interface {
	ListConcerns(context.Context, mcpcontract.ListConcernsInput) (mcpcontract.ConcernListOutput, error)
}

ConcernReader exposes bounded offline concern reads.

type ContributionPreflightReader added in v0.19.0

type ContributionPreflightReader interface {
	PreflightContribution(context.Context, mcpcontract.ContributionPreflightInput) (mcpcontract.ContributionPreflightOutput, error)
}

ContributionPreflightReader performs a bounded live read plus local worktree inspection without creating or mutating workflow state.

type CoverageOperator added in v0.17.0

type CoverageOperator interface {
	EnsureCoverage(context.Context, mcpcontract.EnsureCoverageInput) (mcpcontract.JobReference, error)
}

type FixPatternOperator added in v0.14.0

type FixPatternOperator interface {
	MineRepositoryFixPatterns(context.Context, mcpcontract.MineRepositoryFixPatternsInput) (mcpcontract.JobReference, error)
}

FixPatternOperator owns the bounded repository-level search, finalist hydration, and typed report workflow. It performs GitHub reads and updates only the local corpus.

type FixPatternPreviewReader added in v0.17.0

type FixPatternPreviewReader interface {
	PreviewRepositoryFixPatterns(context.Context, mcpcontract.PreviewRepositoryFixPatternsInput) (mcpcontract.FixPatternReport, error)
}

FixPatternPreviewReader exposes bounded analytical fix-pattern reads without job creation, hydration, persistence, or network access.

type FixPatternReader added in v0.14.0

type FixPatternReader interface {
	GetFixPatternReport(context.Context, string) (mcpcontract.FixPatternReport, error)
}

FixPatternReader exposes only terminal persisted reports and remains offline.

type FixPatternWorkflow added in v0.14.0

type FixPatternWorkflow interface {
	FixPatternOperator
	FixPatternReader
}

FixPatternWorkflow keeps submission and persisted report retrieval together so an advertised workflow never returns an unreadable resource link.

type GitHubAcquisitionOperator added in v0.18.0

GitHubAcquisitionOperator exposes synchronous, explicitly bounded live GitHub acquisition that writes only local corpus observations and artifacts. It is separate from GitHubOperator so older adapters can retain their existing capability set while the new acquisition tools are adopted.

type GitHubOperator added in v0.10.0

GitHubOperator exposes bounded GitHub reads that update only the local corpus.

type GitHubThreadSearchArtifactReader added in v0.18.0

type GitHubThreadSearchArtifactReader interface {
	ReadGitHubThreadSearchArtifact(context.Context, string) (mcpcontract.GitHubThreadSearchArtifact, error)
}

type IssueSetReader added in v0.12.0

type IssueSetReader interface {
	PrepareIssueSet(context.Context, mcpcontract.PrepareIssueSetInput) (mcpcontract.PrepareIssueSetOutput, error)
}

IssueSetReader prepares bounded contribution evidence from exact stored issues without requiring or creating durable workflow state.

type MergeConflictReader added in v0.10.0

type MergeConflictReader interface {
	CheckMergeConflicts(context.Context, mcpcontract.CheckMergeConflictsInput) (mcpcontract.CheckMergeConflictsOutput, error)
}

MergeConflictReader performs local, non-mutating Git comparisons.

type NeighborReader

type NeighborReader interface {
	FindNeighbors(context.Context, mcpcontract.FindNeighborsInput) (mcpcontract.FindNeighborsOutput, error)
}

NeighborReader is the optional local nearest-thread query capability.

type PortfolioOperator added in v0.6.0

type PortfolioOperator interface {
	LinkPullRequest(context.Context, mcpcontract.LinkPullRequestInput) (mcpcontract.LinkPullRequestOutput, error)
}

PortfolioOperator owns explicit local links between observed pull requests and contribution workflow state. It never mutates GitHub.

type PortfolioReader added in v0.10.0

PortfolioReader exposes bounded offline pull-request portfolio reads.

type PublishedDraftVerifier added in v0.14.0

type PublishedDraftVerifier interface {
	VerifyPublishedDraft(context.Context, mcpcontract.VerifyPublishedDraftInput) (mcpcontract.PublishedDraftVerificationOutput, error)
}

type PullRequestFeedbackIndexer added in v0.19.0

type PullRequestFeedbackIndexer interface {
	IndexPullRequestFeedback(context.Context, mcpcontract.IndexPullRequestFeedbackInput) (mcpcontract.JobReference, error)
}

PullRequestFeedbackIndexer owns an explicit repository-wide network read that writes only local observations and rebuildable projections.

type PullRequestFeedbackOperator added in v0.16.0

type PullRequestFeedbackOperator interface {
	SyncPullRequestFeedback(context.Context, mcpcontract.SyncPullRequestFeedbackInput) (mcpcontract.JobReference, error)
}

type PullRequestFeedbackSearcher added in v0.19.0

type PullRequestFeedbackSearcher interface {
	SearchPullRequestFeedback(context.Context, mcpcontract.SearchPullRequestFeedbackInput) (mcpcontract.SearchPullRequestFeedbackOutput, error)
}

PullRequestFeedbackSearcher is an offline corpus-only feedback query.

type ResearchReader added in v0.10.0

type ResearchReader interface {
	DeepWiki(context.Context, mcpcontract.DeepWikiInput) (mcpcontract.DeepWikiOutput, error)
}

ResearchReader exposes external derived repository context.

type ScalableReader added in v0.5.0

ScalableReader exposes bounded vectorized corpus reads. Implementations must remain offline and preserve input order for non-ranked results.

type SearchThreadsInput

type SearchThreadsInput struct {
	Query         string   `json:"query" jsonschema:"Thread full-text query"`
	Owner         string   `json:"owner,omitempty" jsonschema:"Optional repository owner"`
	Repo          string   `json:"repo,omitempty" jsonschema:"Optional repository name"`
	Kind          string   `json:"kind,omitempty" jsonschema:"Optional thread kind: issue or pull_request"`
	State         string   `json:"state,omitempty" jsonschema:"Optional open or closed state"`
	StateReason   string   `json:"state_reason,omitempty" jsonschema:"Optional GitHub completed or not_planned state reason"`
	Merged        *bool    `json:"merged,omitempty" jsonschema:"Optional pull request merged state"`
	Author        string   `json:"author,omitempty" jsonschema:"Optional author login"`
	Association   string   `json:"author_association,omitempty" jsonschema:"Optional GitHub author association"`
	Assignee      string   `json:"assignee,omitempty" jsonschema:"Optional assignee login"`
	Labels        []string `json:"labels,omitempty" jsonschema:"Labels that must all be present"`
	UpdatedAfter  string   `json:"updated_after,omitempty" jsonschema:"Optional RFC 3339 lower bound"`
	UpdatedBefore string   `json:"updated_before,omitempty" jsonschema:"Optional RFC 3339 upper bound"`
	Limit         int      `json:"limit,omitempty" jsonschema:"Maximum results from 1 to 100"`
	Cursor        string   `json:"cursor,omitempty" jsonschema:"Opaque cursor returned by the previous page"`
	Sort          string   `json:"sort,omitempty" jsonschema:"Order: relevance or updated"`
	MatchMode     string   `json:"match_mode,omitempty" jsonschema:"Term matching: all requires every term; any requires at least one term"`
	View          string   `json:"view,omitempty" jsonschema:"compact omits full bodies and returns bounded excerpts; full includes stored bodies"`
	SnapshotToken string   `json:"snapshot_token,omitempty" jsonschema:"Optional immutable corpus snapshot token"`
}

SearchThreadsInput describes an offline issue and pull-request search page.

type Server

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

Server owns the MCP protocol adapter around a local Reader.

func New

func New(reader mcpcontract.Reader, version string) (*Server, error)

New constructs an MCP server with the unified catalog.

func NewReadOnly added in v0.15.0

func NewReadOnly(reader mcpcontract.Reader, version string) (*Server, error)

NewReadOnly constructs an MCP server that advertises only read-only tools.

func (*Server) MCP

func (s *Server) MCP() *mcp.Server

MCP returns the underlying SDK server for embedding in another transport.

func (*Server) ServeStdio

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

ServeStdio serves MCP messages over standard input and output until the context is cancelled or the transport stops.

type SnapshotReader added in v0.17.0

type SnapshotReader interface {
	ReadSnapshot(context.Context, string) (mcpcontract.CorpusSnapshotArtifact, error)
}

type SourceBundleArtifactReader added in v0.18.0

type SourceBundleArtifactReader interface {
	ReadSourceBundleArtifact(context.Context, string) (mcpcontract.SourceBundleArtifact, error)
}

type ThreadFacetReader added in v0.17.0

type ThreadFacetReader interface {
	GetThreadFacets(context.Context, mcpcontract.GetThreadFacetsInput) (mcpcontract.GetThreadFacetsOutput, error)
}

ThreadFacetReader exposes the bounded offline facet metadata surface.

type ValidationReceiptOperator added in v0.14.0

type ValidationReceiptOperator interface {
	AttachValidationReceipt(context.Context, mcpcontract.AttachValidationReceiptInput) (mcpcontract.ExternalValidationReceiptOutput, error)
}

type WorkspaceAdopter added in v0.10.0

type WorkspaceAdopter interface {
	AdoptWorkspace(context.Context, mcpcontract.AdoptWorkspaceInput) (mcpcontract.AdoptWorkspaceOutput, error)
}

WorkspaceAdopter exposes non-owning external-worktree registration.

type WorkspaceCreator added in v0.10.0

type WorkspaceCreator interface {
	CreateWorkspace(context.Context, mcpcontract.CreateWorkspaceInput) (mcpcontract.JobReference, error)
}

WorkspaceCreator exposes managed workspace creation separately from the broader contribution workflow capability.

Jump to

Keyboard shortcuts

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