Route Hugging Face MCP traffic through Formal to control and log what AI agents do in Hugging Face:
Under OAuth app, choose one of the two options.
The rule matches known agents only.
See Identity headers.Cloud agents such as Claude, ChatGPT and Cursor Cloud Agents don’t run the Endpoint.
Point them at this server’s Connector address,
- Block tools you don’t want agents to call, such as
dataset_search. - Mask sensitive data in tool results, such as emails and phone numbers in
model_searchresponses. - Keep credentials at the Connector, so users and agents never see Hugging Face tokens.
- Log every tool call with the user, the MCP client and its parameters.
0. Prepare your Connector
The Connector needs an MCP listener and a hostname with wildcard DNS and TLS. Set them up once by following Deploy the Connector. Every MCP server reuses them.1. Add Hugging Face MCP server to your Resources
- UI
- Terraform
- Pulumi
- API
- Open the Admin Catalog and click Add MCP.
- Select the Hugging Face template.
- Enter a DNS-label Name, such as
hugging-face. - Choose the Space containing your Connector, such as
default. - Configure upstream authentication as described below, then save.
No Connector is in this server's Space.2. Setup Authentication
- Linked Accounts (Recommended)
- Pass Through
Each user links their own Hugging Face account once in the Employee Catalog, and the Connector sends that user’s token to Hugging Face.

1. Formal’s App (default)
Formal has a registered OAuth app with Hugging Face, so you register nothing. Users see Formal on Hugging Face’s consent screen.2. Your OAuth App
Users see your app’s name on Hugging Face’s consent screen.Set up your own Hugging Face OAuth app
Set up your own Hugging Face OAuth app
See Hugging Face OAuth documentation and register an app.
1
Create an OAuth app
Open Connected Apps settings to create a new OAuth app. Enter a name for it.
2
Add the redirect URI
Paste Formal’s Redirect URI into the app’s redirect URIs field. It must match exactly.
3
Choose scopes
Select
openid, profile, and read-mcp. Add read-repos, jobs, contribute-repos, or inference-api only if your tools need them.4
Copy the credentials
Save the app, then copy its Client ID and Client secret. You can skip the client secret. Formal then authenticates with PKCE alone.
5
Enter the app in Formal
- UI
- Terraform
- Pulumi
- API
Back in the Admin Catalog, enter the Client ID and Client secret, then save.
Users then link their accounts on the Hugging Face server’s page in the Employee Catalog.

3. Route Endpoint traffic
Auth is managed at the Connector level when you use Linked Accounts or Shared Credentials, so the Endpoint needs to forward the MCP traffic to it. Laptops and VMs with the Formal Endpoint keep usinghttps://huggingface.co/mcp, and a network rule sends that traffic to the Connector.- UI
- Terraform
- Pulumi
- API
- Go to Network Rules and create a rule named
hugging-face-mcp. - Paste this expression, set the rule to Active, then save:
https://hugging-face.<connector-hostname>/mcp.
Find it in the Admin Catalog: open Hugging Face, then copy Connector address on the Configuration tab.4. Create policies
Tools
The Admin Catalog lists these tools for Hugging Face:5. Check the logs
Open Logs and search forresource.name:hugging-face.
Each Hugging Face tool call is one request log with the user, the MCP client and the tool.
Open a log to see its tool parameters and the policies it triggered.See Logs for search syntax and filters.Troubleshooting
The agent says Formal has no current sign-in
The agent says Formal has no current sign-in
The agent relays:
Formal has no current hugging-face sign-in for you. Link or re-link your hugging-face account in Formal…Cause: The user never linked Hugging Face, or the token expired and couldn’t be refreshed.Fix: Open the server in the Employee Catalog and link Hugging Face again.The agent says Hugging Face rejected your credentials
The agent says Hugging Face rejected your credentials
The agent relays:
hugging-face rejected your credentials. Link or re-link your hugging-face account in Formal…Cause: Hugging Face no longer accepts the linked token, for example after the user revoked access in Hugging Face.Fix: Link Hugging Face again from the Employee Catalog.With Shared Credentials, the message asks the user to contact an administrator. Replace the token in the server’s Shared Credentials.Laptop traffic doesn't appear in Logs
Laptop traffic doesn't appear in Logs
Cause: The Endpoint isn’t running, or the network rule doesn’t match the client.Fix: Check the Endpoint is connected. The rule above only matches known agents. Other clients, such as a browser, reach Hugging Face directly unless the rule also matches them. See Network rules.
MCP clients can't connect directly yet
MCP clients can't connect directly yet
Cause: The Configuration tab lists the reason, most often
No Connector is in this server's Space.Fix: Edit the server and choose the Space containing its Connector.Next Steps
MCP Gateway
Configure Connector routing and downstream access
All MCP servers
Browse every MCP server template

