{"modulePath":"github.com/ZenNotes/znserver","version":"v0.0.0-20261109175412-d55067ea6e35","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpserver\n\n## Constants\n\n```go\nconst AllowAllOrigins = \"*\"\n```\nAllowAllOrigins is the wildcard operators reach for first. Comparing it literally, as any other string, meant ZENNOTES\\_ALLOWED\\_ORIGINS=\"\\*\" locked everything out with no hint that it was unsupported. (#482)\n\n```go\nconst NullOrigin = \"null\"\n```\nNullOrigin is what a browser sends for an opaque origin — a sandboxed iframe, a data: document, or a page loaded over file:// in most engines.\n\n## Types\n\n```go\ntype Server struct {\n\tConfig  config.Config\n\tVault   *vault.Vault\n\tWatcher *watcher.Watcher\n\tStatic  fs.FS // embedded web bundle, may be nil in dev\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc New(v *vault.Vault, w *watcher.Watcher, static fs.FS, cfg config.Config) *Server\n```\n\n```go\nfunc (s *Server) EnableMCP(m config.MCPConfig) error\n```\nEnableMCP turns on the built-in MCP endpoint, for Router to route at /mcp. An error means the server should not start.\n\nMCP clients use their own tokens, which open /mcp and nothing else. The server's token and browser sessions do not open /mcp, so a leaked MCP token can never reach the REST API and a restricted agent never holds the unrestricted token. That only means something if the REST API needs a token at all, which is why one is required.\n\n```go\nfunc (s *Server) Router() http.Handler\n```\n\n","path":"github.com/ZenNotes/znserver/internal/httpserver","name":"httpserver","synopsis":"","isRedistributable":true}
