Skip to main content

Import

import {
  createMCPServer,
  registerTool,
  registerPrompt,
  registerResource,
  clearMCPRegistry,
  getMCPRegistry,
} from "veryfront/mcp";

Examples

import { createMCPServer } from "veryfront/mcp";
import { tool } from "veryfront/tool";
import { z } from "zod";

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

// Start MCP server. Registered tools are exposed automatically.
const server = createMCPServer();

API

createMCPServer(config)

Create MCP server Returns: MCPServer

Exports

Functions

NameDescription
clearMCPRegistryClear all registries
createMCPServerCreate MCP server
getMCPRegistryGet tool/prompt/resource registry
getMCPStatsGet registered capability stats
registerPromptRegister prompt with MCP
registerResourceRegister resource with MCP
registerToolRegister tool with MCP

Classes

NameDescription
MCPServerMCP server instance

Types

NameDescription
IntegrationLoaderConfigConfiguration for loading integration tools into MCP
MCPServerConfigcreateMCPServer() config
MCPStatsRegistry statistics
MCPToolGeneric MCP tool definition