Documentation
¶
Overview ¶
Package webops is a mobile-first web executor for Model Context Protocol servers. See docs/webops-package.md for the threat model, architecture, and design notes.
Index ¶
Examples ¶
Constants ¶
const ( MDKeyFavorite = "webops.favorite" MDKeyLabel = "webops.label" MDKeyGroup = "webops.group" )
MDKey* are the tool.Meta keys cli-mcp stamps onto MCP Tool entries. See docs/webops-package.md and cli-mcp's "Extension-namespace annotations".
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
ListenAndServe is the package-level convenience: NewServer + Run.
Types ¶
type Auth ¶
type Auth interface {
// Middleware wraps the protected handler.
// Drivers may mount their own auth endpoints on inner before delegating.
Middleware(inner http.Handler) http.Handler
}
Auth is the authentication backend interface; implementations gate every HTTP request. See docs/auth.md for built-in drivers and planned WebAuthn/TOTP work (#2).
type DangerouslyAllowAllAuth ¶
type DangerouslyAllowAllAuth struct{}
DangerouslyAllowAllAuth lets every request through with no authentication. STUB for dev/tests only; NEVER deploy. See docs/auth.md.
func (DangerouslyAllowAllAuth) Middleware ¶
func (DangerouslyAllowAllAuth) Middleware(inner http.Handler) http.Handler
Middleware implements Auth.
type Field ¶
type Field struct {
Name string
Type string // "text" "number" "checkbox"
Required bool
Description string
Default string
Enum []string
}
Field is one rendered input on a tool's form.
type MCPTarget ¶
type MCPTarget struct {
// Command launches an MCP server as a subprocess and speaks stdio.
// Path-style: ["myapp", "--mcp-mode"] (first element is the binary).
Command []string
// Env is appended to the subprocess environment if Command is set.
Env []string
// HTTP is reserved for the planned HTTP/SSE transport. Setting it
// currently returns an error.
HTTP string
}
MCPTarget describes how the server connects to its upstream MCP server. Exactly one of Command or HTTP must be set.
type Options ¶
type Options struct {
// Addr is the TCP address to bind. Required.
Addr string
// Auth is the authentication backend. Required. Stub:
// DangerouslyAllowAllAuth{} (never deploy with that).
Auth Auth
// DangerouslySkipTailscale bypasses the Tailscale-interface bind gate.
// Listen addr must still be loopback. See docs/webops-package.md.
DangerouslySkipTailscale bool
// DangerouslyBindAnywhere also bypasses the loopback check.
// Test-only; never set in production. See docs/webops-package.md.
DangerouslyBindAnywhere bool
// ShowAllTools exposes every tool, not just webops.favorite ones, on
// the home screen.
ShowAllTools bool
// CommandTimeout caps how long a single tool call may take before the
// SSE stream is closed and the upstream call is cancelled.
CommandTimeout time.Duration
// TailscaleInterface overrides the interface name(s) considered
// Tailscale-managed.
TailscaleInterface []string
// MCPClientName / MCPClientVersion identify webops to the MCP server.
// Sensible defaults are used when empty.
MCPClientName string
MCPClientVersion string
}
Options configure the web server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the webops HTTP server.
func NewServer ¶
NewServer prepares a Server. Does not open the MCP connection (that happens in Run).
Example ¶
Build a webops.Server that talks to an MCP server subprocess over stdio. MCP is the trust boundary; see docs/webops-package.md.
package main
import (
"fmt"
"github.com/coilysiren/cli-web-ops/webops"
)
func main() {
srv, err := webops.NewServer(
webops.MCPTarget{
Command: []string{"cli-mcp-binary"},
},
webops.Options{
Addr: "127.0.0.1:8443",
Auth: webops.DangerouslyAllowAllAuth{}, // STUB - do not deploy
DangerouslySkipTailscale: true, // dev only
},
)
fmt.Println("ok:", srv != nil && err == nil)
}
Output: ok: true