fentaris() as the app boundary, declare upstream MCP servers with high-level helpers, and keep local endpoint defaults in fentaris.json.
Prerequisites
- Node.js 20+ (LTS recommended)
- pnpm or npm
Quick Start
fentaris.json at the project root:
src/index.ts:
app.start() reads port and path from the nearest fentaris.json when they are not passed explicitly. With the config above, the proxy listens at http://localhost:4000/mcp.
Add a Second Server
Register each upstream MCP server with its ownapp.server(...) call:
app.server(...) is an alias for app.mcp(...). Use app.server(...) when the page is explaining upstream server registration, and use policy APIs for access control.Add Middleware
Strict TypeScript Example
In strict TypeScript projects, annotate exported middleware and policies at the boundary and let callback parameters infer from Fentaris:type Middleware for shared middleware functions. Inline app.use(async (ctx, next) => ...) callbacks also infer contextual ctx and next types.
The declarative fentaris({ ... }) form keeps group credentials next to the users and policy that own them. Use incremental calls such as app.server(...), app.policy(...), and app.group(...) when the app does not need to declare group- or user-scoped credential sources.
app.group("maintainers").mcp("github") returns a scoped middleware and event handle for an already declared server. It does not register an upstream transport or group credentials.Connect an MCP Client
Point your MCP client to the endpoint fromfentaris.json:
Verify Available Tools
If you are working in Node, you can list tools directly:Low-Level API
The class constructors are still available for advanced cases that need explicit object construction:fentaris(), app.server(...), and stdio(...).