mcpserver

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package mcpserver exposes bcli project generation through MCP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandRequest

type CommandRequest struct {
	Command    string
	Args       []string
	WorkingDir string
}

CommandRequest describes an external command invocation.

type CommandResult

type CommandResult struct {
	Stdout   string
	Stderr   string
	ExitCode int
}

CommandResult describes an external command result.

type Config

type Config struct {
	BCLICommand string        `yaml:"bcli_command"`
	Timeout     time.Duration `yaml:"timeout"`
	LogLevel    zerolog.Level `yaml:"log_level"`
}

Config defines runtime settings for the bcli MCP server.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default MCP server config.

func (*Config) LoadYAML

func (c *Config) LoadYAML(path string) error

LoadYAML loads MCP server config values from a YAML file.

type ExecRunner

type ExecRunner struct{}

ExecRunner runs commands with os/exec.

func (ExecRunner) Run

Run executes an external command and captures stdout and stderr.

type Runner

type Runner interface {
	Run(ctx context.Context, request CommandRequest) (CommandResult, error)
}

Runner runs external commands for MCP tool handlers.

type Server

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

Server wraps the MCP server and bcli execution settings.

func New

func New(cfg Config, runner Runner) *Server

New constructs a bcli MCP server wrapper.

func (*Server) CreateGoCLIProject

func (s *Server) CreateGoCLIProject(
	ctx context.Context,
	input createProjectInput,
) (createProjectOutput, error)

CreateGoCLIProject runs bcli create and returns parsed JSON output.

func (*Server) MCP

func (s *Server) MCP() *mcp.Server

MCP constructs the MCP server with all bcli tools registered.

func (*Server) RunStdio

func (s *Server) RunStdio(ctx context.Context) error

RunStdio runs the MCP server over stdio.

Jump to

Keyboard shortcuts

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