Skip to content

Commit bc9d183

Browse files
committed
feat(all): implement per-user MCP instance isolation for multi-user teams
1 parent 290b7d8 commit bc9d183

File tree

64 files changed

+15636
-708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+15636
-708
lines changed

services/backend/api-spec.json

Lines changed: 495 additions & 3 deletions
Large diffs are not rendered by default.

services/backend/api-spec.yaml

Lines changed: 384 additions & 4 deletions
Large diffs are not rendered by default.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CREATE TABLE "mcpServerInstances" (
2+
"id" text PRIMARY KEY NOT NULL,
3+
"installation_id" text NOT NULL,
4+
"user_id" text NOT NULL,
5+
"status" text DEFAULT 'provisioning' NOT NULL,
6+
"status_message" text,
7+
"status_updated_at" timestamp with time zone,
8+
"last_health_check_at" timestamp with time zone,
9+
"last_credential_check_at" timestamp with time zone,
10+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
11+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
12+
);
13+
--> statement-breakpoint
14+
ALTER TABLE "mcpServerInstances" ADD CONSTRAINT "mcpServerInstances_installation_id_mcpServerInstallations_id_fk" FOREIGN KEY ("installation_id") REFERENCES "public"."mcpServerInstallations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
15+
ALTER TABLE "mcpServerInstances" ADD CONSTRAINT "mcpServerInstances_user_id_authUser_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."authUser"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
16+
CREATE UNIQUE INDEX "mcp_instances_installation_user_idx" ON "mcpServerInstances" USING btree ("installation_id","user_id");--> statement-breakpoint
17+
CREATE INDEX "mcp_instances_user_idx" ON "mcpServerInstances" USING btree ("user_id");--> statement-breakpoint
18+
CREATE INDEX "mcp_instances_status_idx" ON "mcpServerInstances" USING btree ("status");
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
DROP INDEX "mcp_installations_status_idx";--> statement-breakpoint
2+
ALTER TABLE "mcpServerInstallations" DROP COLUMN "status";--> statement-breakpoint
3+
ALTER TABLE "mcpServerInstallations" DROP COLUMN "status_message";--> statement-breakpoint
4+
ALTER TABLE "mcpServerInstallations" DROP COLUMN "status_updated_at";--> statement-breakpoint
5+
ALTER TABLE "mcpServerInstallations" DROP COLUMN "last_health_check_at";--> statement-breakpoint
6+
ALTER TABLE "mcpServerInstallations" DROP COLUMN "last_credential_check_at";

0 commit comments

Comments
 (0)