mcp

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: AGPL-3.0 Imports: 18 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	Check(ctx context.Context, objType, objID, relation, subjType, subjID string) (bool, error)
}

Checker is the authorization capability the server needs to pick between the regular and admin tool surfaces. *authz.Engine satisfies it.

type CreateAPIKeyInput

type CreateAPIKeyInput struct {
	TenantID      string  `json:"tenant_id" jsonschema:"Tenant UUID to create key for"`
	Label         string  `json:"label" jsonschema:"Key label (required, max 200 chars)"`
	SubjectID     *string `` /* 139-byte string literal not displayed */
	ExpiresInDays *int    `json:"expires_in_days,omitempty" jsonschema:"Optional TTL in days; omit for a key that never expires"`
}

type CreateTenantInput

type CreateTenantInput struct {
	Name       string `json:"name" jsonschema:"Tenant name (required, max 200 chars)"`
	OwnerEmail string `` /* 126-byte string literal not displayed */
	Type       string `json:"type,omitempty" jsonschema:"Display-only type: personal or shared (default shared)"`
}

type DeleteDocumentInput

type DeleteDocumentInput struct {
	Category    string  `json:"category" jsonschema:"Document category"`
	Subcategory *string `json:"subcategory,omitempty" jsonschema:"Document subcategory"`
	Slug        string  `json:"slug" jsonschema:"Document slug"`
	TenantID    *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type DeleteSectionInput added in v1.1.1

type DeleteSectionInput struct {
	SectionID string  `json:"section_id" jsonschema:"the section UUID to delete"`
	TenantID  *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type DeleteTenantInput

type DeleteTenantInput struct {
	TenantID string `json:"tenant_id" jsonschema:"Tenant UUID to delete"`
}

type GenerateIndexInput

type GenerateIndexInput struct {
	Depth    string  `json:"depth,omitempty" jsonschema:"Index depth: summary (default), category, or full"`
	Category *string `json:"category,omitempty" jsonschema:"Filter to specific category"`
	TenantID *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type GetCleanupQueueInput

type GetCleanupQueueInput struct {
	Limit           int     `json:"limit,omitempty" jsonschema:"Max entries to return (default 50)"`
	IncludeResolved bool    `json:"include_resolved,omitempty" jsonschema:"Include already-resolved rows in the result (default false — only pending)"`
	TenantID        *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type GetDocTypePoliciesInput added in v1.2.0

type GetDocTypePoliciesInput struct{}

type GetDocumentByIDInput

type GetDocumentByIDInput struct {
	DocumentID string  `json:"document_id" jsonschema:"Document UUID"`
	ForceRead  bool    `` /* 223-byte string literal not displayed */
	Reason     string  `json:"reason,omitempty" jsonschema:"Required when force_read=true. Brief explanation of why the override is justified."`
	Expand     bool    `` /* 165-byte string literal not displayed */
	Scope      string  `` /* 324-byte string literal not displayed */
	TenantID   *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type GetDocumentHistoryInput added in v1.1.1

type GetDocumentHistoryInput struct {
	DocumentID string  `json:"document_id" jsonschema:"Document UUID"`
	TenantID   *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type GetDocumentInput

type GetDocumentInput struct {
	Category    string  `json:"category" jsonschema:"Document category"`
	Subcategory *string `json:"subcategory,omitempty" jsonschema:"Document subcategory"`
	Slug        string  `json:"slug" jsonschema:"Document slug"`
	ForceRead   bool    `` /* 223-byte string literal not displayed */
	Reason      string  `json:"reason,omitempty" jsonschema:"Required when force_read=true. Brief explanation of why the override is justified."`
	Expand      bool    `` /* 165-byte string literal not displayed */
	Scope       string  `` /* 324-byte string literal not displayed */
	TenantID    *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type GetRelatedInput

type GetRelatedInput struct {
	DocumentID string  `json:"document_id" jsonschema:"UUID of the target document"`
	Limit      int     `json:"limit,omitempty" jsonschema:"Max results (default 5)"`
	TenantID   *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type GrantDocumentAccessInput

type GrantDocumentAccessInput struct {
	DocumentID string `json:"document_id" jsonschema:"Document UUID to grant guest access on"`
	Email      string `json:"email" jsonschema:"User email to grant access to (must already have a tenant_users row)"`
	Relation   string `json:"relation" jsonschema:"Relation to grant: viewer or editor"`
}

type GrantTenantAccessInput

type GrantTenantAccessInput struct {
	TenantID string `json:"tenant_id" jsonschema:"Tenant UUID to grant access on"`
	Email    string `json:"email" jsonschema:"User email to grant access to (must already have a tenant_users row)"`
	Relation string `json:"relation" jsonschema:"Relation to grant: viewer, member, or manager"`
}

type GrantUserInput

type GrantUserInput struct {
	Email    string `json:"email" jsonschema:"User email to grant tenant access to"`
	TenantID string `json:"tenant_id" jsonschema:"Tenant UUID to grant access on"`
	Role     string `json:"role,omitempty" jsonschema:"Role: member (default) or admin"`
}

type LinkDocumentsInput added in v1.1.1

type LinkDocumentsInput struct {
	SourceDocumentID string  `json:"source_document_id" jsonschema:"UUID of the source document (the one making the statement)"`
	TargetDocumentID string  `json:"target_document_id" jsonschema:"UUID of the target document (the one pointed at; archived on supersedes)"`
	EdgeType         string  `json:"edge_type" jsonschema:"One of: supersedes, derived_from, relates_to, includes"`
	TenantID         *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type LintMemoryInput

type LintMemoryInput struct {
	Checks     []string                   `json:"checks,omitempty" jsonschema:"Filter to specific checks: stale, sparse, near_duplicate, empty_category"`
	Thresholds *repository.LintThresholds `json:"thresholds,omitempty" jsonschema:"Override default thresholds"`
	TenantID   *string                    `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type ListAPIKeysInput

type ListAPIKeysInput struct {
	TenantID string `json:"tenant_id" jsonschema:"Tenant UUID to list keys for"`
}

type ListDocumentEdgesInput added in v1.1.1

type ListDocumentEdgesInput struct {
	DocumentID string  `json:"document_id" jsonschema:"UUID of the document whose edges to list"`
	TenantID   *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type ListDocumentGrantsInput

type ListDocumentGrantsInput struct {
	DocumentID string `json:"document_id" jsonschema:"Document UUID to list guest grants for"`
}

type ListDocumentsInput

type ListDocumentsInput struct {
	Category          *string `json:"category,omitempty" jsonschema:"Filter by category"`
	Subcategory       *string `json:"subcategory,omitempty" jsonschema:"Filter by subcategory"`
	SlugPrefix        *string `` /* 199-byte string literal not displayed */
	SubcategoryPrefix *string `` /* 277-byte string literal not displayed */
	OrderBy           *string `json:"order_by,omitempty" jsonschema:"Sort field: slug (default), created_at, updated_at, or title."`
	Order             *string `json:"order,omitempty" jsonschema:"Sort direction: asc (default) or desc."`
	Limit             *int    `` /* 139-byte string literal not displayed */
	Offset            *int    `json:"offset,omitempty" jsonschema:"Rows to skip; requires limit."`
	TenantID          *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type ListTenantGrantsInput

type ListTenantGrantsInput struct {
	TenantID string `json:"tenant_id" jsonschema:"Tenant UUID to list direct grants for"`
}

type ListTenantsInput

type ListTenantsInput struct{}

type ListUsersInput

type ListUsersInput struct {
	TenantID string `json:"tenant_id" jsonschema:"Tenant UUID to list user mappings for"`
}

type MarkCleanupDoneInput

type MarkCleanupDoneInput struct {
	QueueID    string  `json:"queue_id" jsonschema:"Cleanup queue entry UUID"`
	Resolution string  `json:"resolution" jsonschema:"One of: merged, ignored, false_positive"`
	Note       string  `json:"note,omitempty" jsonschema:"Optional note recording why/how this was resolved"`
	MergedInto *string `json:"merged_into,omitempty" jsonschema:"Document UUID that won the merge. Required when resolution=merged."`
	TenantID   *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type MarkVerifiedInput

type MarkVerifiedInput struct {
	SectionID string  `json:"section_id" jsonschema:"Section UUID to mark as verified"`
	TenantID  *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type MergeDocumentsInput

type MergeDocumentsInput struct {
	WinnerID       string   `json:"winner_id" jsonschema:"Document UUID that survives the merge"`
	LoserID        string   `json:"loser_id" jsonschema:"Document UUID that gets deleted after sections are moved"`
	SectionsToKeep []string `` /* 127-byte string literal not displayed */
	TenantID       *string  `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type PutSectionInput added in v1.2.0

type PutSectionInput struct {
	Category    string  `json:"category" jsonschema:"Document category"`
	Subcategory *string `json:"subcategory,omitempty" jsonschema:"Optional subcategory"`
	Slug        string  `json:"slug" jsonschema:"Document slug"`
	Heading     string  `json:"heading" jsonschema:"Section heading (the ## title); matched to upsert by heading"`
	Content     string  `json:"content" jsonschema:"Section content (markdown body under the heading)"`
	TenantID    *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type ResumeInput added in v1.1.1

type ResumeInput struct {
	Project  *string `` /* 127-byte string literal not displayed */
	Depth    int     `` /* 148-byte string literal not displayed */
	TenantID *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type RevokeAPIKeyInput

type RevokeAPIKeyInput struct {
	KeyID string `json:"key_id" jsonschema:"API key UUID to revoke"`
}

type RevokeDocumentAccessInput

type RevokeDocumentAccessInput struct {
	DocumentID string `json:"document_id" jsonschema:"Document UUID to revoke guest access on"`
	Email      string `json:"email" jsonschema:"User email whose grant to revoke"`
	Relation   string `json:"relation" jsonschema:"Relation to revoke: viewer or editor"`
}

type RevokeTenantAccessInput

type RevokeTenantAccessInput struct {
	TenantID string `json:"tenant_id" jsonschema:"Tenant UUID to revoke access on"`
	Email    string `json:"email" jsonschema:"User email whose grant to revoke"`
	Relation string `json:"relation" jsonschema:"Relation to revoke: viewer, member, or manager"`
}

type RevokeUserInput

type RevokeUserInput struct {
	Email string `json:"email" jsonschema:"User email whose tenant access to revoke"`
}

type RotateAPIKeyInput

type RotateAPIKeyInput struct {
	KeyID      string `json:"key_id" jsonschema:"API key UUID to rotate; a replacement is issued and this one retired"`
	GraceHours *int   `` /* 140-byte string literal not displayed */
}

type SearchMemoryInput

type SearchMemoryInput struct {
	Query       string  `json:"query" jsonschema:"Search query"`
	Category    *string `json:"category,omitempty" jsonschema:"Filter by category: learnings, preferences, projects"`
	Subcategory *string `json:"subcategory,omitempty" jsonschema:"Filter by subcategory: go, infrastructure, hilo, etc."`
	DocType     *string `` /* 132-byte string literal not displayed */
	Limit       int     `json:"limit,omitempty" jsonschema:"Max results (default 10)"`
	ForceRead   bool    `` /* 223-byte string literal not displayed */
	Reason      string  `json:"reason,omitempty" jsonschema:"Required when force_read=true. Brief explanation of why the override is justified."`
	TenantID    *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
	Snippet     bool    `` /* 176-byte string literal not displayed */
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(memory *service.MemoryService, checker Checker) *Server

NewServer builds the regular + admin MCP tool surfaces. checker drives the per-request admin split (admin surface iff subject holds system:memory#admin); a nil checker fails closed to the regular surface.

func (*Server) CreateAPIKey

func (*Server) CreateTenant

func (*Server) DeleteDocument

func (*Server) DeleteSection added in v1.1.1

func (*Server) DeleteTenant

func (*Server) GenerateIndex

func (*Server) GetCleanupQueue

func (*Server) GetDocTypePolicies added in v1.2.0

func (*Server) GetDocument

func (*Server) GetDocumentByID

func (*Server) GetDocumentHistory added in v1.1.1

func (*Server) GetRelated

func (*Server) GrantDocumentAccess

func (s *Server) GrantDocumentAccess(ctx context.Context, _ *mcpsdk.CallToolRequest, input GrantDocumentAccessInput) (*mcpsdk.CallToolResult, any, error)

func (*Server) GrantTenantAccess

func (*Server) GrantUser

func (*Server) HTTPHandler

func (s *Server) HTTPHandler() http.Handler

func (*Server) LinkDocuments added in v1.1.1

func (*Server) LintMemory

func (*Server) ListAPIKeys

func (*Server) ListDocumentEdges added in v1.1.1

func (*Server) ListDocumentGrants

func (*Server) ListDocuments

func (*Server) ListTenantGrants

func (*Server) ListTenants

func (*Server) ListUsers

func (*Server) MarkCleanupDone

func (*Server) MarkVerified

func (*Server) MergeDocuments

func (*Server) PutSection added in v1.2.0

func (*Server) Resume added in v1.1.1

func (*Server) RevokeAPIKey

func (*Server) RevokeDocumentAccess

func (s *Server) RevokeDocumentAccess(ctx context.Context, _ *mcpsdk.CallToolRequest, input RevokeDocumentAccessInput) (*mcpsdk.CallToolResult, any, error)

func (*Server) RevokeTenantAccess

func (*Server) RevokeUser

func (*Server) RotateAPIKey

func (*Server) SearchMemory

func (*Server) SetDocTypePolicy added in v1.2.0

func (*Server) StoreMemory

func (*Server) UnlinkDocuments added in v1.1.1

func (*Server) UpdateMyTenantSettings

func (s *Server) UpdateMyTenantSettings(ctx context.Context, _ *mcpsdk.CallToolRequest, input UpdateMyTenantSettingsInput) (*mcpsdk.CallToolResult, any, error)

func (*Server) UpdateSection

func (*Server) UpdateTenant

func (*Server) UpdateUserRole

type SetDocTypePolicyInput added in v1.2.0

type SetDocTypePolicyInput struct {
	DocType             string          `` /* 147-byte string literal not displayed */
	VerificationAgeDays *int            `json:"verification_age_days,omitempty" jsonschema:"Soft nudge threshold in days; 0 = never nudge; null inherits reference"`
	ExpirationAgeDays   *int            `` /* 149-byte string literal not displayed */
	DuplicateGuard      *bool           `json:"duplicate_guard,omitempty" jsonschema:"Write-time near-duplicate check (requires write_mode=replace)"`
	CleanupScan         *bool           `json:"cleanup_scan,omitempty" jsonschema:"Include in the near-duplicate scanner"`
	LintStaleCheck      *bool           `json:"lint_stale_check,omitempty" jsonschema:"Report as stale in lint_memory"`
	Embed               *bool           `json:"embed,omitempty" jsonschema:"Generate embeddings on write"`
	DefaultSearch       *bool           `json:"default_search,omitempty" jsonschema:"Appear in unfiltered search (requires embed)"`
	Prunable            *bool           `json:"prunable,omitempty" jsonschema:"Retention may remove documents of this type"`
	WriteMode           *string         `json:"write_mode,omitempty" jsonschema:"replace | merge_sections | append_only"`
	SlugFormat          *string         `json:"slug_format,omitempty" jsonschema:"any | date | datetime | kebab"`
	Subcategory         *string         `json:"subcategory,omitempty" jsonschema:"optional | required | forbidden"`
	Rules               json.RawMessage `json:"rules,omitempty" jsonschema:"Structured/experimental rules as a JSON object (e.g. chain_previous)"`
}

type StoreMemoryInput

type StoreMemoryInput struct {
	Category    string  `json:"category" jsonschema:"Document category: learnings, preferences, projects"`
	Subcategory *string `json:"subcategory,omitempty" jsonschema:"Document subcategory: go, infrastructure, hilo, etc."`
	Slug        string  `json:"slug" jsonschema:"Document slug/filename without extension"`
	Content     string  `json:"content" jsonschema:"Markdown content. Split into sections by ## headings."`
	Force       bool    `` /* 243-byte string literal not displayed */
	Reason      string  `json:"reason,omitempty" jsonschema:"Required when force=true. Brief explanation of why this is not a duplicate."`
	Pin         *bool   `` /* 190-byte string literal not displayed */
	Scope       *string `` /* 290-byte string literal not displayed */
	TenantID    *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type UnlinkDocumentsInput added in v1.1.1

type UnlinkDocumentsInput struct {
	EdgeID   string  `json:"edge_id" jsonschema:"UUID of the edge to delete"`
	TenantID *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type UpdateMyTenantSettingsInput

type UpdateMyTenantSettingsInput struct {
	StalenessMode      *string  `json:"staleness_mode,omitempty" jsonschema:"Enforcement level: off | advisory | hard"`
	DuplicateGuard     *bool    `json:"duplicate_guard,omitempty" jsonschema:"When true, store_memory refuses near-duplicate content"`
	DuplicateThreshold *float64 `json:"duplicate_threshold,omitempty" jsonschema:"Near-duplicate cutoff override, 0<v<=1; omit to inherit the global default"`
	CleanupScanEnabled *bool    `json:"cleanup_scan_enabled,omitempty" jsonschema:"When true, this tenant is included in the nightly near-duplicate scan"`
	MetricsEnabled     *bool    `` /* 137-byte string literal not displayed */
}

type UpdateSectionInput

type UpdateSectionInput struct {
	SectionID string  `json:"section_id" jsonschema:"the section UUID to update"`
	Content   *string `` /* 160-byte string literal not displayed */
	Heading   *string `json:"heading,omitempty" jsonschema:"optional new heading for the section; empty string clears it"`
	TenantID  *string `json:"tenant_id,omitempty" jsonschema:"(Admin only) Target a specific tenant. Omit to use your own."`
}

type UpdateTenantInput

type UpdateTenantInput struct {
	TenantID           string   `json:"tenant_id" jsonschema:"Tenant UUID to update"`
	Name               *string  `json:"name,omitempty" jsonschema:"New tenant name (max 200 chars)"`
	Type               *string  `json:"type,omitempty" jsonschema:"Display-only type: personal or shared"`
	StalenessMode      *string  `json:"staleness_mode,omitempty" jsonschema:"Staleness enforcement: off, advisory, or hard"`
	DuplicateGuard     *bool    `json:"duplicate_guard,omitempty" jsonschema:"Refuse store_memory on near-duplicate content (default false)"`
	DuplicateThreshold *float64 `json:"duplicate_threshold,omitempty" jsonschema:"Near-duplicate cutoff override, 0<v<=1; omit to inherit the global default"`
	CleanupScanEnabled *bool    `json:"cleanup_scan_enabled,omitempty" jsonschema:"Include this tenant in the nightly near-duplicate scan (default false)"`
	SelfServicePolicy  *string  `` /* 151-byte string literal not displayed */
}

type UpdateUserRoleInput

type UpdateUserRoleInput struct {
	Email string `json:"email" jsonschema:"User email whose role to change"`
	Role  string `json:"role" jsonschema:"New role: member or admin"`
}

Jump to

Keyboard shortcuts

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