Skip to main content
This example is a copyable, runnable project for a small team. It keeps the endpoint on localhost, authenticates two users with Fentaris-managed API keys, filters tools by group policy, connects a public remote MCP server, and exposes app-owned tools through a local namespace. The complete source lives in examples/team-governed-proxy.

Architecture

Project files

src/index.ts

app.mcp(...) or constructor-time mcp(...) declares an upstream server. app.local(...) declares app-owned MCP capabilities. Both use the same policy namespace and client-visible <namespace>__<tool> naming.

fentaris.json

Package scripts

Secrets manifest

The example has no upstream credential, so its committed manifest is empty:
API-key hashes are stored separately in the encrypted local auth store. Commit the manifest; never commit .fentaris/credentials.enc.json. credentialJson(...) references API-key material in that encrypted auth store, not upstream secrets scanned into the manifest. The committed empty manifest is expected here: fentaris auth api-key add does not add credentialJson paths to secrets.manifest.json, so a later static fentaris doctor may warn that stored API-key hashes are “not listed in the secrets manifest”. That warning is unrelated to this example’s empty upstream-secret manifest.

Install and validate

Expected successful checks:

Provision local API keys

Let the CLI create a random project-local encryption key in the ignored .env on the first credential write. Agents must leave the client API-key values to the user.
Save each printed client key once. Fentaris stores only its hash, and clients send the raw value in x-fentaris-api-key.

Start and test

Expected startup:
Run the authenticated curl sequence from the example README, or connect MCP Inspector and set the x-fentaris-api-key header. Expected behavior:
  • A reader sees and can call workspace__status.
  • A reader does not see workspace__release_notes.
  • A direct reader call to workspace__release_notes returns a policy denial.
  • A maintainer sees and can call both local tools.
  • specification__* tools are visible when the public upstream is reachable.

Runtime validation

With the proxy running, export the same client API key used for the curl tests so doctor can send x-fentaris-api-key:
Expected result:

Security boundaries

  • The endpoint remains bound to 127.0.0.1.
  • Raw API keys and FENTARIS_AUTH_KEY never appear in source or logs.
  • Policy filters both discovery and execution.
  • JSON logging records subject and group tags, not credential values.
  • Add explicit network and deployment controls before exposing the endpoint to other machines.