Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

621 B
Raw Blame
<?php

declare(strict_types=1);

namespace App\Actions\AccessToken;

use App\Models\AccessToken;
use App\Models\User;
use App\Models\Workspace;

class HasConnectedMcpClient
{
    /**
     * Whether the user has an AI connected to this workspace through MCP, as
     * the MCP settings list it: each connection belongs to one workspace.
     */
    public static function execute(User $user, Workspace $workspace): bool
    {
        return AccessToken::query()
            ->where('user_id', $user->id)
            ->where('workspace_id', $workspace->id)
            ->connectedMcpOAuth()
            ->exists();
    }
}