MCP: workspace settings, viewer read access, and token access (#241)
* Add workspace MCP settings and token access controls.
Ship MCP settings UI, OAuth revoke/list helpers, Passport deploy wiring,
and workspace.token:mcp gating so assistants can connect without pulling
in welcome/onboarding from the parent epic.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Type MCP client config shapes instead of string checks.
Encode http/config-root on each advanced client and tighten primary
client ids so snippet generation does not branch on magic strings.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Polish MCP settings follow-ups from review.
Translate Ukrainian MCP copy, deep-link ChatGPT into connector
creation, drop an unused asset and revoke arg, and assert PATs are
rejected on the MCP endpoint.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Harden MCP connected clients, revoke scope, and OAuth consent.
List recoverable sessions with live refresh tokens, revoke only PATs,
throttle registration alone, and block viewers from authorizing MCP.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Simplify MCP OAuth route throttling to a single middleware group.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Allow workspace viewers read-only MCP access with web policy writes.
Mirror the web app: MCP connects on view + OAuth mcp:use, write tools
enforce createPost/update/delete/manageAccounts/manageTeam, and demotion
to Viewer keeps grants. Cover role denials, consent, and disconnect.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Harden MCP tool authz with shared workspace helpers.
Route ApiKey tools through AuthorizesMcpTool, fail closed on null user
or policy argument, and resolve the current workspace before mutating.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop redundant string casts on validated request data.
Enum::from and validated() fields are already strings, so the casts
add noise without changing behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Show only the current user's MCP connections in settings.
Match API keys privacy: list and disconnect your own OAuth clients,
not teammates' across the account.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Cover LoadWorkspaceFromToken gaps and harden AuthorizesMcpTool tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop redundant is_string guard before UpdatePostTool find.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Refactor AppSidebar to always show MCP link and simplify route middleware definition in ai.php. The MCP link is now consistently displayed regardless of the current workspace state, and the route middleware syntax has been streamlined.
* Refresh MCP connected clients with Inertia usePoll.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Bump laravel/mcp to 0.9.1 and add the TryPost server icon.
Requires laravel/boost 2.5 for the Icon attribute; expose images/trypost/icon.png on TryPostServer.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop no-op ReflectionClass import in TryPostServerTest.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 12:54:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
use App\Enums\UserWorkspace\Role;
|
|
|
|
|
use App\Models\AccessToken;
|
|
|
|
|
use App\Models\User;
|
|
|
|
|
use App\Models\Workspace;
|
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
|
|
beforeEach(function (): void {
|
|
|
|
|
config(['trypost.self_hosted' => false]);
|
|
|
|
|
|
|
|
|
|
$this->user = User::factory()->create();
|
|
|
|
|
$this->workspace = Workspace::factory()->create([
|
|
|
|
|
'account_id' => $this->user->account_id,
|
|
|
|
|
'user_id' => $this->user->id,
|
|
|
|
|
]);
|
|
|
|
|
$this->workspace->members()->attach($this->user->id, ['role' => Role::Admin->value]);
|
|
|
|
|
$this->user->update(['current_workspace_id' => $this->workspace->id]);
|
|
|
|
|
$this->user->refresh();
|
|
|
|
|
|
|
|
|
|
// SaaS mode: the MCP settings live behind EnsureAccountReady.
|
|
|
|
|
subscribeAccount($this->user->account);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('shows the mcp settings page', function (): void {
|
|
|
|
|
$this->actingAs($this->user)
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertOk()
|
|
|
|
|
->assertInertia(fn ($page) => $page
|
|
|
|
|
->component('settings/workspace/Mcp')
|
|
|
|
|
->where('mcpUrl', route('mcp.trypost'))
|
|
|
|
|
->missing('docsUrl')
|
|
|
|
|
->missing('mcpClients')
|
|
|
|
|
->has('connectedClients'));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('shows the mcp settings page without a subscription in self-hosted mode', function (): void {
|
|
|
|
|
config(['trypost.self_hosted' => true]);
|
|
|
|
|
$this->user->account->subscriptions()->delete();
|
|
|
|
|
|
|
|
|
|
$this->actingAs($this->user->fresh())
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertOk()
|
|
|
|
|
->assertInertia(fn ($page) => $page
|
|
|
|
|
->component('settings/workspace/Mcp')
|
|
|
|
|
->where('mcpUrl', route('mcp.trypost')));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('lists only the current users oauth clients as connected, excluding personal access tokens', function (): void {
|
|
|
|
|
$member = User::factory()->create(['account_id' => $this->user->account_id]);
|
|
|
|
|
$this->workspace->members()->attach($member->id, ['role' => Role::Member->value]);
|
|
|
|
|
$member->update(['current_workspace_id' => $this->workspace->id]);
|
|
|
|
|
|
|
|
|
|
$ownerClientId = mcpOauthClient('Owner Agent');
|
|
|
|
|
mcpAccessToken($this->user, $ownerClientId);
|
|
|
|
|
|
|
|
|
|
$memberClientId = mcpOauthClient('Member Agent');
|
|
|
|
|
mcpAccessToken($member, $memberClientId);
|
|
|
|
|
|
|
|
|
|
$pat = $this->user->createToken('API Key');
|
|
|
|
|
AccessToken::query()->findOrFail($pat->token->id)
|
|
|
|
|
->forceFill(['workspace_id' => $this->workspace->id])
|
|
|
|
|
->saveQuietly();
|
|
|
|
|
|
|
|
|
|
$this->actingAs($this->user)
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertInertia(fn ($page) => $page
|
|
|
|
|
->has('connectedClients', 1)
|
|
|
|
|
->where('connectedClients.0.name', 'Owner Agent')
|
|
|
|
|
->where('connectedClients.0.can_disconnect', true)
|
|
|
|
|
->where('connectedClients', fn ($clients): bool => collect($clients)->every(
|
|
|
|
|
fn (array $client): bool => $client['name'] !== 'Member Agent',
|
|
|
|
|
)));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('excludes unscoped oauth grants from connected clients', function (): void {
|
|
|
|
|
mcpAccessToken($this->user, mcpOauthClient('Unscoped Agent'), scopes: []);
|
|
|
|
|
|
|
|
|
|
$this->actingAs($this->user)
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertInertia(fn ($page) => $page->where('connectedClients', []));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('lists viewer own oauth grants as connected clients', function (): void {
|
|
|
|
|
$viewer = User::factory()->create(['account_id' => $this->user->account_id]);
|
|
|
|
|
$this->workspace->members()->attach($viewer->id, ['role' => Role::Viewer->value]);
|
|
|
|
|
$viewer->update(['current_workspace_id' => $this->workspace->id]);
|
|
|
|
|
|
|
|
|
|
mcpAccessToken($viewer, mcpOauthClient('Viewer Agent'));
|
|
|
|
|
|
|
|
|
|
$this->actingAs($viewer->fresh())
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertInertia(fn ($page) => $page
|
|
|
|
|
->has('connectedClients', 1)
|
|
|
|
|
->where('connectedClients.0.name', 'Viewer Agent')
|
|
|
|
|
->where('connectedClients.0.can_disconnect', true));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('disconnects a client by revoking its tokens', function (): void {
|
|
|
|
|
$clientId = mcpOauthClient();
|
|
|
|
|
$token = mcpAccessToken($this->user, $clientId);
|
|
|
|
|
|
|
|
|
|
$this->actingAs($this->user)
|
|
|
|
|
->delete(route('app.mcp.disconnect', ['client' => $clientId]))
|
|
|
|
|
->assertRedirect()
|
|
|
|
|
->assertSessionHas('flash.success', __('mcp.disconnected'));
|
|
|
|
|
|
|
|
|
|
expect($token->fresh()->revoked)->toBeTrue();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('disconnects a client when its access token expired but its refresh token is live', function (): void {
|
|
|
|
|
$clientId = mcpOauthClient();
|
|
|
|
|
$token = mcpAccessToken($this->user, $clientId);
|
|
|
|
|
$token->forceFill(['expires_at' => now()->subMinute()])->saveQuietly();
|
|
|
|
|
$refreshTokenId = Str::random(80);
|
|
|
|
|
DB::table('oauth_refresh_tokens')->insert([
|
|
|
|
|
'id' => $refreshTokenId,
|
|
|
|
|
'access_token_id' => $token->id,
|
|
|
|
|
'revoked' => false,
|
|
|
|
|
'expires_at' => now()->addMonth(),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$this->actingAs($this->user)
|
|
|
|
|
->delete(route('app.mcp.disconnect', ['client' => $clientId]))
|
|
|
|
|
->assertRedirect()
|
|
|
|
|
->assertSessionHas('flash.success');
|
|
|
|
|
|
|
|
|
|
expect($token->fresh()->revoked)->toBeTrue()
|
|
|
|
|
->and(DB::table('oauth_refresh_tokens')->where('id', $refreshTokenId)->value('revoked'))->toBeTrue();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('lists a client when its access token expired but its refresh token is live', function (): void {
|
|
|
|
|
$clientId = mcpOauthClient('Recoverable Agent');
|
|
|
|
|
$token = mcpAccessToken($this->user, $clientId);
|
|
|
|
|
$token->forceFill(['expires_at' => now()->subMinute()])->saveQuietly();
|
|
|
|
|
DB::table('oauth_refresh_tokens')->insert([
|
|
|
|
|
'id' => Str::random(80),
|
|
|
|
|
'access_token_id' => $token->id,
|
|
|
|
|
'revoked' => false,
|
|
|
|
|
'expires_at' => now()->addMonth(),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$this->actingAs($this->user)
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertOk()
|
|
|
|
|
->assertInertia(fn ($page) => $page
|
|
|
|
|
->has('connectedClients', 1)
|
|
|
|
|
->where('connectedClients.0.name', 'Recoverable Agent')
|
|
|
|
|
->where('connectedClients.0.can_disconnect', true));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('hides a client when both access and refresh tokens are expired', function (): void {
|
|
|
|
|
$clientId = mcpOauthClient('Dead Agent');
|
|
|
|
|
$token = mcpAccessToken($this->user, $clientId);
|
|
|
|
|
$token->forceFill(['expires_at' => now()->subMinute()])->saveQuietly();
|
|
|
|
|
DB::table('oauth_refresh_tokens')->insert([
|
|
|
|
|
'id' => Str::random(80),
|
|
|
|
|
'access_token_id' => $token->id,
|
|
|
|
|
'revoked' => false,
|
|
|
|
|
'expires_at' => now()->subMinute(),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$this->actingAs($this->user)
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertOk()
|
|
|
|
|
->assertInertia(fn ($page) => $page->where('connectedClients', []));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('does not flash success when disconnecting an unknown client', function (): void {
|
|
|
|
|
$this->actingAs($this->user)
|
|
|
|
|
->delete(route('app.mcp.disconnect', ['client' => (string) Str::uuid()]))
|
|
|
|
|
->assertRedirect()
|
|
|
|
|
->assertSessionMissing('flash.success');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('does not list a teammates mcp connection', function (): void {
|
|
|
|
|
$member = User::factory()->create(['account_id' => $this->user->account_id]);
|
|
|
|
|
$this->workspace->members()->attach($member->id, ['role' => Role::Member->value]);
|
|
|
|
|
$member->update(['current_workspace_id' => $this->workspace->id]);
|
|
|
|
|
|
|
|
|
|
mcpAccessToken($this->user, mcpOauthClient('Owner Agent'));
|
|
|
|
|
|
|
|
|
|
$this->actingAs($member->fresh())
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertOk()
|
|
|
|
|
->assertInertia(fn ($page) => $page->where('connectedClients', []));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('allows workspace members to view and disconnect their own mcp clients', function (): void {
|
|
|
|
|
$member = User::factory()->create(['account_id' => $this->user->account_id]);
|
|
|
|
|
$this->workspace->members()->attach($member->id, ['role' => Role::Member->value]);
|
|
|
|
|
$member->update(['current_workspace_id' => $this->workspace->id]);
|
|
|
|
|
|
|
|
|
|
$clientId = mcpOauthClient('Member Agent');
|
|
|
|
|
$token = mcpAccessToken($member, $clientId);
|
|
|
|
|
|
|
|
|
|
$this->actingAs($member->fresh())
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertOk()
|
|
|
|
|
->assertInertia(fn ($page) => $page
|
|
|
|
|
->has('connectedClients', 1)
|
|
|
|
|
->where('connectedClients.0.name', 'Member Agent'));
|
|
|
|
|
|
|
|
|
|
$this->actingAs($member->fresh())
|
|
|
|
|
->delete(route('app.mcp.disconnect', ['client' => $clientId]))
|
|
|
|
|
->assertRedirect()
|
|
|
|
|
->assertSessionHas('flash.success');
|
|
|
|
|
|
|
|
|
|
expect($token->fresh()->revoked)->toBeTrue();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('allows workspace viewers to view and disconnect their own mcp clients', function (): void {
|
|
|
|
|
$viewer = User::factory()->create(['account_id' => $this->user->account_id]);
|
|
|
|
|
$this->workspace->members()->attach($viewer->id, ['role' => Role::Viewer->value]);
|
|
|
|
|
$viewer->update(['current_workspace_id' => $this->workspace->id]);
|
|
|
|
|
|
|
|
|
|
$clientId = mcpOauthClient('Viewer Agent');
|
|
|
|
|
$token = mcpAccessToken($viewer, $clientId);
|
|
|
|
|
|
|
|
|
|
$this->actingAs($viewer->fresh())
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertOk()
|
|
|
|
|
->assertInertia(fn ($page) => $page
|
|
|
|
|
->component('settings/workspace/Mcp')
|
|
|
|
|
->has('connectedClients', 1)
|
|
|
|
|
->where('connectedClients.0.name', 'Viewer Agent')
|
|
|
|
|
->where('connectedClients.0.can_disconnect', true));
|
|
|
|
|
|
|
|
|
|
$this->actingAs($viewer->fresh())
|
|
|
|
|
->delete(route('app.mcp.disconnect', ['client' => $clientId]))
|
|
|
|
|
->assertRedirect()
|
|
|
|
|
->assertSessionHas('flash.success');
|
|
|
|
|
|
|
|
|
|
expect($token->fresh()->revoked)->toBeTrue();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('does not revoke another users mcp client tokens', function (): void {
|
|
|
|
|
$member = User::factory()->create(['account_id' => $this->user->account_id]);
|
|
|
|
|
$this->workspace->members()->attach($member->id, ['role' => Role::Member->value]);
|
|
|
|
|
$member->update(['current_workspace_id' => $this->workspace->id]);
|
|
|
|
|
|
|
|
|
|
$clientId = mcpOauthClient('Owner Agent');
|
|
|
|
|
$token = mcpAccessToken($this->user, $clientId);
|
|
|
|
|
|
|
|
|
|
$this->actingAs($member->fresh())
|
|
|
|
|
->delete(route('app.mcp.disconnect', ['client' => $clientId]))
|
|
|
|
|
->assertRedirect()
|
|
|
|
|
->assertSessionMissing('flash.success');
|
|
|
|
|
|
|
|
|
|
expect($token->fresh()->revoked)->toBeFalse();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('does not revoke personal access tokens via disconnect', function (): void {
|
|
|
|
|
$pat = $this->user->createToken('API Key');
|
|
|
|
|
$token = AccessToken::query()->findOrFail($pat->token->id);
|
|
|
|
|
$token->forceFill(['workspace_id' => $this->workspace->id])->saveQuietly();
|
|
|
|
|
|
|
|
|
|
$this->actingAs($this->user)
|
|
|
|
|
->delete(route('app.mcp.disconnect', ['client' => $token->client_id]))
|
|
|
|
|
->assertRedirect()
|
|
|
|
|
->assertSessionMissing('flash.success');
|
|
|
|
|
|
|
|
|
|
expect($token->fresh()->revoked)->toBeFalse();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('requires authentication', function (): void {
|
|
|
|
|
$this->get(route('app.mcp.index'))->assertRedirect();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('forbids users without workspace access', function (): void {
|
|
|
|
|
$outsider = User::factory()->create();
|
|
|
|
|
subscribeAccount($outsider->account);
|
|
|
|
|
$outsider->update(['current_workspace_id' => $this->workspace->id]);
|
|
|
|
|
|
|
|
|
|
$this->actingAs($outsider->fresh())
|
|
|
|
|
->get(route('app.mcp.index'))
|
|
|
|
|
->assertForbidden();
|
|
|
|
|
});
|
|
|
|
|
|
2026-08-06 14:34:50 +00:00
|
|
|
it('redirects to welcome when the account has no app access', function (): void {
|
MCP: workspace settings, viewer read access, and token access (#241)
* Add workspace MCP settings and token access controls.
Ship MCP settings UI, OAuth revoke/list helpers, Passport deploy wiring,
and workspace.token:mcp gating so assistants can connect without pulling
in welcome/onboarding from the parent epic.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Type MCP client config shapes instead of string checks.
Encode http/config-root on each advanced client and tighten primary
client ids so snippet generation does not branch on magic strings.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Polish MCP settings follow-ups from review.
Translate Ukrainian MCP copy, deep-link ChatGPT into connector
creation, drop an unused asset and revoke arg, and assert PATs are
rejected on the MCP endpoint.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Harden MCP connected clients, revoke scope, and OAuth consent.
List recoverable sessions with live refresh tokens, revoke only PATs,
throttle registration alone, and block viewers from authorizing MCP.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Simplify MCP OAuth route throttling to a single middleware group.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Allow workspace viewers read-only MCP access with web policy writes.
Mirror the web app: MCP connects on view + OAuth mcp:use, write tools
enforce createPost/update/delete/manageAccounts/manageTeam, and demotion
to Viewer keeps grants. Cover role denials, consent, and disconnect.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Harden MCP tool authz with shared workspace helpers.
Route ApiKey tools through AuthorizesMcpTool, fail closed on null user
or policy argument, and resolve the current workspace before mutating.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop redundant string casts on validated request data.
Enum::from and validated() fields are already strings, so the casts
add noise without changing behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Show only the current user's MCP connections in settings.
Match API keys privacy: list and disconnect your own OAuth clients,
not teammates' across the account.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Cover LoadWorkspaceFromToken gaps and harden AuthorizesMcpTool tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop redundant is_string guard before UpdatePostTool find.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Refactor AppSidebar to always show MCP link and simplify route middleware definition in ai.php. The MCP link is now consistently displayed regardless of the current workspace state, and the route middleware syntax has been streamlined.
* Refresh MCP connected clients with Inertia usePoll.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Bump laravel/mcp to 0.9.1 and add the TryPost server icon.
Requires laravel/boost 2.5 for the Icon attribute; expose images/trypost/icon.png on TryPostServer.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop no-op ReflectionClass import in TryPostServerTest.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 12:54:51 +00:00
|
|
|
$this->user->account->subscriptions()->delete();
|
|
|
|
|
|
|
|
|
|
$this->actingAs($this->user->fresh())
|
|
|
|
|
->get(route('app.mcp.index'))
|
2026-08-06 14:34:50 +00:00
|
|
|
->assertRedirect(route('app.welcome.persona'));
|
MCP: workspace settings, viewer read access, and token access (#241)
* Add workspace MCP settings and token access controls.
Ship MCP settings UI, OAuth revoke/list helpers, Passport deploy wiring,
and workspace.token:mcp gating so assistants can connect without pulling
in welcome/onboarding from the parent epic.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Type MCP client config shapes instead of string checks.
Encode http/config-root on each advanced client and tighten primary
client ids so snippet generation does not branch on magic strings.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Polish MCP settings follow-ups from review.
Translate Ukrainian MCP copy, deep-link ChatGPT into connector
creation, drop an unused asset and revoke arg, and assert PATs are
rejected on the MCP endpoint.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Harden MCP connected clients, revoke scope, and OAuth consent.
List recoverable sessions with live refresh tokens, revoke only PATs,
throttle registration alone, and block viewers from authorizing MCP.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Simplify MCP OAuth route throttling to a single middleware group.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Allow workspace viewers read-only MCP access with web policy writes.
Mirror the web app: MCP connects on view + OAuth mcp:use, write tools
enforce createPost/update/delete/manageAccounts/manageTeam, and demotion
to Viewer keeps grants. Cover role denials, consent, and disconnect.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Harden MCP tool authz with shared workspace helpers.
Route ApiKey tools through AuthorizesMcpTool, fail closed on null user
or policy argument, and resolve the current workspace before mutating.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop redundant string casts on validated request data.
Enum::from and validated() fields are already strings, so the casts
add noise without changing behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Show only the current user's MCP connections in settings.
Match API keys privacy: list and disconnect your own OAuth clients,
not teammates' across the account.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Cover LoadWorkspaceFromToken gaps and harden AuthorizesMcpTool tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop redundant is_string guard before UpdatePostTool find.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Refactor AppSidebar to always show MCP link and simplify route middleware definition in ai.php. The MCP link is now consistently displayed regardless of the current workspace state, and the route middleware syntax has been streamlined.
* Refresh MCP connected clients with Inertia usePoll.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Bump laravel/mcp to 0.9.1 and add the TryPost server icon.
Requires laravel/boost 2.5 for the Icon attribute; expose images/trypost/icon.png on TryPostServer.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop no-op ReflectionClass import in TryPostServerTest.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 12:54:51 +00:00
|
|
|
});
|