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
5 changes: 5 additions & 0 deletions .changeset/remarkable-peach-panda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inkeep/agents-manage-ui": patch
---

Fix user-scoped MCP credential card not updating after connect or disconnect without manual page refresh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FullPageError from '@/components/errors/full-page-error';
import { ViewMCPServerDetailsProjectScope } from '@/components/mcp-servers/view-mcp-server-details-project-scope';
import { ViewMCPServerDetailsUserScope } from '@/components/mcp-servers/view-mcp-server-details-user-scope';
import { fetchCredential } from '@/lib/api/credentials';
import { fetchCredential, fetchUserScopedCredential } from '@/lib/api/credentials';
import { fetchMCPTool } from '@/lib/api/tools';
import { getErrorCode } from '@/lib/utils/error-serialization';

Expand All @@ -14,8 +14,15 @@ async function MCPPage({
const tool = await fetchMCPTool(tenantId, projectId, mcpServerId);

if (tool.credentialScope === 'user') {
const userCredential = await fetchUserScopedCredential(tenantId, projectId, tool.id);

return (
<ViewMCPServerDetailsUserScope tool={tool} tenantId={tenantId} projectId={projectId} />
<ViewMCPServerDetailsUserScope
tool={tool}
userCredential={userCredential}
tenantId={tenantId}
projectId={projectId}
/>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
ItemCardTitle,
} from '@/components/ui/item-card';
import { useOAuthLogin } from '@/hooks/use-oauth-login';
import { useUserScopedCredentialQuery } from '@/lib/query/credentials';
import type { Credential } from '@/lib/api/credentials';
import { useProjectPermissionsQuery } from '@/lib/query/projects';
import type { MCPTool } from '@/lib/types/tools';
import { Button } from '../ui/button';
Expand All @@ -38,10 +38,12 @@ import {

export function ViewMCPServerDetailsUserScope({
tool,
userCredential,
tenantId,
projectId,
}: {
tool: MCPTool;
userCredential: Credential | null;
tenantId: string;
projectId: string;
}) {
Expand All @@ -60,10 +62,6 @@ export function ViewMCPServerDetailsUserScope({

const [showDisconnectDialog, setShowDisconnectDialog] = useState(false);

const { data: userCredential, isFetching: isLoadingCredential } = useUserScopedCredentialQuery({
toolId: tool.id,
});

return (
<div className="max-w-2xl mx-auto space-y-6">
{/* Header */}
Expand Down Expand Up @@ -118,13 +116,11 @@ export function ViewMCPServerDetailsUserScope({
</div>

{/* Your Connection */}
{(isLoadingCredential || userCredential || tool.status === 'needs_auth') && (
{(userCredential || tool.status === 'needs_auth') && (
<div className="space-y-2">
<ItemLabel>Your Connection</ItemLabel>

{isLoadingCredential ? (
<p className="text-sm text-muted-foreground">Checking your connection status...</p>
) : userCredential ? (
{userCredential ? (
<ItemCardRoot>
<ItemCardHeader>
<ItemCardLink
Expand Down
38 changes: 0 additions & 38 deletions agents-manage-ui/src/lib/query/credentials.ts

This file was deleted.

Loading