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
- type CIFailureOperator
- type CodeIndexReader
- type CodeIndexer
- type CodeSearchBatchReader
- type CommitPlannerReader
- type ConcernOperator
- type ConcernReader
- type ContributionPreflightReader
- type CoverageOperator
- type FixPatternOperator
- type FixPatternPreviewReader
- type FixPatternReader
- type FixPatternWorkflow
- type GitHubAcquisitionOperator
- type GitHubOperator
- type GitHubThreadSearchArtifactReader
- type IssueSetReader
- type MergeConflictReader
- type NeighborReader
- type Operator
- type PortfolioOperator
- type PortfolioReader
- type PublishedDraftVerifier
- type PullRequestFeedbackIndexer
- type PullRequestFeedbackOperator
- type PullRequestFeedbackSearcher
- type ResearchReader
- type ScalableReader
- type SearchThreadsInput
- type Server
- type SnapshotReader
- type SourceBundleArtifactReader
- type ThreadFacetReader
- type ValidationReceiptOperator
- type WorkspaceAdopter
- type WorkspaceCreator
Constants ¶
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
type CommitPlannerReader interface {
InspectCommitChanges(context.Context, mcpcontract.InspectCommitChangesInput) (mcpcontract.CommitInventoryOutput, error)
PlanSemanticCommits(context.Context, mcpcontract.PlanSemanticCommitsInput) (mcpcontract.SemanticCommitPlanOutput, error)
}
CommitPlannerReader performs local, read-only Git inspection and planning.
type ConcernOperator ¶ added in v0.10.0
type ConcernOperator interface {
Concern(context.Context, mcpcontract.ConcernInput) (mcpcontract.ConcernOutput, error)
CreateConcern(context.Context, mcpcontract.CreateConcernInput) (mcpcontract.ConcernOutput, error)
UpdateConcern(context.Context, mcpcontract.UpdateConcernInput) (mcpcontract.ConcernOutput, error)
SetConcernStatus(context.Context, mcpcontract.SetConcernStatusInput) (mcpcontract.ConcernOutput, error)
LinkConcern(context.Context, mcpcontract.LinkConcernInput) (mcpcontract.ConcernOutput, error)
PromoteConcern(context.Context, mcpcontract.PromoteConcernInput) (mcpcontract.ConcernOutput, error)
}
ConcernOperator exposes local concern-ledger writes.
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
type GitHubAcquisitionOperator interface {
SearchGitHubThreads(context.Context, mcpcontract.SearchGitHubThreadsInput) (mcpcontract.SearchGitHubThreadsOutput, error)
ReadSourceFiles(context.Context, mcpcontract.ReadSourceFilesInput) (mcpcontract.ReadSourceFilesOutput, error)
}
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
type GitHubOperator interface {
SearchGitHubRepositories(context.Context, mcpcontract.SearchGitHubRepositoriesInput) (mcpcontract.SearchGitHubRepositoriesOutput, error)
SyncRepositoryContext(context.Context, mcpcontract.SyncRepositoryContextInput) (mcpcontract.JobReference, error)
SyncThreads(context.Context, mcpcontract.SyncThreadsInput) (mcpcontract.JobReference, error)
HydrateThreads(context.Context, mcpcontract.HydrateThreadsInput) (mcpcontract.JobReference, error)
SyncPortfolio(context.Context, mcpcontract.SyncPortfolioInput) (mcpcontract.JobReference, error)
}
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 Operator ¶
type Operator interface {
BuildRepositoryDossier(context.Context, mcpcontract.BuildRepositoryDossierInput) (mcpcontract.JobReference, error)
StartInvestigation(context.Context, mcpcontract.StartInvestigationInput) (mcpcontract.InvestigationOutput, error)
RecordHypothesis(context.Context, mcpcontract.RecordHypothesisInput) (mcpcontract.HypothesisOutput, error)
CheckDuplicates(context.Context, mcpcontract.CheckDuplicatesInput) (mcpcontract.CheckOutput, error)
CheckCollisions(context.Context, mcpcontract.CheckCollisionsInput) (mcpcontract.CheckOutput, error)
PromoteOpportunity(context.Context, mcpcontract.PromoteOpportunityInput) (mcpcontract.OpportunityOutput, error)
DefineValidation(context.Context, mcpcontract.DefineValidationInput) (mcpcontract.ValidationOutput, error)
RunValidation(context.Context, mcpcontract.RunValidationInput) (mcpcontract.JobReference, error)
PrepareContribution(context.Context, mcpcontract.PrepareContributionInput) (mcpcontract.DraftOutput, error)
Draft(context.Context, mcpcontract.DraftInput) (mcpcontract.DraftOutput, error)
ExportManifest(context.Context, mcpcontract.ExportManifestInput) (mcpcontract.ManifestOutput, error)
Manifest(context.Context, mcpcontract.ManifestInput) (mcpcontract.ManifestOutput, error)
CancelJobs(context.Context, mcpcontract.CancelJobInput) (mcpcontract.GetJobsOutput, error)
}
Operator is the optional explicit network-read/local-write 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
type PortfolioReader interface {
ListPullRequestPortfolio(context.Context, mcpcontract.ListPullRequestPortfolioInput) (mcpcontract.ListPullRequestPortfolioOutput, error)
FindPortfolioOverlaps(context.Context, mcpcontract.FindPortfolioOverlapsInput) (mcpcontract.FindPortfolioOverlapsOutput, error)
}
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
type ScalableReader interface {
GetRepositories(context.Context, mcpcontract.GetRepositoriesInput) (mcpcontract.GetRepositoriesOutput, error)
GetThreads(context.Context, mcpcontract.GetThreadsInput) (mcpcontract.GetThreadsOutput, error)
RankOpportunities(context.Context, mcpcontract.RankOpportunitiesInput) (mcpcontract.RankOpportunitiesOutput, error)
FindPrecedents(context.Context, mcpcontract.FindPrecedentsInput) (mcpcontract.FindPrecedentsOutput, error)
GetJobs(context.Context, mcpcontract.GetJobsInput) (mcpcontract.GetJobsOutput, error)
}
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.
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.