importservice

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: 8 Imported by: 0

Documentation

Overview

Package importservice implements MCP tools for GitLab import operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBitbucketCloudImport

func FormatBitbucketCloudImport(out *BitbucketCloudImportOutput) string

FormatBitbucketCloudImport formats a Bitbucket Cloud import result as markdown.

func FormatBitbucketServerImport

func FormatBitbucketServerImport(out *BitbucketServerImportOutput) string

FormatBitbucketServerImport formats a Bitbucket Server import result as markdown.

func FormatCancelledImport

func FormatCancelledImport(out *CancelledImportOutput) string

FormatCancelledImport formats a canceled import result as markdown.

func FormatGitHubImport

func FormatGitHubImport(out *GitHubImportOutput) string

FormatGitHubImport formats a GitHub import result as markdown.

func FormatImportGists

func FormatImportGists() string

FormatImportGists formats the gist import result as markdown.

func ImportGists

func ImportGists(ctx context.Context, client *gitlabclient.Client, input ImportGistsInput) error

ImportGists imports GitHub gists into GitLab snippets.

func RegisterMeta

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

RegisterMeta registers the gitlab_import meta-tool.

func RegisterTools

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

RegisterTools registers all import tools on the MCP server.

Types

type BitbucketCloudImportOutput

type BitbucketCloudImportOutput struct {
	ID                    int64  `json:"id"`
	Name                  string `json:"name"`
	FullPath              string `json:"full_path"`
	FullName              string `json:"full_name"`
	ImportSource          string `json:"import_source"`
	ImportStatus          string `json:"import_status"`
	HumanImportStatusName string `json:"human_import_status_name,omitempty"`
	ProviderLink          string `json:"provider_link,omitempty"`
}

BitbucketCloudImportOutput represents the output of a Bitbucket Cloud import.

func ImportFromBitbucketCloud

func ImportFromBitbucketCloud(ctx context.Context, client *gitlabclient.Client, input ImportFromBitbucketCloudInput) (*BitbucketCloudImportOutput, error)

ImportFromBitbucketCloud imports a repository from Bitbucket Cloud into GitLab.

type BitbucketServerImportOutput

type BitbucketServerImportOutput struct {
	ID       int64  `json:"id"`
	Name     string `json:"name"`
	FullPath string `json:"full_path"`
	FullName string `json:"full_name"`
}

BitbucketServerImportOutput represents the output of a Bitbucket Server import.

func ImportFromBitbucketServer

func ImportFromBitbucketServer(ctx context.Context, client *gitlabclient.Client, input ImportFromBitbucketServerInput) (*BitbucketServerImportOutput, error)

ImportFromBitbucketServer imports a repository from Bitbucket Server into GitLab.

type CancelGitHubImportInput

type CancelGitHubImportInput struct {
	ProjectID int64 `json:"project_id" jsonschema:"The GitLab project ID of the import to cancel,required"`
}

CancelGitHubImportInput represents input for canceling a GitHub import.

type CancelledImportOutput

type CancelledImportOutput struct {
	ID                    int64  `json:"id"`
	Name                  string `json:"name"`
	FullPath              string `json:"full_path"`
	FullName              string `json:"full_name"`
	ImportSource          string `json:"import_source"`
	ImportStatus          string `json:"import_status"`
	HumanImportStatusName string `json:"human_import_status_name,omitempty"`
	ProviderLink          string `json:"provider_link,omitempty"`
}

CancelledImportOutput represents the output of a canceled GitHub import.

func CancelGitHubImport

func CancelGitHubImport(ctx context.Context, client *gitlabclient.Client, input CancelGitHubImportInput) (*CancelledImportOutput, error)

CancelGitHubImport cancels an ongoing GitHub import.

type GitHubImportOutput

type GitHubImportOutput struct {
	ID                    int64  `json:"id"`
	Name                  string `json:"name"`
	FullPath              string `json:"full_path"`
	FullName              string `json:"full_name"`
	ImportSource          string `json:"import_source"`
	ImportStatus          string `json:"import_status"`
	HumanImportStatusName string `json:"human_import_status_name,omitempty"`
	ProviderLink          string `json:"provider_link,omitempty"`
	RelationType          string `json:"relation_type,omitempty"`
}

GitHubImportOutput represents the output of a GitHub import operation.

func ImportFromGitHub

func ImportFromGitHub(ctx context.Context, client *gitlabclient.Client, input ImportFromGitHubInput) (*GitHubImportOutput, error)

ImportFromGitHub imports a repository from GitHub into GitLab.

type ImportFromBitbucketCloudInput

type ImportFromBitbucketCloudInput struct {
	BitbucketUsername    string `json:"bitbucket_username" jsonschema:"Bitbucket Cloud username,required"`
	BitbucketAppPassword string `json:"bitbucket_app_password" jsonschema:"Bitbucket Cloud app password,required"`
	RepoPath             string `json:"repo_path" jsonschema:"Bitbucket repository path (e.g. owner/repo),required"`
	TargetNamespace      string `json:"target_namespace" jsonschema:"Target namespace for the imported project,required"`
	NewName              string `json:"new_name,omitempty" jsonschema:"New name for the imported project"`
}

ImportFromBitbucketCloudInput represents input for importing from Bitbucket Cloud.

type ImportFromBitbucketServerInput

type ImportFromBitbucketServerInput struct {
	BitbucketServerURL      string `json:"bitbucket_server_url" jsonschema:"Bitbucket Server URL,required"`
	BitbucketServerUsername string `json:"bitbucket_server_username" jsonschema:"Bitbucket Server username,required"`
	PersonalAccessToken     string `json:"personal_access_token" jsonschema:"Bitbucket Server personal access token,required"`
	BitbucketServerProject  string `json:"bitbucket_server_project" jsonschema:"Bitbucket Server project key,required"`
	BitbucketServerRepo     string `json:"bitbucket_server_repo" jsonschema:"Bitbucket Server repository slug,required"`
	NewName                 string `json:"new_name,omitempty" jsonschema:"New name for the imported project"`
	NewNamespace            string `json:"new_namespace,omitempty" jsonschema:"Target namespace for the imported project"`
	TimeoutStrategy         string `json:"timeout_strategy,omitempty" jsonschema:"Timeout strategy (optimistic or pessimistic)"`
}

ImportFromBitbucketServerInput represents input for importing from Bitbucket Server.

type ImportFromGitHubInput

type ImportFromGitHubInput struct {
	PersonalAccessToken string `json:"personal_access_token" jsonschema:"GitHub personal access token,required"`
	RepoID              int64  `json:"repo_id" jsonschema:"GitHub repository ID,required"`
	NewName             string `json:"new_name,omitempty" jsonschema:"New name for the imported project"`
	TargetNamespace     string `json:"target_namespace" jsonschema:"Target namespace for the imported project,required"`
	GitHubHostname      string `json:"github_hostname,omitempty" jsonschema:"GitHub hostname for GitHub Enterprise"`
	TimeoutStrategy     string `json:"timeout_strategy,omitempty" jsonschema:"Timeout strategy (optimistic or pessimistic)"`
}

ImportFromGitHubInput represents input for importing a repository from GitHub.

type ImportGistsInput

type ImportGistsInput struct {
	PersonalAccessToken string `json:"personal_access_token" jsonschema:"GitHub personal access token,required"`
}

ImportGistsInput represents input for importing GitHub gists as GitLab snippets.

Jump to

Keyboard shortcuts

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