veryfront/mcp

Import

ts
import {
  buildFormElicitation,
  buildUrlElicitation,
  createMCPServer,
  registerPrompt,
  registerResource,
  registerTool,
} from "veryfront/mcp";

Examples

ts
import { createMCPServer } from "veryfront/mcp";
import { tool } from "veryfront/tool";
import { defineSchema } from "veryfront/schemas";

// Tools auto-register with MCP when defined
tool({
  id: "search",
  description: "Search docs",
  inputSchema: defineSchema((v) => v.object({ query: v.string() }))(),
  execute: async ({ query }) => ({ results: [] }),
});

// Start MCP server - registered tools are exposed automatically.
// `auth` is required: use bearer for production, or the explicit
// `{ type: "none", allowUnauthenticated: true }` opt-in for local dev only.
const server = createMCPServer({
  enabled: true,
  auth: { type: "none", allowUnauthenticated: true },
});

API

createMCPServer(config)

Create mcpserver.

Returns: MCPServer

Exports

Functions

NameDescriptionSource
buildFormElicitationBuilds form elicitation.source
buildUrlElicitationBuilds URL elicitation.source
clearMCPRegistryClear MCP registry.source
createMCPServerCreate mcpserver.source
formatSSEEventStateless SSE formatting utilities per the Server-Sent Events standard. Used by the Streamable HTTP transport for MCP.source
formatSSEPrimingEventFormat an SSE priming event.source
formatSSERetryFormats sseretry.source
getMCPRegistryReturn MCP registry.source
getMCPStatsReturn MCP stats.source
registerPromptRegisters prompt.source
registerResourceRegisters a schema-backed resource. MCP reads decode URI captures exactly once before validation; mcp.enabled: false hides list and read access.source
registerToolRegisters tool.source

Classes

NameDescriptionSource
MCPServerImplement mcpserver.source
SessionManagersource
TaskStoreImplement task store.source

Types

NameDescriptionSource
ElicitationRequestRequest payload for elicitation.source
FormElicitationOptionsOptions accepted by form elicitation.source
MCPServerConfigConfiguration used by mcpserver.source
MCPStatsPublic API contract for MCP stats.source
MCPToolGeneric MCP tool definitionsource
TaskPublic API contract for task.source
ToolAnnotationsBehavioral hints for MCP clients (MCP 2025-11-25). Guides auto-approval, confirmation prompts, and caching.source
ToolListEntryWire format for a single tool in a tools/list response.source
UrlElicitationOptionsOptions accepted by URL elicitation.source