httpserve

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httpserve serves the MCP tools over streamable HTTP, for remote clients. It is off unless --http is given.

Index

Constants

View Source
const MaxBody = 4 << 20

MaxBody caps one request. Tool inputs are ids, text and local paths, never file contents, so 4 MB is far more than a request needs.

View Source
const Path = "/mcp"

Path is where the MCP endpoint is served.

Variables

This section is empty.

Functions

func Check

func Check(addr, token string) error

Check refuses a bind that is not loopback unless a bearer token is set.

func Handler

func Handler(s *mcp.Server, token string) http.Handler

Handler serves s at Path, statelessly, with the body cap and, when token is set, a bearer token check.

func Serve

func Serve(ctx context.Context, addr string, s *mcp.Server, token string, log *slog.Logger) error

Serve runs the HTTP server until ctx ends.

Types

This section is empty.

Jump to

Keyboard shortcuts

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