Skip to content

Commit f6ca505

Browse files
committed
chore: Bump versions (API 2.2.0, MCP 2.1.0) and add cowork deployment
- API: 2.1.0 → 2.2.0 - MCP server: 2.0.0 → 2.1.0 - Add ops/cowork/ self-hosted deployment for Claude Cowork - Update SerialMemory-MCP submodule pointer
1 parent bfc9be2 commit f6ca505

6 files changed

Lines changed: 138 additions & 4 deletions

File tree

SerialMemory-MCP

SerialMemory.Api/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@
579579
// ============================================
580580

581581
// Initialize health check service
582-
var healthService = new HealthCheckService(operationalConfig, "2.1.0", Environment.GetEnvironmentVariable("ENVIRONMENT") ?? "development");
582+
var healthService = new HealthCheckService(operationalConfig, "2.2.0", Environment.GetEnvironmentVariable("ENVIRONMENT") ?? "development");
583583
healthService.AddCheck(new LivenessCheck());
584584
healthService.AddCheck(new DatabaseHealthCheck(pgConnectionString, operationalConfig.DatabaseHealthCheckTimeoutSeconds));
585585
// RLS guardrail check is only relevant for multi-tenant SaaS mode

SerialMemory.Api/SelfHosted/SelfHostedEndpoints.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ private static bool CanAccessSelfHostFeatures(IDeploymentContext deployment, Htt
375375

376376
private static string GetVersion()
377377
{
378-
return typeof(SelfHostedEndpoints).Assembly.GetName().Version?.ToString() ?? "2.1.0";
378+
return typeof(SelfHostedEndpoints).Assembly.GetName().Version?.ToString() ?? "2.2.0";
379379
}
380380

381381
private static string GetUptime()

SerialMemory.Mcp/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ static void RegisterToolCategory(
438438
object HandleInitialize() => new
439439
{
440440
protocolVersion = "2024-11-05",
441-
serverInfo = new { name = "serialmemory-server", version = "2.0.0" },
441+
serverInfo = new { name = "serialmemory-server", version = "2.1.0" },
442442
capabilities = new { tools = new { }, resources = new { } }
443443
};
444444

ops/cowork/docker-compose.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# =============================================================================
2+
# SerialMemory MCP - Self-Hosted Deployment for Claude Cowork
3+
# =============================================================================
4+
# Deploy on a local machine, expose via Cloudflare tunnel.
5+
#
6+
# Quick Start:
7+
# cp .env.example .env # Edit with your values
8+
# docker compose up -d
9+
# # Add Cloudflare tunnel route: mcp.serialmemory.dev -> http://localhost:4545
10+
#
11+
# =============================================================================
12+
13+
services:
14+
# ---------------------------------------------------------------------------
15+
# Database: PostgreSQL with pgvector
16+
# ---------------------------------------------------------------------------
17+
postgres:
18+
image: pgvector/pgvector:pg17
19+
container_name: serialmemory-postgres
20+
environment:
21+
POSTGRES_USER: ${POSTGRES_USER:-postgres}
22+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
23+
POSTGRES_DB: ${POSTGRES_DB:-contextdb}
24+
SERIALMEMORY_API_KEY: ${SERIALMEMORY_API_KEY:?SERIALMEMORY_API_KEY is required}
25+
volumes:
26+
- ../init.sql:/docker-entrypoint-initdb.d/01-init.sql:ro
27+
- ../eventsourcing_schema.sql:/docker-entrypoint-initdb.d/02-eventsourcing.sql:ro
28+
- ../multi_tenant_schema.sql:/docker-entrypoint-initdb.d/03-multi-tenant.sql:ro
29+
- ../rls_policies.sql:/docker-entrypoint-initdb.d/04-rls.sql:ro
30+
- ../usage_metering_schema.sql:/docker-entrypoint-initdb.d/05-usage.sql:ro
31+
- ../admin_actions_schema.sql:/docker-entrypoint-initdb.d/06-admin.sql:ro
32+
- ../job_supervision_schema.sql:/docker-entrypoint-initdb.d/07-jobs.sql:ro
33+
- ../telemetry_schema.sql:/docker-entrypoint-initdb.d/08-telemetry.sql:ro
34+
- ../reasoning_schema.sql:/docker-entrypoint-initdb.d/09-reasoning.sql:ro
35+
- ../mind_health_schema.sql:/docker-entrypoint-initdb.d/10-mind.sql:ro
36+
- ../llm_settings_schema.sql:/docker-entrypoint-initdb.d/11-llm.sql:ro
37+
- ../classification_schema.sql:/docker-entrypoint-initdb.d/12-classify.sql:ro
38+
- ../fix_memories_columns.sql:/docker-entrypoint-initdb.d/13-fix.sql:ro
39+
- ../emergency_rls_fix.sql:/docker-entrypoint-initdb.d/99-rls-fix.sql:ro
40+
- ./init-selfhosted.sh:/docker-entrypoint-initdb.d/AA-selfhosted.sh:ro
41+
- pgdata:/var/lib/postgresql/data
42+
healthcheck:
43+
test: ["CMD-SHELL", "pg_isready -U postgres -d contextdb"]
44+
interval: 5s
45+
timeout: 5s
46+
retries: 5
47+
networks:
48+
- internal
49+
restart: unless-stopped
50+
51+
# ---------------------------------------------------------------------------
52+
# MCP Server (HTTP mode)
53+
# ---------------------------------------------------------------------------
54+
mcp:
55+
build:
56+
context: ../..
57+
dockerfile: SerialMemory.Mcp/Dockerfile
58+
container_name: serialmemory-mcp
59+
command: ["--http-only"]
60+
ports:
61+
- "4545:4545"
62+
environment:
63+
- POSTGRES_HOST=postgres
64+
- POSTGRES_PORT=5432
65+
- POSTGRES_USER=${POSTGRES_USER:-postgres}
66+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
67+
- POSTGRES_DB=${POSTGRES_DB:-contextdb}
68+
- SERIALMEMORY_API_KEY=${SERIALMEMORY_API_KEY}
69+
- OLLAMA_URL=${OLLAMA_URL:-http://host.docker.internal:11434}
70+
- OLLAMA_MODEL=${OLLAMA_MODEL:-nomic-embed-text}
71+
- OLLAMA_EMBEDDING_DIM=${OLLAMA_EMBEDDING_DIM:-768}
72+
- MCP_HTTP_TOKEN=${MCP_HTTP_TOKEN:-}
73+
extra_hosts:
74+
- "host.docker.internal:host-gateway"
75+
depends_on:
76+
postgres:
77+
condition: service_healthy
78+
networks:
79+
- internal
80+
restart: unless-stopped
81+
82+
networks:
83+
internal:
84+
driver: bridge
85+
86+
volumes:
87+
pgdata:

ops/cowork/init-selfhosted.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Bootstrap self-hosted tenant and API key
5+
# Runs during PostgreSQL container initialization (after schema scripts)
6+
7+
API_KEY="${SERIALMEMORY_API_KEY:-sm_selfhosted_default_key}"
8+
TENANT_ID="00000000-0000-0000-0000-000000000000"
9+
10+
echo "Bootstrapping self-hosted tenant..."
11+
12+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" \
13+
-v api_key="$API_KEY" -v tenant_id="$TENANT_ID" <<'EOSQL'
14+
15+
-- Create self-hosted tenant
16+
INSERT INTO tenants (id, name, slug, status)
17+
VALUES (:'tenant_id'::uuid, 'Self-Hosted', 'self-hosted', 'active')
18+
ON CONFLICT (id) DO NOTHING;
19+
20+
-- Tenant settings (unlimited)
21+
INSERT INTO tenant_settings (tenant_id, plan, max_workspaces, max_users)
22+
VALUES (:'tenant_id'::uuid, 'self-hosted', 1000, 100)
23+
ON CONFLICT (tenant_id) DO NOTHING;
24+
25+
-- Owner user
26+
INSERT INTO tenant_users (tenant_id, user_id, role)
27+
VALUES (:'tenant_id'::uuid, 'admin', 'owner')
28+
ON CONFLICT (tenant_id, user_id) DO NOTHING;
29+
30+
-- API key (hashed with SHA-256)
31+
INSERT INTO tenant_api_keys (tenant_id, name, key_hash, key_prefix, scopes, created_by)
32+
VALUES (
33+
:'tenant_id'::uuid,
34+
'Docker Deployment Key',
35+
encode(sha256(:'api_key'::bytea), 'hex'),
36+
left(:'api_key', 8),
37+
ARRAY['serialmemory.core', 'serialmemory.admin'],
38+
'bootstrap'
39+
)
40+
ON CONFLICT (tenant_id, name) DO UPDATE SET
41+
key_hash = EXCLUDED.key_hash,
42+
key_prefix = EXCLUDED.key_prefix,
43+
revoked_at = NULL;
44+
45+
EOSQL
46+
47+
echo "Self-hosted tenant bootstrapped (key prefix: ${API_KEY:0:8}...)"

0 commit comments

Comments
 (0)