Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Decision docs:

- [deployment shape](docs/deployment.md)
- [ACP alias bridge](docs/acp-alias-bridge.md)
- [MCP agent registration](docs/mcp-agent-registration.md)

Working rules:

Expand Down
13 changes: 13 additions & 0 deletions apps/server/drizzle/0003_mcp_agents.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ALTER TABLE `agents` ADD `host_kind` text NOT NULL DEFAULT 'custom';
--> statement-breakpoint
ALTER TABLE `agents` ADD `execution_name` text;
--> statement-breakpoint
ALTER TABLE `agents` ADD `fingerprint` text;
--> statement-breakpoint
ALTER TABLE `agents` ADD `orchestrator` integer NOT NULL DEFAULT false;
--> statement-breakpoint
ALTER TABLE `agents` ADD `controlled` integer NOT NULL DEFAULT false;
--> statement-breakpoint
ALTER TABLE `agents` ADD `endpoints` text NOT NULL DEFAULT '[]';
--> statement-breakpoint
CREATE INDEX `agents_node_execution_idx` ON `agents` (`node_id`,`host_kind`,`execution_name`);
7 changes: 7 additions & 0 deletions apps/server/drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
"when": 1778675200000,
"tag": "0002_session_cwd",
"breakpoints": true
},
{
"idx": 3,
"version": "7",
"when": 1778761600000,
"tag": "0003_mcp_agents",
"breakpoints": true
}
]
}
38 changes: 38 additions & 0 deletions apps/server/scripts/smoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ async function main() {
);

await idle();
await registerMcpSelf(app, {
name: "Claude",
hostKind: "claude",
executionName: "claude",
transport: "npx",
node: {
id: "node-source",
name: "node-source",
host: "source-host",
labels: ["demo"]
}
});

const direct = await injectAuthed(app, authCookie, {
method: "POST",
Expand Down Expand Up @@ -280,6 +292,32 @@ async function loginCookie(app: ReturnType<typeof buildApp>) {
return String(cookie).split(";")[0];
}

async function registerMcpSelf(
app: ReturnType<typeof buildApp>,
payload: {
name: string;
hostKind: string;
executionName: string;
transport: "url" | "npx";
node?: {
id: string;
name: string;
host: string;
labels: string[];
};
}
) {
const response = await app.inject({
method: "POST",
url: "/api/mcp/register-self",
headers: {
authorization: "Bearer demo-token"
},
payload
});
assert(response.statusCode === 200, "expected MCP self registration to succeed");
}

async function injectAuthed(
app: ReturnType<typeof buildApp>,
cookie: string,
Expand Down
Loading
Loading