mcp

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conflict

func Conflict(detail string) *mcplib.CallToolResult

Conflict returns an MCP error for state conflicts.

func InternalError

func InternalError(detail string) *mcplib.CallToolResult

InternalError returns an MCP error for internal failures.

func NotFound

func NotFound(detail string) *mcplib.CallToolResult

NotFound returns an MCP error for missing resources.

func ParseSectionsParam

func ParseSectionsParam(args map[string]any) (map[string]string, error)

ParseSectionsParam extracts and validates the sections parameter from an MCP request. Exported for test access. Internal handlers call this directly.

func RegisterSectionAwareTools

func RegisterSectionAwareTools(s *Server, templateSvc *templates.Service)

RegisterSectionAwareTools registers the fixed MCP tools that support section-aware operations and template discovery. All tools are registered unconditionally regardless of workspace state, satisfying the constitutional mandate. If called more than once, subsequent calls only update the template service reference without re-registering tools to avoid duplicates.

func RunStdio

func RunStdio(s *Server) error

RunStdio starts the MCP server on stdio transport.

func ValidationFailed

func ValidationFailed(detail string) *mcplib.CallToolResult

ValidationFailed returns an MCP error for parameter validation failures.

func WorkspaceNotInitialized

func WorkspaceNotInitialized() *mcplib.CallToolResult

WorkspaceNotInitialized returns an MCP error for missing workspace.

Types

type AckHookEventsRequest

type AckHookEventsRequest struct {
	ConsumerID string `json:"consumer_id" validate:"required"`
	Seq        int64  `json:"seq"         validate:"required,gte=1"`
}

AckHookEventsRequest contains validated parameters for backlogit_ack_hook_events.

type AckHookEventsResponse

type AckHookEventsResponse struct {
	AckedSeq int64 `json:"acked_seq"`
}

AckHookEventsResponse is the JSON response for backlogit_ack_hook_events.

type PollHookEventsRequest

type PollHookEventsRequest struct {
	ConsumerID string `json:"consumer_id" validate:"required"`
}

PollHookEventsRequest contains validated parameters for backlogit_poll_hook_events.

type PollHookEventsResponse

type PollHookEventsResponse struct {
	Events         []events.HookEvent `json:"events"`
	DerivedSignals []events.HookEvent `json:"derived_signals"`
}

PollHookEventsResponse is the JSON response for backlogit_poll_hook_events.

type Server

type Server struct {
	RootPath   string
	Workspace  *core.Workspace
	Events     *events.EventWriter
	Telemetry  *events.TelemetryWriter
	HookEvents *events.HookEventWriter
	// contains filtered or unexported fields
}

Server holds dependencies for MCP tool handlers.

func NewServer

func NewServer(ws *core.Workspace) *Server

NewServer creates an MCP server from a workspace.

func NewServerForRoot

func NewServerForRoot(rootPath string) *Server

NewServerForRoot creates an MCP server bound to a repository root even when the workspace has not been initialized yet.

func (*Server) DescribeTools

func (s *Server) DescribeTools() []core.ToolInfo

DescribeTools returns the registered MCP tools with their descriptions.

func (*Server) ListTools

func (s *Server) ListTools() []string

ListTools returns the names of all registered MCP tools. Used by contract tests to verify the fixed tool surface.

func (*Server) MCPServer

func (s *Server) MCPServer() *mcpserver.MCPServer

MCPServer returns the underlying mcp-go server instance. Intended for use by test helpers that need direct MCP client access.

func (*Server) RegisterResources

func (s *Server) RegisterResources()

RegisterResources adds workspace metadata resources to the MCP server.

func (*Server) RegisterTools

func (s *Server) RegisterTools()

RegisterTools adds all backlogit tools to the MCP server.

func (*Server) ToolDefs added in v1.2.0

func (s *Server) ToolDefs() []mcplib.Tool

ToolDefs returns a copy of the registered tool definitions. The returned slice is safe to read and serialize without locking.

Jump to

Keyboard shortcuts

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