server

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package server wires the tools onto the MCP SDK and dumps the tool surface.

Index

Constants

View Source
const Description = "GitLab over MCP from your own account: issues, merge requests, reviews, the repository and CI."

Description is the one-line description shared by the bundle manifest and the registry entry. At most 100 characters.

View Source
const Name = "gitlab-mcp"

Name is the MCP server name.

Variables

This section is empty.

Functions

func DumpSchemas

func DumpSchemas(w io.Writer, version string) error

DumpSchemas writes the full tool surface — every flag and toolset on — as JSON, without touching the network or credentials. The SDK has no public enumerator, so an in-memory client asks the server, which is also exactly what a client would be told. The other configurations' instructions are the text New serves them, read without a session.

func New

func New(opts Options) *mcp.Server

New builds the MCP server with every tool the configuration registers. A nil Client is allowed: every tool then answers [auth], which is what a client started before `gitlab-mcp login` should see.

Types

type Dump

type Dump struct {
	Server  string `json:"server"`
	Version string `json:"version"`
	SDK     string `json:"sdk"`
	// Instructions are the text the full surface is served, keyed "full",
	// and the text each of instructionConfigs is.
	Instructions      map[string]string       `json:"instructions"`
	Tools             []*mcp.Tool             `json:"tools"`
	ResourceTemplates []*mcp.ResourceTemplate `json:"resourceTemplates"`
	Resources         []*mcp.Resource         `json:"resources,omitempty"`
	Prompts           []*mcp.Prompt           `json:"prompts,omitempty"`
}

Dump is what --dump-schemas writes: the whole registrable surface, every mcp.Tool as the wire carries it, _meta and output schema included, and the instructions a client puts in front of the model. The schema gates compare two of these. The server has no resources or prompts today; while it has none the dump leaves them out, and one added later still reaches the gates.

type Options

type Options struct {
	Config  config.Config
	Client  *gapi.Client
	Granted []string // scopes the token was granted
	Logger  *slog.Logger
	Version string
}

Options is what the server needs from startup.

Jump to

Keyboard shortcuts

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