mcp

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcp serves koment annotations to agents over stdio or HTTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSnapshotServer added in v0.3.0

func NewSnapshotServer(catalog *serving.Catalog, recorder metrics.Recorder, access RepositoryAccess) *sdk.Server

func NewWritableSnapshotServer added in v0.3.0

func NewWritableSnapshotServer(
	catalog *serving.Catalog, recorder metrics.Recorder, access RepositoryAccess,
	author store.Author, materializer serving.Materializer,
) *sdk.Server

func Serve

func Serve(args []string, stderr io.Writer) error

Serve parses the mcp subcommand's own flags, so that package cli never links the MCP SDK.

Types

type AcknowledgeCommentInput added in v0.3.0

type AcknowledgeCommentInput struct {
	Repository   string `json:"repository,omitempty" jsonschema:"repository id; required when several repositories are served"`
	File         string `json:"file" jsonschema:"source path relative to the repository root"`
	Comment      string `json:"comment" jsonschema:"complete verbatim Go comment group to retain"`
	Body         string `json:"body" jsonschema:"why the normal koment procedure is insufficient"`
	Acknowledged bool   `json:"acknowledge_inline_comment" jsonschema:"must be true to waive the normal koment procedure"`
}

type AddInput added in v0.3.0

type AddInput struct {
	Repository string `json:"repository,omitempty" jsonschema:"repository id; required when several repositories are served"`
	File       string `json:"file" jsonschema:"source path relative to the repository root"`
	Excerpt    string `json:"excerpt,omitempty" jsonschema:"verbatim code excerpt; omit for a file-scoped annotation"`
	Kind       string `json:"kind" jsonschema:"one of why, gotcha, invariant, anti-pattern"`
	Body       string `json:"body" jsonschema:"the rationale to record"`
}

type Annotation

type Annotation struct {
	Repository  string            `json:"repository"`
	Commit      string            `json:"commit,omitempty"`
	File        string            `json:"file"`
	ID          string            `json:"id"`
	Kind        string            `json:"kind"`
	Body        string            `json:"body"`
	Scope       string            `json:"scope"`
	Excerpt     string            `json:"excerpt,omitempty"`
	Line        int               `json:"line,omitempty"`
	Occurrences int               `json:"occurrences"`
	Created     string            `json:"created"`
	Status      string            `json:"status"`
	Warning     string            `json:"warning,omitempty"`
	Author      AnnotationAuthor  `json:"author"`
	Git         *AnnotationGit    `json:"git,omitempty"`
	Policy      *AnnotationPolicy `json:"policy,omitempty"`
}

type AnnotationAuthor added in v0.3.0

type AnnotationAuthor struct {
	Name     string `json:"name"`
	Email    string `json:"email,omitempty"`
	Kind     string `json:"kind"`
	Source   string `json:"source"`
	Account  string `json:"account,omitempty"`
	Verified string `json:"verified,omitempty"`
}

type AnnotationGit added in v0.3.0

type AnnotationGit struct {
	Commit  string `json:"commit"`
	Path    string `json:"path"`
	Line    int    `json:"line,omitempty"`
	EndLine int    `json:"end_line,omitempty"`
}

type AnnotationPolicy added in v0.3.0

type AnnotationPolicy struct {
	Exception    string `json:"exception"`
	Acknowledged bool   `json:"acknowledged"`
}

type ConvertCommentInput added in v0.3.0

type ConvertCommentInput struct {
	Repository string `json:"repository,omitempty" jsonschema:"repository id; required when several repositories are served"`
	File       string `json:"file" jsonschema:"source path relative to the repository root"`
	Comment    string `json:"comment" jsonschema:"complete verbatim Go comment group"`
	Kind       string `json:"kind,omitempty" jsonschema:"annotation kind; defaults to why"`
}

type GetInput

type GetInput struct {
	File       string `json:"file" jsonschema:"path of the source file, relative to the repository root"`
	Repository string `json:"repository,omitempty" jsonschema:"which repository; needed only when several serve this path"`
}

type GetOutput

type GetOutput struct {
	Repository  string       `json:"repository"`
	Commit      string       `json:"commit,omitempty"`
	File        string       `json:"file"`
	Annotations []Annotation `json:"annotations"`
}

type MutationAnchor added in v0.3.0

type MutationAnchor struct {
	Scope        string `json:"scope"`
	Excerpt      string `json:"excerpt,omitempty"`
	Before       string `json:"before,omitempty"`
	After        string `json:"after,omitempty"`
	LastSeenLine int    `json:"last_seen_line,omitempty"`
}

type MutationOutput added in v0.3.0

type MutationOutput struct {
	Repository string          `json:"repository"`
	Path       string          `json:"path"`
	Record     MutationRecord  `json:"record"`
	Warnings   []string        `json:"warnings,omitempty"`
	Review     *MutationReview `json:"review,omitempty"`
}

type MutationRecord added in v0.3.0

type MutationRecord struct {
	Version int               `json:"version"`
	ID      string            `json:"id"`
	File    string            `json:"file"`
	Kind    string            `json:"kind"`
	Body    string            `json:"body"`
	Created string            `json:"created"`
	Anchor  MutationAnchor    `json:"anchor"`
	Git     *AnnotationGit    `json:"git,omitempty"`
	Author  AnnotationAuthor  `json:"author"`
	Policy  *AnnotationPolicy `json:"policy,omitempty"`
}

type MutationReview added in v0.3.0

type MutationReview struct {
	BaseCommit  string `json:"base_commit"`
	Branch      string `json:"branch"`
	Commit      string `json:"commit"`
	PullRequest int    `json:"pull_request"`
	URL         string `json:"url"`
}

type ReanchorInput added in v0.3.0

type ReanchorInput struct {
	Repository string `json:"repository,omitempty" jsonschema:"repository id; required when several repositories are served"`
	ID         string `json:"id" jsonschema:"stable annotation id"`
	File       string `json:"file,omitempty" jsonschema:"new repository-relative source path"`
	Excerpt    string `json:"excerpt,omitempty" jsonschema:"new verbatim code excerpt"`
}

type RepositoriesInput added in v0.2.0

type RepositoriesInput struct{}

type RepositoriesOutput added in v0.2.0

type RepositoriesOutput struct {
	Repositories []RepositorySummary `json:"repositories"`
}

type RepositoryAccess added in v0.3.0

type RepositoryAccess map[string]bool

type RepositorySummary added in v0.2.0

type RepositorySummary struct {
	ID            string         `json:"id"`
	Name          string         `json:"name"`
	DefaultBranch string         `json:"default_branch,omitempty"`
	CloneURL      string         `json:"clone_url,omitempty"`
	Commit        string         `json:"commit,omitempty"`
	Files         int            `json:"files"`
	Annotations   map[string]int `json:"annotations"`
}

type SearchInput

type SearchInput struct {
	Query      string `json:"query" jsonschema:"text to look for in annotation bodies, matched case-insensitively"`
	Repository string `json:"repository,omitempty" jsonschema:"limit to one repository; omit to search all of them"`
}

type SearchOutput

type SearchOutput struct {
	Query   string       `json:"query"`
	Matches []Annotation `json:"matches"`
}

Jump to

Keyboard shortcuts

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