Documentation
¶
Overview ¶
Package deploytokens implements GitLab Deploy Tokens API operations as MCP tools. It supports listing, getting, creating, and deleting deploy tokens at project, group, and instance levels.
markdown.go provides Markdown formatting functions for deploy token MCP tool output.
register.go wires deploytokens MCP tools to the MCP server.
Index ¶
- func DeleteGroup(ctx context.Context, client *gitlabclient.Client, input DeleteGroupInput) error
- func DeleteProject(ctx context.Context, client *gitlabclient.Client, input DeleteProjectInput) error
- func FormatListMarkdown(o ListOutput) string
- func FormatOutputMarkdown(o Output) string
- func RegisterMeta(server *mcp.Server, client *gitlabclient.Client)
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- type CreateGroupInput
- type CreateProjectInput
- type DeleteGroupInput
- type DeleteProjectInput
- type GetGroupInput
- type GetProjectInput
- type ListAllInput
- type ListGroupInput
- type ListOutput
- func ListAll(ctx context.Context, client *gitlabclient.Client, _ ListAllInput) (ListOutput, error)
- func ListGroup(ctx context.Context, client *gitlabclient.Client, input ListGroupInput) (ListOutput, error)
- func ListProject(ctx context.Context, client *gitlabclient.Client, input ListProjectInput) (ListOutput, error)
- type ListProjectInput
- type Output
- func CreateGroup(ctx context.Context, client *gitlabclient.Client, input CreateGroupInput) (Output, error)
- func CreateProject(ctx context.Context, client *gitlabclient.Client, input CreateProjectInput) (Output, error)
- func GetGroup(ctx context.Context, client *gitlabclient.Client, input GetGroupInput) (Output, error)
- func GetProject(ctx context.Context, client *gitlabclient.Client, input GetProjectInput) (Output, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteGroup ¶
func DeleteGroup(ctx context.Context, client *gitlabclient.Client, input DeleteGroupInput) error
DeleteGroup deletes a group deploy token.
func DeleteProject ¶
func DeleteProject(ctx context.Context, client *gitlabclient.Client, input DeleteProjectInput) error
DeleteProject deletes a project deploy token.
func FormatListMarkdown ¶
func FormatListMarkdown(o ListOutput) string
FormatListMarkdown formats a list of deploy tokens.
func FormatOutputMarkdown ¶
FormatOutputMarkdown formats a single deploy token.
func RegisterMeta ¶
func RegisterMeta(server *mcp.Server, client *gitlabclient.Client)
RegisterMeta registers the gitlab_deploy_token meta-tool.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers all deploy token MCP tools.
Types ¶
type CreateGroupInput ¶
type CreateGroupInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Name string `json:"name" jsonschema:"Deploy token name,required"`
ExpiresAt string `json:"expires_at,omitempty" jsonschema:"Expiry date (YYYY-MM-DD)"`
Username string `json:"username,omitempty" jsonschema:"Username for the deploy token"`
Scopes []string `` /* 138-byte string literal not displayed */
}
CreateGroupInput represents parameters for creating a group deploy token.
type CreateProjectInput ¶
type CreateProjectInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Name string `json:"name" jsonschema:"Deploy token name,required"`
ExpiresAt string `json:"expires_at,omitempty" jsonschema:"Expiry date (YYYY-MM-DD)"`
Username string `json:"username,omitempty" jsonschema:"Username for the deploy token"`
Scopes []string `` /* 138-byte string literal not displayed */
}
CreateProjectInput represents parameters for creating a project deploy token.
type DeleteGroupInput ¶
type DeleteGroupInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
DeployTokenID int64 `json:"deploy_token_id" jsonschema:"Deploy token ID,required"`
}
DeleteGroupInput represents parameters for deleting a group deploy token.
type DeleteProjectInput ¶
type DeleteProjectInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
DeployTokenID int64 `json:"deploy_token_id" jsonschema:"Deploy token ID,required"`
}
DeleteProjectInput represents parameters for deleting a project deploy token.
type GetGroupInput ¶
type GetGroupInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
DeployTokenID int64 `json:"deploy_token_id" jsonschema:"Deploy token ID,required"`
}
GetGroupInput represents parameters for getting a group deploy token.
type GetProjectInput ¶
type GetProjectInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
DeployTokenID int64 `json:"deploy_token_id" jsonschema:"Deploy token ID,required"`
}
GetProjectInput represents parameters for getting a project deploy token.
type ListAllInput ¶
type ListAllInput struct{}
ListAllInput represents parameters for listing all instance deploy tokens.
type ListGroupInput ¶
type ListGroupInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Page int `json:"page,omitempty" jsonschema:"Page number for pagination"`
PerPage int `json:"per_page,omitempty" jsonschema:"Results per page (max 100)"`
}
ListGroupInput represents parameters for listing group deploy tokens.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
DeployTokens []Output `json:"deploy_tokens"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput holds a paginated list of deploy tokens.
func ListAll ¶
func ListAll(ctx context.Context, client *gitlabclient.Client, _ ListAllInput) (ListOutput, error)
ListAll lists all instance-level deploy tokens.
func ListGroup ¶
func ListGroup(ctx context.Context, client *gitlabclient.Client, input ListGroupInput) (ListOutput, error)
ListGroup lists deploy tokens for a group.
func ListProject ¶
func ListProject(ctx context.Context, client *gitlabclient.Client, input ListProjectInput) (ListOutput, error)
ListProject lists deploy tokens for a project.
type ListProjectInput ¶
type ListProjectInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Page int `json:"page,omitempty" jsonschema:"Page number for pagination"`
PerPage int `json:"per_page,omitempty" jsonschema:"Results per page (max 100)"`
}
ListProjectInput represents parameters for listing project deploy tokens.
type Output ¶
type Output struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Name string `json:"name"`
Username string `json:"username"`
ExpiresAt string `json:"expires_at,omitempty"`
Revoked bool `json:"revoked"`
Expired bool `json:"expired"`
Token string `json:"token,omitempty"`
Scopes []string `json:"scopes"`
}
Output represents a GitLab deploy token.
func CreateGroup ¶
func CreateGroup(ctx context.Context, client *gitlabclient.Client, input CreateGroupInput) (Output, error)
CreateGroup creates a deploy token for a group.
func CreateProject ¶
func CreateProject(ctx context.Context, client *gitlabclient.Client, input CreateProjectInput) (Output, error)
CreateProject creates a deploy token for a project.
func GetGroup ¶
func GetGroup(ctx context.Context, client *gitlabclient.Client, input GetGroupInput) (Output, error)
GetGroup retrieves a specific group deploy token.
func GetProject ¶
func GetProject(ctx context.Context, client *gitlabclient.Client, input GetProjectInput) (Output, error)
GetProject retrieves a specific project deploy token.