MCPNEW
McpConsentDialog
OAuth consent UI: scope list, approve/deny.
Available in
reactangularvuePreview
Live previewreal component
Install
TerminalBash
npx mcp-elements add mcp-consent-dialogUsage
mcp-consent-dialog-example.tsxTSX
import { McpConsentDialog } from '@mcp-elements/react'
import { useState } from 'react'
export function Example() {
const [open, setOpen] = useState(true)
return (
<McpConsentDialog
open={open}
serverName="GitHub MCP"
scopes={['repo:read', 'user.email:read']}
onApprove={() => setOpen(false)}
onDeny={() => setOpen(false)}
/>
)
}mcp-consent-dialog.component.tsTS
import { Component, signal } from '@angular/core'
import { McpeMcpConsentDialogComponent } from '@mcp-elements/angular'
@Component({
selector: 'app-consent-dialog-example',
standalone: true,
imports: [McpeMcpConsentDialogComponent],
template: `
<mcpe-mcp-consent-dialog
[open]="open()"
serverName="GitHub MCP"
[scopes]="['repo:read', 'user.email:read']"
(onApprove)="open.set(false)"
(onDeny)="open.set(false)"
/>
`,
})
export class ConsentDialogExampleComponent {
open = signal(true)
}mcp-consent-dialog.vueVue
<script setup lang="ts">
import { ref } from 'vue'
import { McpeMcpConsentDialog } from '@mcp-elements/vue'
const open = ref(true)
</script>
<template>
<McpeMcpConsentDialog
:open="open"
server-name="GitHub MCP"
:scopes="['repo:read', 'user.email:read']"
@approve="open = false"
@deny="open = false"
/>
</template>Props
| Prop | Type | Default | Description |
|---|---|---|---|
open * | boolean | — | Whether the dialog is visible |
serverName * | string | — | Name of the MCP server requesting access |
serverIcon | string | — | URL of the server icon image |
scopes * | string[] | — | Array of OAuth scope strings to display |
onApprove * | () => void | — | Called when user clicks Allow |
onDeny * | () => void | — | Called when user clicks Deny or closes the dialog |