mcpserver

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 15 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 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 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 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 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 GitHubOperator added in v0.10.0

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

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 PullRequestFeedbackOperator added in v0.16.0

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

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"`
}

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 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