mcp

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mcp implements a Model Context Protocol server that exposes the Hostim public REST API as tools, so a coding agent can list, inspect and — only when explicitly allowed — provision Hostim resources.

Read tools are always registered. Write tools are registered only when the caller opts in (hostim mcp --allow-write), so a server started without the flag physically cannot mutate anything.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Client is the authenticated Hostim API client. Required.
	Client *api.ClientWithResponses
	// AllowWrite registers the create/update/delete tools. Off by default.
	AllowWrite bool
	// Version is reported to the MCP client as the server version.
	Version string
}

Options configures the server.

type Server

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

Server is a Hostim MCP server.

func New

func New(o Options) *Server

New builds the server and registers its tools.

func (*Server) Run

func (s *Server) Run(ctx context.Context, t sdk.Transport) error

Run serves MCP on t until ctx is cancelled. It returns when the client disconnects, which for stdio means the parent process closed the pipe.

Jump to

Keyboard shortcuts

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