Documentation
¶
Overview ¶
Package server MCP endpoint implements the Model Context Protocol (MCP) Streamable HTTP transport so that AI assistants (Claude Desktop, Cursor, etc.) can search the Hister index directly.
Specification: https://modelcontextprotocol.io/specification/2024-11-05
Only the search tool is exposed. The handler lives at POST /mcp and uses the same authentication as the rest of the API. Bearer tokens are accepted via the standard Authorization header and are resolved by the global auth middleware (withTokenAuth / populateUserContext).
Index ¶
Constants ¶
Variables ¶
var Endpoints []*Endpoint
Endpoints contains all registered API endpoints.
var Version = "unknown"
Version is set by the main package before Listen() is called so that MCP and other server responses can expose the running binary version.
Functions ¶
Types ¶
type Endpoint ¶ added in v0.5.0
type Endpoint struct {
Name string
Path string
Method string
CSRFRequired bool
NoAuth bool
AdminOnly bool
Handler endpointHandler `json:"-"`
Description string
Args []*EndpointArg
// JSONSchema describes the fields of the JSON request body, if the endpoint
// consumes application/json instead of (or in addition to) form data.
JSONSchema []*JSONSchemaField
}
Endpoint represents an API endpoint definition.
type EndpointArg ¶ added in v0.5.0
type EndpointArg struct {
Name string `json:"name"`
Type string `json:"type"`
Required bool `json:"required"`
Description string `json:"description"`
}
EndpointArg represents a query-string or form parameter for an API endpoint.
type JSONSchemaField ¶ added in v0.14.0
type JSONSchemaField struct {
Name string `json:"name"`
Type string `json:"type"`
Required bool `json:"required"`
Description string `json:"description"`
Fields []*JSONSchemaField `json:"fields,omitempty"`
}
JSONSchemaField represents a single field in a JSON request body schema. Fields may be nested to describe object and array element types.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package errors provides shared error-handling helpers for the server.
|
Package errors provides shared error-handling helpers for the server. |
|
Package extractor provides HTML content extraction for documents.
|
Package extractor provides HTML content extraction for documents. |
|
extractors/_extractor_template
Package extractor_template is a starting point for implementing a new Hister extractor.
|
Package extractor_template is a starting point for implementing a new Hister extractor. |
|
extractors/github
Package github provides an extractor for GitHub repository pages.
|
Package github provides an extractor for GitHub repository pages. |
|
extractors/godoc
Package godoc provides an extractor for pkg.go.dev documentation pages.
|
Package godoc provides an extractor for pkg.go.dev documentation pages. |
|
extractors/jsonld
Package jsonld provides an extractor that parses application/ld+json script tags and writes normalized metadata to the document.
|
Package jsonld provides an extractor that parses application/ld+json script tags and writes normalized metadata to the document. |
|
extractors/lobsters
Package lobsters provides an extractor for lobste.rs story pages.
|
Package lobsters provides an extractor for lobste.rs story pages. |
|
extractors/stackoverflow
Package stackoverflow provides an extractor for stackoverflow.com questions.
|
Package stackoverflow provides an extractor for stackoverflow.com questions. |
|
extractors/wikipedia
Package wikipedia provides an extractor for Wikipedia article pages.
|
Package wikipedia provides an extractor for Wikipedia article pages. |
|
extractors/ytdlp
Package ytdlp provides an extractor for video pages using the yt-dlp tool.
|
Package ytdlp provides an extractor for video pages using the yt-dlp tool. |
|
urlutil
Package urlutil provides shared URL helpers for extractors.
|
Package urlutil provides shared URL helpers for extractors. |
|
Package oauth provides OAuth 2.0 authentication support for external providers.
|
Package oauth provides OAuth 2.0 authentication support for external providers. |
|
sqlitevec
Package sqlitevec bundles the sqlite-vec C extension and provides Auto() to register it with every new SQLite connection in the process.
|
Package sqlitevec bundles the sqlite-vec C extension and provides Auto() to register it with every new SQLite connection in the process. |