mcp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mcp provides the Model Context Protocol server implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentPRInput

type CommentPRInput struct {
	Owner    string `json:"owner" jsonschema:"description=Repository owner (user or org)"`
	Repo     string `json:"repo" jsonschema:"description=Repository name"`
	PRNumber int    `json:"pr_number" jsonschema:"description=Pull request number"`
	Body     string `json:"body" jsonschema:"description=Comment body (markdown)"`
}

CommentPRInput is the input for the comment_pr tool.

type CommentPROutput

type CommentPROutput struct {
	Message string `json:"message"`
	URL     string `json:"url"`
}

CommentPROutput is the output for the comment_pr tool.

type GetPRDiffInput

type GetPRDiffInput struct {
	Owner    string `json:"owner" jsonschema:"description=Repository owner (user or org)"`
	Repo     string `json:"repo" jsonschema:"description=Repository name"`
	PRNumber int    `json:"pr_number" jsonschema:"description=Pull request number"`
}

GetPRDiffInput is the input for the get_pr_diff tool.

type GetPRDiffOutput

type GetPRDiffOutput struct {
	Diff string `json:"diff"`
}

GetPRDiffOutput is the output for the get_pr_diff tool.

type GetPRInput

type GetPRInput struct {
	Owner    string `json:"owner" jsonschema:"description=Repository owner (user or org)"`
	Repo     string `json:"repo" jsonschema:"description=Repository name"`
	PRNumber int    `json:"pr_number" jsonschema:"description=Pull request number"`
}

GetPRInput is the input for the get_pr tool.

type GetPROutput

type GetPROutput struct {
	Number  int    `json:"number"`
	Title   string `json:"title"`
	Body    string `json:"body"`
	State   string `json:"state"`
	Author  string `json:"author"`
	Head    string `json:"head"`
	Base    string `json:"base"`
	Commits int    `json:"commits"`
	URL     string `json:"url"`
}

GetPROutput is the output for the get_pr tool.

type LineCommentInput

type LineCommentInput struct {
	Owner    string `json:"owner" jsonschema:"description=Repository owner (user or org)"`
	Repo     string `json:"repo" jsonschema:"description=Repository name"`
	PRNumber int    `json:"pr_number" jsonschema:"description=Pull request number"`
	CommitID string `json:"commit_id" jsonschema:"description=Commit SHA to comment on"`
	Path     string `json:"path" jsonschema:"description=File path relative to repo root"`
	Line     int    `json:"line" jsonschema:"description=Line number in the diff"`
	Body     string `json:"body" jsonschema:"description=Comment body (markdown)"`
}

LineCommentInput is the input for the line_comment tool.

type LineCommentOutput

type LineCommentOutput struct {
	Message string `json:"message"`
	URL     string `json:"url"`
}

LineCommentOutput is the output for the line_comment tool.

type ListPRsInput

type ListPRsInput struct {
	Owner string `json:"owner" jsonschema:"description=Repository owner (user or org)"`
	Repo  string `json:"repo" jsonschema:"description=Repository name"`
}

ListPRsInput is the input for the list_prs tool.

type ListPRsOutput

type ListPRsOutput struct {
	PullRequests []PRSummary `json:"pull_requests"`
}

ListPRsOutput is the output for the list_prs tool.

type PRSummary

type PRSummary struct {
	Number int    `json:"number"`
	Title  string `json:"title"`
	Author string `json:"author"`
	Head   string `json:"head"`
	URL    string `json:"url"`
}

PRSummary is a summary of a PR for the list_prs output.

type ReviewPRInput

type ReviewPRInput struct {
	Owner    string `json:"owner" jsonschema:"description=Repository owner (user or org)"`
	Repo     string `json:"repo" jsonschema:"description=Repository name"`
	PRNumber int    `json:"pr_number" jsonschema:"description=Pull request number"`
	Event    string `json:"event" jsonschema:"description=Review action,enum=APPROVE,enum=REQUEST_CHANGES,enum=COMMENT"`
	Body     string `json:"body" jsonschema:"description=Review body (markdown)"`
}

ReviewPRInput is the input for the review_pr tool.

type ReviewPROutput

type ReviewPROutput struct {
	Message string `json:"message"`
	URL     string `json:"url"`
}

ReviewPROutput is the output for the review_pr tool.

type Server

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

Server implements the MCP server for code review tools.

func NewServer

func NewServer(client *review.Client) *Server

NewServer creates a new MCP server with the given review client.

func (*Server) Run

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

Run starts the MCP server on stdin/stdout.

Jump to

Keyboard shortcuts

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