When you build a product on Ferrite, the same Rust application can serve a browser interface and act as a remote MCP connector inside Claude (claude.ai, Claude desktop, Claude mobile, Cowork, and Claude Code). You declare your operations once with agent-ready, protect user accounts with your own isolated OAuth 2.1 issuer via poppy-oauth, and optionally accept enterprise Auto-connect assertions so corporate customers can roll your app out to every employee in one click.
This guide is for builders shipping consumer or B2B SaaS products that connect directly to Claude. If you are deploying internal company tools for your own team, see Internal company apps in Claude.
Start from one operation declaration
Create a Ferrite web application and add the agent-ready package:
ferrite new webapp studio --with-tests
cd studio
ferrite add agent-ready
Expose your /mcp endpoint alongside your discovery files in ferrite.json above the static / route:
{ "prefix": "/mcp", "binding": "requests", "kind": "api", "public": true },
{ "prefix": "/openapi.json", "binding": "requests", "kind": "api", "public": true },
{ "prefix": "/llms.txt", "binding": "requests", "kind": "api", "public": true },
{ "prefix": "/.well-known/", "binding": "requests", "kind": "api", "public": true },
{ "prefix": "/", "binding": "content", "kind": "content", "public": true }
Declare each operation once in your Surface definition (see Build for agents for the full walkthrough). agent-ready projects those operations into /mcp, /openapi.json, /llms.txt, and Markdown twins from one source of truth, so browser clicks and Claude tool calls run the same Rust handler, atomic transactions, and authorization checks.
Design your MCP surface for Claude
Claude evaluates remote connectors on discovery behavior, tool clarity, and prompt safety before listing or connecting them:
- Challenge unauthenticated
/mcprequests with401and RFC 9728 metadata. When an app requires user authentication, return401 UnauthorizedwithWWW-Authenticate: Bearer resource_metadata="https://<your-host>/.well-known/oauth-protected-resource/mcp"on the very first unauthenticated request (includinginitializeandtools/list). That guarantees custom connectors in claude.ai, Pi, OpenCode, Cursor, Codex, and Claude Code all trigger browser OAuth or Auto-connect automatically with zero manual settings. (Only return200 OKanonymously ontools/listif your server intentionally serves unauthenticated public tools.) - Set all four MCP tool annotations. Every tool in
tools/listshould declare explicit boolean values forreadOnlyHint,destructiveHint,idempotentHint, andopenWorldHint, plus a clear stringdescriptionon every parameter ininputSchema.properties. Claude uses these hints to decide which reads can run without interrupting the user and which writes require confirmation. - Keep tool catalogs focused. A compact, task-oriented set of tools uses far less context window than mirroring every low-level REST endpoint. For rich interactive flows (dashboards, forms, bookings, or visual pickers inside the Claude chat pane), return interactive HTML resources using MCP Apps.
- Require confirmation on consequential writes. Use idempotency keys and Ask before acting or exact-terms confirmation so retries never duplicate a payment, booking, or deletion.
Add isolated per-app sign-in for consumers and teams
Every Ferrite application keeps its own OAuth 2.1 issuer so user grants never cross between applications. Add poppy-oauth to run an isolated OAuth 2.1 server directly inside your application:
ferrite add poppy-oauth
Configure OAuthServerConfig::from_poppy(...) with your canonical origin, resource URLs, and declared scopes (see Per-app OAuth (Poppy) for the full setup). poppy-oauth provides:
- RFC 9728 Protected Resource Metadata at
/.well-known/oauth-protected-resource/mcp - RFC 8414 Authorization Server Metadata at
/.well-known/oauth-authorization-server - PKCE
S256, Client ID Metadata Documents (CIMD),private_key_jwt, RFC 8707resourcebinding, RFC 9207issin authorization responses, rotating refresh tokens, and RFC 7009 revocation
With this in place, any Claude consumer (Free, Pro, Max, or Ultra) signs in to your app once on claude.ai and stays connected across web, desktop, mobile, and Claude Code.
Enable zero-friction Auto-connect for enterprise customers
When a company on a Claude Team or Enterprise plan adopts your SaaS app, their administrator does not want every employee to click through an individual OAuth consent screen. Add Enterprise Managed Authorization (ID-JAG, urn:ietf:params:oauth:grant-type:jwt-bearer) to your poppy-oauth server with handle_token_with_enterprise:
let cfg = cfg.with_enterprise(vec![
TrustedIdp::new(
"https://identity.anthropic.com/issuers/<customer-org-id>",
keys,
vec![
"https://claude.ai/oauth/mcp-oauth-client-metadata".to_string(),
"https://claude.ai/oauth/mcp-oauth-client-metadata/confidential_client".to_string(),
],
vec!["app:read".to_string(), "app:write".to_string()],
)
.with_tenant("<customer-tenant-id>"),
]);
You can trust either Claude as the issuer (https://identity.anthropic.com/issuers/<org-id>, requiring no external IdP at the customer) or a customer’s Okta issuer via Cross-App Access (XAA). Keep these identity rules strict in your subject resolver:
- Match returning users by
(iss, sub)(andaud_tenantwhen set) because Okta XAA assertions can omit theemailclaim. - Match by
emailonly when your application has verified the customer’s corporate domain or pre-invited that address; never trust an unverified email or auto-provision accounts on consumer free-mail domains. - Return
Nonefor anyone outside the customer’s workspace sopoppy-oauthrefuses the grant without creating an account.
See Enterprise-managed authorization for the complete verification rules and client exchange helpers.
Security boundaries and economics
Your Claude connector runs inside the same compiled Rust process and ferrite.json capability envelope as your web app:
- Declared egress only. External API calls and IdP JWKS fetches must appear as explicit HTTPS prefixes in
ferrite.json; undeclared hosts are blocked at the gateway. - Write-only secrets. OAuth signing keys and third-party API credentials are stored write-only and never exposed in environment variables or source bundles. See Secrets & Egress.
- Bounded prepaid hosting. Ferrite charges metered prepaid compute, storage, and requests with no per-seat fee; a small always-on application costs about $8 a month, with hard account spend caps and per-service memory and CPU ceilings.
Next steps
- Internal company apps in Claude to deploy private company tools through
Ferrite Appswithout building per-app OAuth. - Enterprise-managed authorization for the ID-JAG token validation rules and
poppy-oauthintegration. - MCP Apps to render interactive UI directly inside Claude conversations.
- Build for agents for the full
agent-readywalkthrough.