内容摘录
<div align="center">
<picture>
<source width="400" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/agentfront/frontmcp/refs/heads/main/docs/assets/logo/frontmcp.dark.svg">
<source width="400" media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/agentfront/frontmcp/refs/heads/main/docs/assets/logo/frontmcp.light.svg">
<img width="400" alt="FrontMCP Logo" src="https://raw.githubusercontent.com/agentfront/frontmcp/refs/heads/main/docs/assets/logo/frontmcp.light.svg">
</picture>
<hr>
**The TypeScript way to build MCP servers with decorators, DI, and Streamable HTTP.**
NPM - @frontmcp/sdk
Node
License
Snyk
[Docs][docs-home] • [Quickstart][docs-quickstart] • [API Reference][docs-sdk-ref] • Discord
</div>
---
FrontMCP is a **TypeScript-first framework** for the Model Context Protocol (MCP).
You write clean, typed code; FrontMCP handles the protocol, transport, DI, session/auth, and execution flow.
Installation
**Node.js 22+** required (24 recommended).
Full setup guide: [Installation][docs-install]
Capabilities
| Capability | Description | Docs |
| -------------------- | ------------------------------------------------------------------------------- | ------------------------------- |
| **@FrontMcp Server** | Decorator-configured server with info, apps, HTTP, logging, session, auth | [Server][docs-server] |
| **@App** | Organizational units grouping tools, resources, prompts with optional isolation | [Apps][docs-apps] |
| **@Tool** | Typed actions with Zod schemas — class or function style | [Tools][docs-tools] |
| **@Resource** | Read-only data exposure with static and template URIs | [Resources][docs-resources] |
| **@Prompt** | Reusable message templates returning GetPromptResult | [Prompts][docs-prompts] |
| **@Agent** | Orchestrated multi-step tool chains | [Agents][docs-agents] |
| **Elicitation** | Request structured user input mid-flow | [Elicitation][docs-elicitation] |
| **Skills** | HTTP-discoverable tool manifests for agent marketplaces | [Skills][docs-skills] |
| **Discovery** | Automatic capability advertisement for MCP clients | [Discovery][docs-discovery] |
| **Authentication** | Remote OAuth, Local OAuth, JWKS, DCR, per-app auth | [Authentication][docs-auth] |
| **Sessions** | Stateful/stateless session modes with JWT or UUID transport IDs | [Server][docs-server] |
| **Direct Client** | In-process create(), connect(), connectOpenAI(), connectClaude() | [Direct Client][docs-direct] |
| **Transport** | Streamable HTTP + SSE with session headers | [Transport][docs-transport] |
| **Ext-Apps** | Mount external MCP servers as sub-apps | [Ext-Apps][docs-ext-apps] |
| **Hooks** | 5 hook families: tool, list-tools, HTTP, resource, prompt | [Hooks][docs-hooks] |
| **Providers / DI** | Scoped dependency injection with GLOBAL and CONTEXT scopes | [Providers][docs-providers] |
| **Plugins** | Cache, Remember, CodeCall, Dashboard — or build your own | [Plugins][docs-plugins] |
| **Adapters** | Generate tools from OpenAPI specs | [Adapters][docs-adapters] |
| **Testing** | E2E fixtures, matchers, HTTP mocking for MCP servers | [Testing][docs-testing] |
| **UI Library** | HTML/React widgets, SSR, MCP Bridge, web components | [UI][docs-ui] |
| **CLI** | create, init, dev, build, inspector, doctor | [CLI][docs-install] |
| **Deployment** | Local dev, production builds, version alignment | [Deployment][docs-deploy] |
Packages
| Package | Description |
| ------------------------------------- | ------------------------------------------------------ |
| @frontmcp/sdk | Core framework — decorators, DI, flows, transport |
| @frontmcp/cli | CLI tooling (frontmcp create, dev, build) |
| @frontmcp/auth | Authentication, OAuth, JWKS, credential vault |
| @frontmcp/adapters | OpenAPI adapter for auto-generating tools |
| @frontmcp/plugins | Official plugins: Cache, Remember, CodeCall, Dashboard |
| @frontmcp/testing | E2E test framework with fixtures and matchers |
| @frontmcp/ui | React components, hooks, SSR renderers |
| @frontmcp/uipack | React-free themes, build tools, platform adapters |
| @frontmcp/di | Dependency injection container (internal) |
| @frontmcp/utils | Shared utilities — naming, URI, crypto, FS (internal) |
Version Alignment
Keep all @frontmcp/* packages on the same version. A clear **"version mismatch"** error is thrown at boot if versions drift. ([Production Build][docs-production])
Contributing
PRs welcome! See CONTRIBUTING.md for workflow, coding standards, and the PR checklist.
License
Apache-2.0
<!-- docs links -->
[docs-home]: https://docs.agentfront.dev/frontmcp 'FrontMCP Docs'
[docs-install]: https://docs.agentfront.dev/frontmcp/getting-started/installation 'Installation'
[docs-quickstart]: https://docs.agentfront.dev/frontmcp/getting-started/quickstart 'Quickstart'
[docs-sdk-ref]: https://docs.agentfront.dev/frontmcp/sdk-reference/overview 'SDK Reference'
[docs-server]: https://docs.agentfront.dev/frontmcp/servers/server 'The FrontMCP Server'
[docs-apps]: https://docs.agentfront.dev/frontmcp/servers/apps 'Apps'
[docs-tools]: https://docs.agentfront.dev/frontmcp/servers/tools 'Tools'
[docs-resources]: https://docs.agentfront.dev/frontmcp/servers/resources 'Resources'
[docs-prompts]: https://docs.agentfront.dev/frontmcp/servers/prompts 'Prompts'
[docs-agents]: https://docs.agentfront.dev/frontmcp/servers/agents 'Agents'
[docs-elicitation]: https://docs.agentfront.dev/frontmcp/servers/elicitation 'Elicitation'
[docs-skills]: https://docs.agentfront.dev/frontmcp/servers/skills 'Skills'
[docs-discovery]: https://docs.agentfront.dev/frontmcp/servers/discovery 'Discovery'
[docs-auth]: https://docs.agentfront.dev/frontmcp/authentication/overview 'Authentication'
[docs-direct]: https://docs.agentfront.dev/frontmcp/deployment/direct-client 'Direct Client'
[docs-transport]: https://docs.agentfront.dev/frontmcp/deployment/transport 'Transport'
[docs-ext-apps]: https://docs.agentfront.dev/frontmcp/…