Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function register(server: McpServer) {
"start_claude_session",
{
description:
"Start an autonomous Claude Code session for a task in an existing workspace. Launches Claude with the task context in the specified workspace.",
"Start an autonomous Claude Code session for a task in an existing workspace. Launches Claude with the task context in the specified workspace. The target device must belong to the current user.",
inputSchema: {
deviceId: z.string().describe("Target device ID"),
taskId: z.string().describe("Task ID to work on"),
Expand Down Expand Up @@ -172,7 +172,7 @@ export function register(server: McpServer) {
"start_claude_subagent",
{
description:
"Start a Claude Code subagent for a task in an existing workspace. Adds a new terminal pane to the active workspace instead of creating a new one. Use this when you want to run Claude alongside your current work.",
"Start a Claude Code subagent for a task in an existing workspace. Adds a new terminal pane to the active workspace instead of creating a new one. Use this when you want to run Claude alongside your current work. The target device must belong to the current user.",
inputSchema: {
deviceId: z.string().describe("Target device ID"),
taskId: z.string().describe("Task ID to work on"),
Expand Down
12 changes: 12 additions & 0 deletions packages/mcp/src/tools/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ export async function executeOnDevice({
};
}

if (device.userId !== ctx.userId) {
return {
content: [
{
type: "text" as const,
text: `Error: Device ${deviceId} does not belong to you. You can only execute commands on your own devices.`,
},
],
isError: true,
};
}

const [cmd] = await db
.insert(agentCommands)
.values({
Expand Down
Loading