11import { useFetcher , useLocation } from "@remix-run/react" ;
22import type { ReactNode } from "react" ;
3- import { InlineCode } from "~/components/code/InlineCode" ;
4- import { McpClientName } from "~/components/mcp/McpClientName" ;
53import { Button , LinkButton } from "~/components/primitives/Buttons" ;
64import { DateTime } from "~/components/primitives/DateTime" ;
75import { Paragraph } from "~/components/primitives/Paragraph" ;
86import { InformationCircleIcon } from "@heroicons/react/20/solid" ;
9- import { Header3 } from "~/components/primitives/Headers" ;
107import { SimpleTooltip } from "~/components/primitives/Tooltip" ;
11- import { SettingsRow , SettingsRowDescription } from "~/components/primitives/SettingsLayout" ;
8+ import {
9+ SETTINGS_SECTION_GAP ,
10+ SettingsHeader ,
11+ SettingsRow ,
12+ } from "~/components/primitives/SettingsLayout" ;
1213import { Switch } from "~/components/primitives/Switch" ;
1314import {
1415 Table ,
@@ -20,6 +21,7 @@ import {
2021 TableRow ,
2122} from "~/components/primitives/Table" ;
2223import type { McpConnectionListItem } from "~/mcp/policy/mcpAccess.server" ;
24+ import { mcpClientName } from "~/utils/mcpClient" ;
2325
2426type Connection = Omit < McpConnectionListItem , "block" > & {
2527 block : { id : string ; scope : "CONNECTION" | "ORGANIZATION_CLIENT" } | null ;
@@ -49,15 +51,14 @@ export function McpAccessSection({
4951 < div >
5052 < Subsection
5153 title = "Member connections"
52- description = "MCP clients that members of this organization have connected. Blocking a connection is not a hard stop: a client that registers again gets a new identity ."
54+ description = "AI tools your members have connected. Blocking a tool stops its calls in this organization until you unblock it. Connecting the same tool again does not lift the block ."
5355 action = { < ForwardPagination nextCursor = { nextCursor } cursorParam = { cursorParam } /> }
5456 />
55- < Table >
57+ < Table showTopBorder = { false } >
5658 < TableHeader >
5759 < TableRow >
5860 < TableHeaderCell > Member</ TableHeaderCell >
5961 < TableHeaderCell > Client</ TableHeaderCell >
60- < TableHeaderCell > First connected</ TableHeaderCell >
6162 < TableHeaderCell > State</ TableHeaderCell >
6263 < TableHeaderCell hiddenLabel > Actions</ TableHeaderCell >
6364 </ TableRow >
@@ -72,7 +73,7 @@ export function McpAccessSection({
7273 />
7374 ) )
7475 ) : (
75- < TableBlankRow colSpan = { 5 } >
76+ < TableBlankRow colSpan = { 4 } >
7677 < Paragraph variant = "small" className = "py-4 text-center" >
7778 No members have connected an MCP client.
7879 </ Paragraph >
@@ -85,6 +86,22 @@ export function McpAccessSection({
8586 ) ;
8687}
8788
89+ function InfoTip ( { label, content } : { label : string ; content : ReactNode } ) {
90+ return (
91+ < SimpleTooltip
92+ tabbable
93+ asChild
94+ button = {
95+ < button type = "button" aria-label = { label } className = "h-fit" >
96+ < InformationCircleIcon className = "size-3.5 text-text-dimmed" />
97+ </ button >
98+ }
99+ content = { content }
100+ className = "max-w-lg"
101+ />
102+ ) ;
103+ }
104+
88105/** A heading inside a page section: one step below the section heading, above the rows. */
89106export function Subsection ( {
90107 title,
@@ -99,27 +116,17 @@ export function Subsection({
99116 action ?: ReactNode ;
100117} ) {
101118 return (
102- < div className = "flex w-full items-end justify-between gap-8 pb-2 pt-8" >
103- < div className = "space-y-0.5" >
104- < div className = "flex items-center gap-1.5" >
105- < Header3 > { title } </ Header3 >
106- { info && (
107- < SimpleTooltip
108- tabbable
109- asChild
110- button = {
111- < button type = "button" aria-label = { info } className = "h-fit" >
112- < InformationCircleIcon className = "size-3.5 text-text-dimmed" />
113- </ button >
114- }
115- content = { info }
116- />
117- ) }
118- </ div >
119- { description ? < SettingsRowDescription > { description } </ SettingsRowDescription > : null }
120- </ div >
121- { action ? < div className = "flex flex-none items-center" > { action } </ div > : null }
122- </ div >
119+ < SettingsHeader
120+ className = { SETTINGS_SECTION_GAP }
121+ title = {
122+ < span className = "flex items-center gap-1.5" >
123+ { title }
124+ { info && < InfoTip label = { info } content = { info } /> }
125+ </ span >
126+ }
127+ description = { description }
128+ action = { action }
129+ />
123130 ) ;
124131}
125132
@@ -137,17 +144,23 @@ function AllowMcpRow({
137144 const fetcher = useFetcher ( ) ;
138145 return (
139146 < SettingsRow
140- title = { ALLOW_MCP_TITLE }
141- description = {
147+ size = "sm"
148+ className = "min-h-16"
149+ title = {
142150 < >
143- When off, every call to the remote MCP server in this organization is refused. The local{ " " }
144- < InlineCode variant = "extra-small" > trigger mcp</ InlineCode > server uses the API with a
145- personal access token and is not affected.
151+ { ALLOW_MCP_TITLE }
152+ < InfoTip
153+ label = { ALLOW_MCP_TITLE }
154+ content = {
155+ "When off, every call to the remote MCP server in this organization is refused. The local trigger MCP server uses the API with a personal access token and is not affected."
156+ }
157+ />
146158 </ >
147159 }
148160 action = {
149161 < Switch
150- variant = "medium"
162+ variant = "minimal/medium"
163+ className = "cursor-pointer disabled:cursor-not-allowed"
151164 aria-label = { ALLOW_MCP_TITLE }
152165 checked = { enabled }
153166 disabled = { readOnly || fetcher . state !== "idle" }
@@ -163,6 +176,28 @@ function AllowMcpRow({
163176 ) ;
164177}
165178
179+ function ClientLabel ( {
180+ client,
181+ } : {
182+ client : { displayName : string | null ; selfReportedName : string | null } ;
183+ } ) {
184+ const { name, selfReported } = mcpClientName ( client ) ;
185+ return (
186+ < span className = "inline-flex min-w-0 items-center gap-1.5" >
187+ { name ? (
188+ < span className = "max-w-[16rem] truncate text-text-bright" title = { name } >
189+ { name }
190+ </ span >
191+ ) : (
192+ < span > Unnamed client</ span >
193+ ) }
194+ { selfReported ? (
195+ < InfoTip label = "Name provided by the client" content = "Name provided by the client" />
196+ ) : null }
197+ </ span >
198+ ) ;
199+ }
200+
166201function ConnectionRow ( { connection, readOnly } : { connection : Connection ; readOnly : boolean } ) {
167202 const { block } = connection ;
168203 return (
@@ -180,15 +215,19 @@ function ConnectionRow({ connection, readOnly }: { connection: Connection; readO
180215 ) }
181216 </ TableCell >
182217 < TableCell >
183- < McpClientName
184- client = { {
185- displayName : connection . clientDisplayName ,
186- selfReportedName : connection . clientSelfReportedName ,
187- } }
188- />
189- </ TableCell >
190- < TableCell >
191- { connection . firstConnectedAt ? < DateTime date = { connection . firstConnectedAt } /> : "–" }
218+ < span className = "flex flex-col" >
219+ < ClientLabel
220+ client = { {
221+ displayName : connection . clientDisplayName ,
222+ selfReportedName : connection . clientSelfReportedName ,
223+ } }
224+ />
225+ { connection . firstConnectedAt ? (
226+ < span className = "text-xs text-text-dimmed" >
227+ First connected < DateTime date = { connection . firstConnectedAt } includeTime = { false } />
228+ </ span >
229+ ) : null }
230+ </ span >
192231 </ TableCell >
193232 < TableCell >
194233 { block === null
@@ -197,7 +236,7 @@ function ConnectionRow({ connection, readOnly }: { connection: Connection; readO
197236 ? "Blocked for everyone"
198237 : "Blocked" }
199238 </ TableCell >
200- < TableCell alignment = "right" >
239+ < TableCell alignment = "right" className = "whitespace-nowrap" >
201240 { block === null ? (
202241 < IntentButton
203242 label = "Block"
0 commit comments