Skip to main content

MCPServerEditor

Monaco-based JSON editor with an overview panel. Includes auto-validation and a visual display of the parsed server card.

Live Demo

Loading demo...

Import

import { MCPServerEditor } from "@open-resource-discovery/mcp-server-card-ui/editor";
import "@open-resource-discovery/mcp-server-card-ui/styles";

Usage

function App() {
return (
<div style={{ height: "100vh" }}>
<MCPServerEditor
onServerCardChange={(json, parsed) => {
console.log("Card changed:", parsed);
}}
/>
</div>
);
}

Props

PropTypeDefaultDescription
initialServerCardstring-Initial server card JSON string
initialServerUrlstring-Initial MCP server URL
showSettingsbooleantrueShow the settings panel
showValidationbooleantrueShow the Validation tab
readOnlybooleanfalseMake the editor read-only
defaultTab"overview" | "validation""overview"Default tab to show
onServerCardChange(json: string, parsed: MCPServerCardDefinition | null) => void-Callback when server card changes
onValidationComplete(results: ValidationResult[]) => void-Callback when validation completes
classNamestring-Additional CSS class

When to Use

Use MCPServerEditor when:

  • You need a two-panel layout with Monaco editor and overview side-by-side
  • You want JSON editing with syntax highlighting and real-time validation
  • You don't need connection, function calling, or the settings panel

Bundle Size

Entry point: ~0.5 kB (gzip: ~0.3 kB)

Note: Monaco editor is loaded as a shared chunk.