Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt

Use this file to discover all available pages before exploring further.

FrontMCP uses TypeScript decorators as the primary API. Every component — servers, apps, tools, resources, prompts, agents, skills, providers, plugins, and flows — is defined with a decorator on a class or function.

Decorator Inventory

DecoratorPurposeBase Class
@FrontMcpServer entry point
@AppCapability container
@ToolAI-callable actionToolContext
@Resource / @ResourceTemplateData endpointResourceContext
@PromptMessage templatePromptContext
@AgentLLM-powered actorAgentContext
@SkillWorkflow guideSkillContext
@ProviderDI service
@PluginExtensionDynamicPlugin
@ChannelNotification streamChannelContext
@AdapterDynamic capabilitiesDynamicAdapter
@FlowLifecycle pipelineFlowBase

One Snippet Per Decorator

@FrontMcp — Server Entry Point

import 'reflect-metadata';
import { FrontMcp } from '@frontmcp/sdk';

@FrontMcp({
  info: { name: 'My Server', version: '1.0.0' },
  apps: [MyApp],
  http: { port: 3000 },
})
export default class Server {}

@App — Capability Container

import { App } from '@frontmcp/sdk';

@App({
  id: 'crm',
  name: 'CRM App',
  tools: [CreateLeadTool, GetContactsTool],
  resources: [LeadResource],
  prompts: [OutreachPrompt],
})
class CrmApp {}

@Tool — AI-Callable Action

@Tool({
  name: 'greet',
  description: 'Greets a user by name',
  inputSchema: { name: z.string() },
})
class GreetTool extends ToolContext {
  async execute({ name }: { name: string }) {
    return `Hello, ${name}!`;
  }
}

@Resource — Data Endpoint

@Resource({
  name: 'config',
  uri: 'config://app',
  mimeType: 'application/json',
})
class ConfigResource extends ResourceContext {
  async execute(uri: string) {
    return { contents: [{ uri, mimeType: 'application/json', text: '{}' }] };
  }
}

@Prompt — Message Template

@Prompt({
  name: 'summarize',
  arguments: [
    { name: 'topic', description: 'Topic to summarize', required: true },
  ],
})
class SummarizePrompt extends PromptContext {
  async execute(args: Record<string, string>): Promise<GetPromptResult> {
    return {
      messages: [{ role: 'user', content: { type: 'text', text: `Summarize: ${args.topic}` } }],
    };
  }
}

@Agent — LLM-Powered Actor

@Agent({
  name: 'researcher',
  description: 'Research agent that gathers information',
  llm: {
    provider: 'anthropic',
    model: 'claude-sonnet-4-20250514',
    apiKey: { env: 'ANTHROPIC_API_KEY' },
  },
  tools: [WebSearchTool, SummarizeTool],
  systemInstructions: 'You are a thorough research assistant.',
})
class ResearcherAgent extends AgentContext {
  async execute(input: unknown) { /* ... */ }
}

@Skill — Workflow Guide

@Skill({
  name: 'review-pr',
  description: 'Review a GitHub pull request',
  instructions: `## Steps\n1. Fetch PR details\n2. Review files\n3. Submit review`,
  tools: [
    { name: 'github_get_pr', purpose: 'Fetch PR metadata', required: true },
    { name: 'github_submit_review', purpose: 'Submit review verdict' },
  ],
})
class ReviewPRSkill extends SkillContext {}

@Provider — DI Service

import { Provider, ProviderScope } from '@frontmcp/sdk';

@Provider({ name: 'DatabaseProvider', scope: ProviderScope.GLOBAL })
export class DatabaseProvider {
  async query(sql: string) { /* ... */ }
}

@Plugin — Extension

import { Plugin, DynamicPlugin } from '@frontmcp/sdk';

interface AuditOptions { destination: string }

@Plugin({ name: 'audit', description: 'Audit logging plugin' })
export default class AuditPlugin extends DynamicPlugin<AuditOptions> {
  constructor(private readonly options: AuditOptions) {
    super();
  }
}

// Usage: register via the static init() method
@FrontMcp({
  info: { name: 'Server', version: '1.0.0' },
  apps: [MyApp],
  plugins: [AuditPlugin.init({ destination: 's3://logs' })],
})
class Server {}

@Flow — Lifecycle Pipeline

@Flow({
  name: 'tools:call-tool',
  plan: {
    pre: ['parseInput', 'authorize'],
    execute: ['runTool'],
    post: ['validateOutput'],
    finalize: ['respond'],
  },
  inputSchema: callToolInputSchema,
  outputSchema: callToolOutputSchema,
  access: 'authorized',
})
class CallToolFlow extends FlowBase<'tools:call-tool'> {
  @Stage('parseInput')     async parseInput() { /* validate */ }
  @Stage('authorize')      async authorize() { /* check access */ }
  @Stage('runTool')        async runTool() { /* execute */ }
  @Stage('validateOutput') async validateOutput() { /* validate output */ }
  @Stage('respond')        async respond() { /* respond */ }
}

Learn More

Decorator Reference

Complete API reference for every decorator

Context Classes

Base classes that provide DI, logging, and auth