page.tsx33 lines · main
| 1 | import { apiJson } from '../../../../../../lib/api'; |
| 2 | import { apiOrigin } from '../../../../../../lib/env'; |
| 3 | import { McpAccessPanel, type ProjectMcpStatus } from './mcp-access-panel'; |
| 4 | |
| 5 | export const metadata = { title: 'agent access' }; |
| 6 | export const dynamic = 'force-dynamic'; |
| 7 | |
| 8 | const FALLBACK: ProjectMcpStatus = { |
| 9 | globalEnabled: false, |
| 10 | planTier: 'free', |
| 11 | eligible: false, |
| 12 | mcpEnabled: false, |
| 13 | keys: [], |
| 14 | }; |
| 15 | |
| 16 | export default async function ProjectMcpPage({ params }: { params: Promise<{ id: string }> }) { |
| 17 | const { id } = await params; |
| 18 | const status = await apiJson<ProjectMcpStatus>(`/v1/projects/${id}/mcp`).catch(() => FALLBACK); |
| 19 | |
| 20 | return ( |
| 21 | <section className="flex flex-col gap-6"> |
| 22 | <header> |
| 23 | <h2 className="font-mono text-lg tracking-tight">agent access</h2> |
| 24 | <p className="mt-1 max-w-prose font-mono text-xs text-[var(--color-text-muted)]"> |
| 25 | let AI agents and MCP clients reach this project through the briven MCP server. turn it |
| 26 | on, then issue scoped keys for each agent. you can revoke a key any time. |
| 27 | </p> |
| 28 | </header> |
| 29 | |
| 30 | <McpAccessPanel apiOrigin={apiOrigin} projectId={id} initial={status} /> |
| 31 | </section> |
| 32 | ); |
| 33 | } |