mcpserver

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 14 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 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 ContributionWorkflowResource

type ContributionWorkflowResource struct {
	SchemaVersion string                `json:"schema_version"`
	OpportunityID string                `json:"opportunity_id"`
	Resources     []WorkflowResourceRef `json:"resources"`
	Prompts       []WorkflowPromptRef   `json:"prompts"`
	Safety        []string              `json:"safety"`
	NextSteps     []string              `json:"next_steps"`
}

ContributionWorkflowResource links safe local resources and prompts for one opportunity.

type GetRepositoryDossierInput

type GetRepositoryDossierInput mcpcontract.RepoInput

GetRepositoryDossierInput selects a persisted repository dossier.

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 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"`
	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 NewWithOptions added in v0.10.0

func NewWithOptions(reader mcpcontract.Reader, version string, opts mcpcontract.Options) (*Server, error)

NewWithOptions constructs an MCP server with selected capability profiles.

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 WorkflowPromptRef

type WorkflowPromptRef struct {
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Arguments   map[string]string `json:"arguments,omitempty"`
}

WorkflowPromptRef describes an MCP prompt useful for a workflow.

type WorkflowResourceRef

type WorkflowResourceRef struct {
	URI         string `json:"uri"`
	Description string `json:"description"`
	Capability  string `json:"capability"`
}

WorkflowResourceRef describes a local MCP resource used by a workflow.

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