stackkitmcp

package
v0.39.9 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLocalServerURL = "http://localhost:8082"

DefaultLocalServerURL is the loopback-only default for a local stackkit-server when STACKKITS_SERVER_URL and --server-url are unset. Standard Mode binds MCP and the API to the developer machine; it is not a hosted production origin.

Variables

This section is empty.

Functions

func EnvBoolValue

func EnvBoolValue(value string) bool

EnvBoolValue parses common truthy environment values.

func FirstNonEmpty

func FirstNonEmpty(values ...string) string

FirstNonEmpty returns the first non-empty value after trimming whitespace.

func IsLoopbackListenAddr

func IsLoopbackListenAddr(addr string) bool

IsLoopbackListenAddr reports whether an HTTP listen address is loopback-only.

func JSONResult

func JSONResult(value any) *mcp.CallToolResult

func NewHTTPServer

func NewHTTPServer(addr string, handler http.Handler) *http.Server

NewHTTPServer creates a hardened Streamable HTTP server. WriteTimeout stays disabled because MCP Streamable HTTP may keep responses open.

func ParseModes

func ParseModes(raw string) map[string]bool

ParseModes parses a comma-separated MCP mode list.

func RequireMCPToken

func RequireMCPToken(token string, next http.Handler) http.Handler

RequireMCPToken requires a bearer or X-StackKit-MCP-Token value.

func ShellQuote

func ShellQuote(value string) string

func SiblingStackkitBinary

func SiblingStackkitBinary() (string, error)

SiblingStackkitBinary returns the packaged CLI beside stackkit-server or stackkit-mcp, through the shared exact-build local process binding.

func StringMapValue

func StringMapValue(values map[string]any, key string) string

func TextResult

func TextResult(text string) *mcp.CallToolResult

Types

type App

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

App owns the StackKits MCP registration shared by stackkit-mcp and stackkit-server.

func New

func New(opts Options) *App

New creates a configured StackKits MCP app.

func (*App) OpenMCP

func (a *App) OpenMCP() map[string]any

OpenMCP returns agent-native discovery metadata for the local MCP surface.

func (*App) OpenMCPJSON

func (a *App) OpenMCPJSON() []byte

OpenMCPJSON returns pretty JSON discovery metadata.

func (*App) ProtectedStreamableHTTPHandler

func (a *App) ProtectedStreamableHTTPHandler() http.Handler

ProtectedStreamableHTTPHandler wraps the MCP handler with token auth when configured.

func (*App) Server

func (a *App) Server() *mcp.Server

Server builds a Model Context Protocol server with the configured modes.

func (*App) StreamableHTTPHandler

func (a *App) StreamableHTTPHandler() http.Handler

StreamableHTTPHandler returns a Streamable HTTP MCP handler.

type Options

type Options struct {
	Modes      map[string]bool
	ServerURL  string
	APIKey     string
	Transport  string
	MCPToken   string
	AllowWrite bool
	BaseDir    string
	Binary     string
	Version    string
	GitCommit  string
}

Options configures the StackKits MCP server surface.

Jump to

Keyboard shortcuts

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