Documentation
¶
Overview ¶
Package resources registers MCP resources that expose read-only GitLab project data (metadata, branches, merge requests, pipelines) via stable URIs.
Index ¶
- func Register(server *mcp.Server, client *gitlabclient.Client)
- func RegisterWorkflowGuides(server *mcp.Server)
- func RegisterWorkspaceRoots(server *mcp.Server, rootsMgr *roots.Manager)
- type BranchResourceOutput
- type GroupResourceOutput
- type IssueResourceOutput
- type JobResourceOutput
- type LabelResourceOutput
- type MRResourceOutput
- type MemberResourceOutput
- type MilestoneResourceOutput
- type PipelineResourceOutput
- type ProjectResourceOutput
- type ReleaseResourceOutput
- type TagResourceOutput
- type UserResourceOutput
- type WorkspaceRootOutput
- type WorkspaceRootsOutput
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 ¶
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 ¶
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 ¶
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.