resources

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 12 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 BoardResourceOutput added in v1.3.2

type BoardResourceOutput struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

BoardResourceOutput is the output for a single project issue board.

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 CommitResourceOutput added in v1.3.2

type CommitResourceOutput struct {
	ID            string             `json:"id"`
	ShortID       string             `json:"short_id"`
	Title         string             `json:"title"`
	Message       string             `json:"message"`
	AuthorName    string             `json:"author_name"`
	AuthorEmail   string             `json:"author_email"`
	AuthoredDate  string             `json:"authored_date,omitempty"`
	CommittedDate string             `json:"committed_date,omitempty"`
	WebURL        string             `json:"web_url"`
	ParentIDs     []string           `json:"parent_ids,omitempty"`
	Stats         *CommitStatsOutput `json:"stats,omitempty"`
}

CommitResourceOutput is the output for a single commit resource.

type CommitStatsOutput added in v1.3.2

type CommitStatsOutput struct {
	Additions int64 `json:"additions"`
	Deletions int64 `json:"deletions"`
	Total     int64 `json:"total"`
}

CommitStatsOutput holds additions/deletions/total for a commit resource.

type DeployKeyResourceOutput added in v1.3.2

type DeployKeyResourceOutput struct {
	ID          int64  `json:"id"`
	Title       string `json:"title"`
	Key         string `json:"key"`
	Fingerprint string `json:"fingerprint,omitempty"`
}

DeployKeyResourceOutput is the output for a single project deploy key.

type DeploymentResourceOutput added in v1.3.2

type DeploymentResourceOutput struct {
	ID          int64  `json:"id"`
	IID         int64  `json:"iid"`
	Ref         string `json:"ref"`
	SHA         string `json:"sha"`
	Status      string `json:"status"`
	Environment string `json:"environment,omitempty"`
}

DeploymentResourceOutput is the output for a single project deployment.

type EnvironmentResourceOutput added in v1.3.2

type EnvironmentResourceOutput struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Slug  string `json:"slug"`
	State string `json:"state"`
	Tier  string `json:"tier,omitempty"`
}

EnvironmentResourceOutput is the output for a single project environment.

type FeatureFlagResourceOutput added in v1.3.2

type FeatureFlagResourceOutput struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Active      bool   `json:"active"`
	Version     string `json:"version"`
}

FeatureFlagResourceOutput is the output for a single project feature flag.

type FileBlobResourceOutput added in v1.3.2

type FileBlobResourceOutput struct {
	FileName        string `json:"file_name"`
	FilePath        string `json:"file_path"`
	Size            int64  `json:"size"`
	Encoding        string `json:"encoding,omitempty"`
	Ref             string `json:"ref"`
	BlobID          string `json:"blob_id"`
	CommitID        string `json:"commit_id"`
	LastCommitID    string `json:"last_commit_id"`
	Content         string `json:"content,omitempty"`
	ContentCategory string `json:"content_category"`
	Truncated       bool   `json:"truncated,omitempty"`
}

FileBlobResourceOutput is the output for a repository file blob resource. Binary content is omitted; only the textual representation is returned.

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 MRDiscussionNoteResourceOutput added in v1.3.2

type MRDiscussionNoteResourceOutput struct {
	ID         int64  `json:"id"`
	Author     string `json:"author"`
	Body       string `json:"body"`
	System     bool   `json:"system"`
	Resolved   bool   `json:"resolved"`
	Resolvable bool   `json:"resolvable"`
	CreatedAt  string `json:"created_at,omitempty"`
}

MRDiscussionNoteResourceOutput is the output for a note inside a discussion thread of the MR discussions resource.

type MRDiscussionResourceOutput added in v1.3.2

type MRDiscussionResourceOutput struct {
	ID             string                           `json:"id"`
	IndividualNote bool                             `json:"individual_note"`
	Notes          []MRDiscussionNoteResourceOutput `json:"notes"`
}

MRDiscussionResourceOutput is the output for a single discussion thread.

type MRNoteResourceOutput added in v1.3.2

type MRNoteResourceOutput struct {
	ID         int64  `json:"id"`
	Author     string `json:"author"`
	Body       string `json:"body"`
	System     bool   `json:"system"`
	Resolvable bool   `json:"resolvable,omitempty"`
	Resolved   bool   `json:"resolved,omitempty"`
	CreatedAt  string `json:"created_at,omitempty"`
	UpdatedAt  string `json:"updated_at,omitempty"`
}

MRNoteResourceOutput is the output for a single merge-request note inside the MR notes resource.

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 SnippetResourceOutput added in v1.3.2

type SnippetResourceOutput struct {
	ID          int64  `json:"id"`
	Title       string `json:"title"`
	FileName    string `json:"file_name"`
	Description string `json:"description"`
	Visibility  string `json:"visibility"`
	WebURL      string `json:"web_url"`
}

SnippetResourceOutput is the output for a personal or project snippet.

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 WikiResourceOutput added in v1.3.2

type WikiResourceOutput struct {
	Title    string `json:"title"`
	Slug     string `json:"slug"`
	Format   string `json:"format"`
	Content  string `json:"content,omitempty"`
	Encoding string `json:"encoding,omitempty"`
}

WikiResourceOutput is the output for a wiki page 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