resources

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package resources registers MCP resources that expose read-only GitLab project data (metadata, branches, merge requests, pipelines) via stable URIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(server *mcp.Server, client *gitlabclient.Client)

Register registers all MCP resources (read-only data endpoints).

func RegisterWorkflowGuides

func RegisterWorkflowGuides(server *mcp.Server)

RegisterWorkflowGuides registers static text resources with workflow best-practice content. These guides help LLMs provide consistent advice on git workflows, merge requests, commits, code reviews, and pipeline troubleshooting.

func RegisterWorkspaceRoots

func RegisterWorkspaceRoots(server *mcp.Server, rootsMgr *roots.Manager)

RegisterWorkspaceRoots registers the "gitlab://workspace/roots" resource. It exposes the client workspace root URIs so LLMs can read .git/config and use gitlab_discover_project to discover the project.

Types

type BranchResourceOutput

type BranchResourceOutput struct {
	Name      string `json:"name"`
	Protected bool   `json:"protected"`
	Merged    bool   `json:"merged"`
	Default   bool   `json:"default"`
	WebURL    string `json:"web_url"`
}

BranchResourceOutput is the output for a repository branch.

type GroupResourceOutput

type GroupResourceOutput struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Path        string `json:"path"`
	FullPath    string `json:"full_path"`
	Description string `json:"description"`
	Visibility  string `json:"visibility"`
	WebURL      string `json:"web_url"`
}

GroupResourceOutput is the output for a GitLab group.

type IssueResourceOutput

type IssueResourceOutput struct {
	ID        int64    `json:"id"`
	IID       int64    `json:"iid"`
	Title     string   `json:"title"`
	State     string   `json:"state"`
	Labels    []string `json:"labels"`
	Assignees []string `json:"assignees"`
	Author    string   `json:"author"`
	WebURL    string   `json:"web_url"`
	CreatedAt string   `json:"created_at"`
}

IssueResourceOutput is the output for a project issue.

type JobResourceOutput

type JobResourceOutput struct {
	ID            int64   `json:"id"`
	Name          string  `json:"name"`
	Stage         string  `json:"stage"`
	Status        string  `json:"status"`
	Ref           string  `json:"ref"`
	Duration      float64 `json:"duration"`
	FailureReason string  `json:"failure_reason,omitempty"`
	WebURL        string  `json:"web_url"`
}

JobResourceOutput is the output for a pipeline job.

type LabelResourceOutput

type LabelResourceOutput struct {
	ID                     int64  `json:"id"`
	Name                   string `json:"name"`
	Color                  string `json:"color"`
	Description            string `json:"description"`
	OpenIssuesCount        int64  `json:"open_issues_count"`
	OpenMergeRequestsCount int64  `json:"open_merge_requests_count"`
}

LabelResourceOutput is the output for a project label.

type MRResourceOutput

type MRResourceOutput struct {
	ID           int64  `json:"id"`
	IID          int64  `json:"iid"`
	Title        string `json:"title"`
	State        string `json:"state"`
	SourceBranch string `json:"source_branch"`
	TargetBranch string `json:"target_branch"`
	Author       string `json:"author"`
	WebURL       string `json:"web_url"`
	MergeStatus  string `json:"merge_status"`
}

MRResourceOutput is the output for a merge request resource.

type MemberResourceOutput

type MemberResourceOutput struct {
	ID          int64  `json:"id"`
	Username    string `json:"username"`
	Name        string `json:"name"`
	State       string `json:"state"`
	AccessLevel int    `json:"access_level"`
	WebURL      string `json:"web_url"`
}

MemberResourceOutput is the output for a project member.

type MilestoneResourceOutput

type MilestoneResourceOutput struct {
	ID          int64  `json:"id"`
	IID         int64  `json:"iid"`
	Title       string `json:"title"`
	Description string `json:"description"`
	State       string `json:"state"`
	DueDate     string `json:"due_date,omitempty"`
	WebURL      string `json:"web_url"`
}

MilestoneResourceOutput is the output for a project milestone.

type PipelineResourceOutput

type PipelineResourceOutput struct {
	ID     int64  `json:"id"`
	IID    int64  `json:"iid"`
	Status string `json:"status"`
	Ref    string `json:"ref"`
	SHA    string `json:"sha"`
	WebURL string `json:"web_url"`
	Source string `json:"source"`
}

PipelineResourceOutput is the output for a pipeline.

type ProjectResourceOutput

type ProjectResourceOutput struct {
	ID                int64  `json:"id"`
	Name              string `json:"name"`
	PathWithNamespace string `json:"path_with_namespace"`
	Visibility        string `json:"visibility"`
	WebURL            string `json:"web_url"`
	Description       string `json:"description"`
	DefaultBranch     string `json:"default_branch"`
}

ProjectResourceOutput is the output for the project resource.

type ReleaseResourceOutput

type ReleaseResourceOutput struct {
	TagName     string `json:"tag_name"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Author      string `json:"author"`
	CreatedAt   string `json:"created_at"`
	ReleasedAt  string `json:"released_at,omitempty"`
}

ReleaseResourceOutput is the output for a project release.

type TagResourceOutput

type TagResourceOutput struct {
	Name      string `json:"name"`
	Message   string `json:"message,omitempty"`
	Target    string `json:"target"`
	Protected bool   `json:"protected"`
	CreatedAt string `json:"created_at,omitempty"`
}

TagResourceOutput is the output for a repository tag.

type UserResourceOutput

type UserResourceOutput struct {
	ID       int64  `json:"id"`
	Username string `json:"username"`
	Name     string `json:"name"`
	Email    string `json:"email"`
	State    string `json:"state"`
	WebURL   string `json:"web_url"`
	IsAdmin  bool   `json:"is_admin"`
}

UserResourceOutput is the output for the current user resource.

type WorkspaceRootOutput

type WorkspaceRootOutput struct {
	URI  string `json:"uri"`
	Name string `json:"name,omitempty"`
}

WorkspaceRootOutput describes a single workspace root provided by the MCP client.

type WorkspaceRootsOutput

type WorkspaceRootsOutput struct {
	Roots []WorkspaceRootOutput `json:"roots"`
	Hint  string                `json:"hint"`
}

WorkspaceRootsOutput holds the list of workspace roots and a hint for project discovery.

Jump to

Keyboard shortcuts

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