Skip to content

Commit e00dda0

Browse files
committed
feat: add premium private-repo bootstrap template
1 parent ae7fbcd commit e00dda0

5 files changed

Lines changed: 163 additions & 0 deletions

File tree

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,60 @@ SQLite hits the sweet spot:
3636
- **Kanban board** -- Optional HTML report generator for visual task overview via GitHub Pages
3737
- **Cross-project sharing** -- Optional `project` field scopes entities; omit it to share across all projects
3838
- **Cross-machine sync** -- Bridge tools push/pull shared entities between machines via a private git repo
39+
- **Premium runtime boundary** -- The OSS core can gate-load a separate private premium repo via signed entitlement checks, explicit owner approval, audit logging, and local revocation
3940
- **Drop-in compatible core** -- All 9 tools from `@modelcontextprotocol/server-memory` work identically in `sqlite_memory`, with 41 more tools available from companion servers
4041
- **Zero required dependencies beyond stdlib** -- Only `fastmcp` is required for MCP protocol; `sqlite3` is Python stdlib. Optional `orjson`, `sqlite-vec`, and `sentence-transformers` add speed and semantic search
4142
- **Automatic FTS sync** -- Full-text index stays in sync with every write operation
4243
- **JSONL migration** -- Optionally import existing `memory.json` knowledge graphs on first run
4344

45+
## Premium / Enterprise Boundary
46+
47+
This repository now includes the **public-core boundary** for a separate premium runtime.
48+
49+
What is in this OSS repo:
50+
51+
- entitlement-aware premium loader (`premium_runtime.py`)
52+
- premium audit + revoke tables in the shared schema
53+
- public contract for a separate private premium repo (`premium_contract.py`)
54+
- premium entitlement schema (`docs/premium/entitlement.schema.json`)
55+
- a public-safe bootstrap template for the separate private repo (`templates/private_premium_repo/`)
56+
57+
What is **not** in this OSS repo:
58+
59+
- private premium business logic
60+
- private connectors and ingestion code
61+
- customer entitlements
62+
- signing keys
63+
- proprietary ranking / governance rules
64+
65+
**Premium-only capabilities** are for paid, explicitly entitled users only. They are expected to live in a separate private repo and be loaded through the gated runtime only. Typical premium-only modules include:
66+
67+
- ACL / RBAC
68+
- multi-mailbox ingestion
69+
- partner digests and management summaries
70+
- advanced ranking / orchestration
71+
- governance / audit workflows beyond the OSS baseline
72+
73+
### Premium-only runtime behavior
74+
75+
Private premium extensions are **not loaded by default**.
76+
77+
The public runtime will only attempt to mount them when all of the following are true:
78+
79+
- a private premium entrypoint is configured
80+
- a valid entitlement is provided
81+
- local owner approval is present for protected premium features
82+
- the entitlement is not locally revoked
83+
84+
Without a valid entitlement and local approval path, the premium runtime stays off and private extensions are not mounted.
85+
86+
See:
87+
88+
- [`premium_contract.py`](premium_contract.py)
89+
- [`docs/premium/entitlement.schema.json`](docs/premium/entitlement.schema.json)
90+
- [`docs/premium/private_extension_contract.md`](docs/premium/private_extension_contract.md)
91+
- [`templates/private_premium_repo/`](templates/private_premium_repo/)
92+
4493
## Competitor Comparison
4594

4695
| Feature | sqlite-memory-mcp | Official MCP Memory | claude-mem0 | @pepk/sqlite | simple-memory | mcp-memory-service | memsearch | memory-mcp | MemoryGraph |
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# sqlite-memory-mcp-premium-template
2+
3+
Public-safe bootstrap template for a **separate private premium repo**.
4+
5+
This template is intentionally safe to keep in the OSS repo:
6+
7+
- no private keys
8+
- no customer entitlements
9+
- no premium business logic
10+
- no proprietary retrieval/ranking rules
11+
12+
## Purpose
13+
14+
Use this template to start a private repository that implements:
15+
16+
- `register_premium_extensions(...)`
17+
- premium-only MCP tools
18+
- private connector logic
19+
- premium governance / ACL / ingestion workflows
20+
21+
## Expected host
22+
23+
This template is meant to run next to the public `sqlite-memory-mcp` repo and use:
24+
25+
- `premium_runtime.py`
26+
- `premium_contract.py`
27+
28+
## Minimal flow
29+
30+
1. Create a new **private** repo.
31+
2. Copy this template into that repo.
32+
3. Implement premium-only tools under `sqlite_memory_premium/`.
33+
4. Point `SQLITE_MEMORY_PREMIUM_ENTRYPOINT` to the private module.
34+
5. Load through the gated public runtime only.
35+
36+
## Important boundary
37+
38+
Do not move secrets, signatures, entitlement issuance, or real premium logic into the public repo.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[project]
2+
name = "sqlite-memory-mcp-premium-template"
3+
version = "0.1.0"
4+
description = "Private premium repo template for sqlite-memory-mcp"
5+
requires-python = ">=3.10"
6+
dependencies = ["fastmcp>=2.0.0"]
7+
8+
[build-system]
9+
requires = ["setuptools>=61.0"]
10+
build-backend = "setuptools.build_meta"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Private premium repo template package."""
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
"""Minimal private premium registration template.
2+
3+
Copy this file into a private repo and replace the placeholder tools with the
4+
real premium implementation.
5+
"""
6+
7+
from __future__ import annotations
8+
9+
import json
10+
11+
from fastmcp import FastMCP
12+
13+
from premium_contract import (
14+
PREMIUM_RUNTIME_CONTRACT_VERSION,
15+
PremiumMountContext,
16+
PremiumRegistrationResult,
17+
)
18+
19+
premium_mcp = FastMCP(
20+
"sqlite-premium-template",
21+
instructions=(
22+
"Template MCP mounted from a separate private premium repo. "
23+
"Replace these placeholder tools with real premium-only features."
24+
),
25+
)
26+
27+
28+
@premium_mcp.tool()
29+
def premium_status() -> str:
30+
"""Template-only tool proving that private premium mounting works."""
31+
return json.dumps(
32+
{
33+
"status": "template_loaded",
34+
"note": "Replace this template tool with real premium-only tools.",
35+
}
36+
)
37+
38+
39+
def register_premium_extensions(
40+
mcp,
41+
*,
42+
server_name: str | None = None,
43+
mount_context: PremiumMountContext | None = None,
44+
) -> PremiumRegistrationResult:
45+
"""Mount a placeholder premium MCP into the host runtime.
46+
47+
Real premium repos should keep the same outer contract and swap in their
48+
proprietary tools and workflows here.
49+
"""
50+
if mount_context is None:
51+
raise RuntimeError("mount_context required")
52+
if mount_context.contract_version != PREMIUM_RUNTIME_CONTRACT_VERSION:
53+
raise RuntimeError(
54+
"premium contract mismatch: "
55+
f"{mount_context.contract_version} != {PREMIUM_RUNTIME_CONTRACT_VERSION}"
56+
)
57+
if hasattr(mcp, "mount"):
58+
mcp.mount(premium_mcp)
59+
return {
60+
"mounted": True,
61+
"contract_version": mount_context.contract_version,
62+
"extension_name": "sqlite-memory-premium-template",
63+
"features": ["template_status"],
64+
"notes": f"Mounted into {server_name or mount_context.server_name}",
65+
}

0 commit comments

Comments
 (0)