Sandbox
@agentfront/frontmcp

TypeScript MCP server framework for Claude Code and agents

FrontMCP is a TypeScript framework for building MCP servers with decorators, typed tools, resources, prompts, and agent flows. It includes protocol handling, transport, DI, auth, sessions, and a CLI, so one codebase can run locally and deploy unchanged.

146 stars6 forksTypeScriptUpdated 7d ago
Who it's for

Builders who want to write MCP servers in typed TypeScript and ship them to local or production runtimes.

What it delivers

You can build and deploy a typed MCP server without wiring the protocol, transport, auth, and session machinery by hand.

What it does

Typed decorators and schemas

Use `@FrontMcp`, `@App`, `@Tool`, `@Resource`, `@Prompt`, and `@Agent` with Zod schemas for typed inputs and outputs.

Built-in auth and sessions

Includes OAuth, JWKS, DCR, per-app auth, and stateful or stateless sessions.

Multiple transports and deployments

Supports Streamable HTTP and SSE, and can run on Node, Vercel, AWS Lambda, Cloudflare Workers, or a serverless bundle.

CLI workflow

Provides `create`, `init`, `dev`, `build`, `inspect`, and `doctor` commands.

Official plugins and adapters

Adds cache, remember, approval, codecall, dashboard, feature flags, skilled-openapi, and OpenAPI tool generation.

Testing and observability

Includes an E2E testing framework and observability helpers for logging, metrics, and tracing.

How to get it

  1. 1Node.js 24+ required.
    # New project (recommended)
    npx frontmcp create my-app
    
    # Existing project
    npm i -D frontmcp @types/node@^24
    npx frontmcp init

README

FrontMCP LogoFrontMCP Logo

The production-grade, TypeScript-first framework for building MCP servers — decorators, DI, auth, and Streamable HTTP, batteries included.

NPM - @frontmcp/sdk Node License Snyk

DocsQuickstartAPI ReferenceDiscord


FrontMCP turns the Model Context Protocol into a typed, declarative framework. You write clean @Tool, @Resource, and @App classes; FrontMCP handles the protocol, transport, dependency injection, sessions, auth, and execution flow — and the same server runs locally and ships to production unchanged.

import 'reflect-metadata';

import { FrontMcp, LogLevel } from '@frontmcp/sdk';

import HelloApp from './hello.app';

@FrontMcp({
  info: { name: 'Demo', version: '0.1.0' },
  apps: [HelloApp],
  http: { port: 3000 },
  logging: { level: LogLevel.Info },
})
export default class Server {}

Why FrontMCP

  • Typed by default — decorators + Zod schemas give end-to-end types from input to output, with editor autocomplete and compile-time checks.
  • Batteries included — auth (OAuth/JWKS/DCR), sessions, transport, discovery, and DI are built in, not bolted on.
  • Ship anywhere — one codebase deploys to Node, Vercel, AWS Lambda, Cloudflare Workers, or a serverless bundle.
  • Production-minded — stateful/stateless sessions, high-availability transport, structured observability, and a 95%+ tested core.
  • Extensible — plugins, lifecycle hooks, OpenAPI adapters, and external MCP sub-apps when you outgrow the defaults.

Installation

Node.js 24+ required.

# New project (recommended)
npx frontmcp create my-app

# Existing project
npm i -D frontmcp @types/node@^24
npx frontmcp init

Full setup guide: Installation · Quickstart

Capabilities

Build — decorator-configured @FrontMcp server and @App domains; typed @Tool, @Resource, and @Prompt primitives; @Agent multi-step chains; and scoped Providers / DI.

SecureRemote & Local OAuth, JWKS, DCR, per-app auth with stateful / stateless sessions (JWT or UUID transport IDs).

Connect & operateStreamable HTTP + SSE transport, every MCP protocol revision from 2024-11-05 through 2026-07-28 on one endpoint, capability discovery, elicitation, hooks, HTTP-discoverable skills, tool UI / MCP Apps, an in-process Direct Client (connectOpenAI / connectClaude), and first-class deployment.

Extend & tooling — official plugins (Cache, Remember, CodeCall, Dashboard), the OpenAPI adapter, a UI library (HTML/React widgets, SSR, MCP Bridge), an E2E testing framework, and a CLI (create, init, dev, build, inspect, doctor).

→ Full reference: docs.agentfront.dev/frontmcp

Packages

You install frontmcp (the CLI) and @frontmcp/sdk. Everything else is either pulled in for you or opt-in.

Core

PackageDescription
frontmcpThe CLI — create, init, dev, build, inspect, doctor
@frontmcp/sdkCore framework — decorators, DI, flows, transport, MCP protocol
@frontmcp/authAuthentication, OAuth, JWKS, DCR/CIMD, credential vault
@frontmcp/testingE2E test framework with fixtures and matchers

Extend

PackageDescription
@frontmcp/pluginsPlugin authoring toolkit + official plugin re-exports
@frontmcp/adaptersOpenAPI adapter — generate tools from an OpenAPI spec
@frontmcp/skillsCurated SKILL.md catalog for scaffolding and skills install
@frontmcp/guardPolicy/guard rules for tool inputs and outputs
@frontmcp/observabilityStructured logging, metrics, and tracing helpers

UI

PackageDescription
@frontmcp/reactReact hooks + client for talking to a FrontMCP server
@frontmcp/uiReact components, SSR renderers, MCP Bridge
@frontmcp/uipackReact-free themes, build tools, platform adapters

Runtime & storage

PackageDescription
@frontmcp/edgeRun a server on Cloudflare Workers / V8 isolates from a config
@frontmcp/storage-sqliteSQLite-backed session, task, and elicitation stores
@frontmcp/nxNx generators and executors for FrontMCP workspaces

Internal

Published so the packages above resolve, but not intended for direct use:

PackageDescription
@frontmcp/protocolThe single boundary to the upstream MCP SDK — protocol types
@frontmcp/diDependency injection container
@frontmcp/utilsShared utilities — naming, URI, crypto, FS
@frontmcp/lazy-zodLazily-loaded Zod wrapper that keeps cold starts small

Official plugins

PackageDescription
@frontmcp/plugin-cacheCache tool results with a TTL
@frontmcp/plugin-rememberPer-session memory (this.remember)
@frontmcp/plugin-approvalHuman approval gates before a tool runs
@frontmcp/plugin-codecallLet the model compose tool calls as code
@frontmcp/plugin-dashboardBuilt-in web dashboard
@frontmcp/plugin-feature-flagsToggle tools and apps at runtime
@frontmcp/plugin-skilled-openapiOpenAPI → skills + meta-tools for large APIs

Version Alignment

Keep all @frontmcp/* packages on the same version. A clear "version mismatch" error is thrown at boot if versions drift. (Production Build)

Contributing

PRs welcome! See CONTRIBUTING.md for workflow, coding standards, and the PR checklist.

License

Apache-2.0

Files in the repo

Repository payload43 top-level entries
  • .claude
  • .github
  • .husky
  • .verdaccio
  • .vscode
  • apps
  • docs
  • libs
  • plugins
  • scripts
  • types
  • .coderabbit.yaml
  • .editorconfig
  • .gitignore
  • .nvmrc
  • .nycrc.json
  • .prettierignore
  • .prettierrc
  • .release-docs-base
  • .snyk
  • .yarnrc.yml
  • AGENTS.md
  • BREAKING_CHANGES.v1.md
  • breaking-changes.v1.json
  • CLAUDE.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • eslint.config.mjs
  • eslint.imports.mjs
  • jest.config.ts
  • jest.coverage.preset.js
  • jest.e2e.coverage.preset.js
  • jest.imports-mapper.js
  • jest.preset.js
  • LICENSE
  • nx.json
  • package.json
  • project.json
  • README.md
  • SECURITY.md
  • TEST_COVERAGE.md
  • tsconfig.base.json
  • yarn.lock

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More frameworks & sdks

HKUDS/nanobotFrameworks & SDKs

Ultra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps

48k
microsoft/
SkillOpt
microsoft/SkillOptFrameworks & SDKs

SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

17k
omnigent-ai/omnigentFrameworks & SDKs

Omnigent is an open-source AI agent framework and meta-harness: orchestrate Claude Code, Codex, Cursor, Pi, and custom agents — swap harnesses without rewriting, enforce policies and sandboxing, and collaborate in real time from any device.

9.8k
kyegomez/
OpenMythos
kyegomez/OpenMythosFrameworks & SDKs

A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.

15k
D4Vinci/ScraplingFrameworks & SDKs

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

80k