Skip to main content
Custom
Add any remote MCP server that isn’t in the Catalog, then route its traffic through Formal to control and log what AI agents do with it:
  • Block risky tools, such as delete_record.
  • Mask emails and phone numbers in search_records responses.
  • Keep credentials at the Connector, so users and agents never see them.
  • Log every tool call with the user, MCP client, and 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 your custom MCP server to your Resources

  1. Go to the Admin Catalog and click Add MCP.
  2. Click Add Custom.
  3. Paste https://mcp.internal.example.com/mcp into URL.
  4. Enter internal-tools in Name. Formal uses it as the server’s subdomain on the Connector.
  5. Choose the Space containing your Connector.
  6. Choose Authentication, then click Add to Catalog.
Use a valid DNS label with lowercase letters, digits, and hyphens. Names can contain up to 63 characters.

2. Setup Authentication

Choose which credential Formal sends to the server. See Upstream authentication for details.
Each user links their own OAuth account once. Formal stores the token encrypted and refreshes it when the server supports refresh. The Connector adds the token to requests after policies allow them. Users never see the token.Formal’s app uses an app registered with the provider, when available. Otherwise, it can use a Client ID Metadata Document (CIMD) when supported. For CIMD, the server’s authorization server must advertise client_id_metadata_document_supported: true. It must support authorization code with PKCE S256 and public clients with token endpoint authentication none.Formal checks the server when you save. If neither option works, register your own OAuth app with the provider. Add the Catalog’s Redirect URI to its allowed redirects. Then enter the app’s Client ID and optional Client secret.

3. Route Endpoint traffic

Auth is managed at the Connector with Linked Accounts or Shared Credentials. The Endpoint forwards MCP traffic to it. Laptops and VMs with the Formal Endpoint keep using https://mcp.internal.example.com/mcp. A network rule sends that traffic to the Connector.
  1. Go to Network Rules and create a rule named internal-tools-mcp.
  2. Paste this expression, set the rule to Active, then save:
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, https://internal-tools.<connector-hostname>/mcp. Find it in the Admin Catalog: open Internal Tools, then copy Connector address on Configuration.

4. Create policies

Use the tool names your MCP server exposes when you write policies.

Policies examples

This policy blocks tools that change data, so agents can only read Internal Tools.
See MCP resources for input.mcp fields and Rewrite Action for body rewrites.

5. Check the logs

Open Logs and search for resource.name:internal-tools. Each tool call is one request log with the user, MCP client, and tool. Open a log to see its tool parameters and the policies it triggered. A blocked write shows the block policy and its message. A masked search shows the rewrite policy.See Logs for search syntax and filters.

Troubleshooting

The agent says this server has no current sign-in. Link or re-link your account in Formal.Cause: You never linked an account, or its token expired and could not be refreshed.Fix: Open the server in the Employee Catalog and link your account again.
The agent says the server rejected your credentials. Link or re-link your account in Formal.Cause: The server no longer accepts the linked token, for example after access was revoked.Fix: Link your account again from the Employee Catalog.With Shared Credentials, replace the credential on the server’s Shared Credentials configuration.
Cause: The Endpoint isn’t running, or the network rule doesn’t match the client.Fix: Check that the Endpoint is connected. The rule only matches known agents. Other clients reach mcp.internal.example.com directly unless the rule also matches them. See Network rules.
Cause: The Configuration tab lists the reason, often No Connector is in this server's Space.Fix: Edit the server and choose the Space containing your Connector.
Cause: The server name isn’t a valid DNS label.Fix: Recreate the server with a valid DNS-label name.

Next Steps

MCP Gateway

Configure Connector routing and downstream access

All MCP servers

Browse every MCP server template