mcpserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package mcpserver provides an MCP (Model Context Protocol) server implementation for Confluence. It exposes tools for reading, creating, and updating Confluence pages using structured content blocks instead of raw XHTML, ensuring safe and valid output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentBlock

type ContentBlock struct {
	Type string `json:"type"`
	Text string `json:"text,omitempty"`
}

ContentBlock represents a content block in an MCP response.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the MCP server for Confluence.

func New

func New(client *confluence.Client) *Server

New creates a new MCP server with the given Confluence client.

func (*Server) HandleTool

func (s *Server) HandleTool(ctx context.Context, name string, input map[string]interface{}) (*ToolResult, error)

HandleTool dispatches a tool call to the appropriate handler.

func (*Server) Tools

func (s *Server) Tools() []Tool

Tools returns the list of available MCP tools.

type Tool

type Tool struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	InputSchema map[string]interface{} `json:"inputSchema"`
}

Tool represents an MCP tool definition.

type ToolHandler

type ToolHandler func(ctx context.Context, input map[string]interface{}) (interface{}, error)

ToolHandler is a function that handles a tool call.

type ToolResult

type ToolResult struct {
	Content []ContentBlock `json:"content"`
	IsError bool           `json:"isError,omitempty"`
}

ToolResult represents the result of a tool execution.

Jump to

Keyboard shortcuts

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