server

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 62 Imported by: ? 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 server MCP endpoint implements the Model Context Protocol (MCP) Streamable HTTP transport so that AI assistants (Claude Desktop, Cursor, etc.) can search the Nogon index directly.

Specification: https://modelcontextprotocol.io/specification/2025-06-18

Exposed tools: search, get_facets, get_preview, get_history. 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

View Source
const (
	// GET is HTTP GET request type
	GET string = "GET"
	// POST is HTTP POST request type
	POST string = "POST"
	// PUT is HTTP PUT request type
	PUT string = "PUT"
	// PATCH is HTTP PATCH request type
	PATCH string = "PATCH"
	// DELETE is HTTP DELETE request type
	DELETE string = "DELETE"
	// HEAD is HTTP HEAD request type
	HEAD string = "HEAD"
)

Variables

View Source
var Endpoints []*Endpoint

Endpoints contains all registered API endpoints.

View Source
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

func Listen

func Listen(ctx context.Context, cfg *config.Config, idx *indexer.Indexer, overrides ...config.Override) error

Listen owns idx and the database connection until the server stops. Reloads close and recreate runtime components after active requests have drained.

Types

type Endpoint

type Endpoint struct {
	Name         string
	Path         string
	Method       string
	CSRFRequired bool
	NoAuth       bool
	AdminOnly    bool
	Public       bool
	NoStore      bool
	Handler      endpointHandler `json:"-"`
	// BodyLimit overrides the default request body limit, using the active config.
	BodyLimit   func(*config.Config) int64 `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.

func (*Endpoint) Pattern

func (e *Endpoint) Pattern() string

type EndpointArg

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

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 Nogon extractor.
Package extractor_template is a starting point for implementing a new Nogon extractor.
extractors/bluesky
Package bluesky extracts individual posts from Bluesky pages.
Package bluesky extracts individual posts from Bluesky pages.
extractors/chatgpt
Package chatgpt extracts rendered ChatGPT conversations as single documents.
Package chatgpt extracts rendered ChatGPT conversations as single documents.
extractors/discourse
Package discourse extracts topics and posts from Discourse forums.
Package discourse extracts topics and posts from Discourse forums.
extractors/embeddedvideo
Package embeddedvideo extracts embedded video URLs from HTML documents.
Package embeddedvideo extracts embedded video URLs from HTML documents.
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/hackernews
Package hackernews provides an extractor for Hacker News item pages.
Package hackernews provides an extractor for Hacker News item 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/markdown
Package markdown provides an extractor for locally indexed Markdown files.
Package markdown provides an extractor for locally indexed Markdown files.
extractors/notion
Package notion provides an extractor for Notion pages on notion.so and notion.site domains.
Package notion provides an extractor for Notion pages on notion.so and notion.site domains.
extractors/reddit
Package reddit extracts posts and comments from Reddit post pages.
Package reddit extracts posts and comments from Reddit post pages.
extractors/stackexchange
Package stackexchange provides an extractor for Stack Exchange network
Package stackexchange provides an extractor for Stack Exchange network
extractors/twitter
Package twitter extracts individual tweets from Twitter and X pages.
Package twitter extracts individual tweets from Twitter and X pages.
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.
sdk
Package sdk defines the stable contracts used to implement Nogon extractors.
Package sdk defines the stable contracts used to implement Nogon extractors.
textutil
Package textutil provides shared helpers for flattening HTML to plain text while keeping the block structure of the original markup.
Package textutil provides shared helpers for flattening HTML to plain text while keeping the block structure of the original markup.
urlutil
Package urlutil provides shared URL helpers for extractors.
Package urlutil provides shared URL helpers for extractors.
searchschema
Package searchschema contains the authoritative search field, filter, facet, and sort definitions shared by the indexer, query builder, API, and user interfaces.
Package searchschema contains the authoritative search field, filter, facet, and sort definitions shared by the indexer, query builder, API, and user interfaces.
Package languages resolves document tags, detection candidates, and analyzer choices without importing the detector models or the search engine.
Package languages resolves document tags, detection candidates, and analyzer choices without importing the detector models or the search engine.
Package metrics provides Prometheus instrumentation for Nogon.
Package metrics provides Prometheus instrumentation for Nogon.
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.

Jump to

Keyboard shortcuts

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