astralyxdev

MCP Elicitation

AI chats

About

A dialog that renders a server's mid-run request for structured input (an MCP elicitation), naming the requesting server outside its own message, building a live JSON-schema form for the reply, and refusing to render any field that looks like a credential.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds MCP Elicitation to your project and fits it to your theme.

Code

How MCP Elicitation is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { McpElicitation } from "@/components/ui/mcp-elicitation";

const ELICIT_SCHEMA = {
  type: "object",
  required: ["environment"],
  properties: {
    environment: {
      type: "string",
      enum: ["staging", "production"],
      description: "Which database to migrate.",
    },
    confirm_backup: {
      type: "boolean",
      description: "A backup was taken in the last hour.",
    },
    api_key: {
      type: "string",
      description: "Needed to authenticate the migration.",
    },
  },
};

export default function McpElicitationDemo() {
  return (
    <div className="w-full max-w-lg">
      <McpElicitation
        server="postgres"
        message="Before running the migration I need to know which environment to target."
        schema={ELICIT_SCHEMA}
        onSubmit={() => {}}
        onDecline={() => {}}
      />
    </div>
  );
}

Dependencies

More by astralyxdev

View all
  • Rate Limit Meter

    Rate Limit Meter

    18
  • Note Graph

    Note Graph

    14
  • Prompt Versions

    Prompt Versions

    7
  • Migration List

    Migration List

    7
  • IP Cluster

    IP Cluster

    7
  • Checkout Summary

    Checkout Summary

    7
  • Odds Display

    Odds Display

    5
  • Budget Guard

    Budget Guard

    5

More in AI chats

View all
  • AI Actions

    AI Actions

    319
  • Agent Chat

    Agent Chat

    17
  • System Message

    System Message

    54
  • Message Thread

    Message Thread

    35
  • Color Picker

    Color Picker

    81
  • AI Task List

    AI Task List

    160
  • Modal Card

    Modal Card

    101
  • Quota Banner

    Quota Banner

    21