Authorization for Hosted Servers
Introducing TollBit Tokens
We’re excited to announce a preview of TollbitTokens, an authorization system for your MCP servers to authorize and block incoming traffic.
When a user makes a tool call through TollBit’s MCP server, we will generate a signed JWT that contains the user’s identity and the tool they are calling.
This JWT is then sent to your MCP server in the Authorization
header under _meta
in the ToolCall to your own MCP server.
The token gives you the ability to:
-
Reject traffic from sources outside of TollBit. For paid servers + tools, you can rely on this signed JWT to ensure that an exchange of payment has been done.
-
Identify which users are calling your tools. The JWT contains the user’s TollBit ID, which you can use for a variety of reasons. Some may include: track sessions to a given user, implement your own rate limiting, or general insights into who is using your server and how often.
Format for the TollBit token
The TollBit token is a signed JWT that contains the following claims:
iss
: The issuer of the token, which is alwayshttps://gateway.tollbit.com/foundry
.sub
: The subject of the token, which is the user’s TollBit ID.aud
: The audience of the token, which is the host of your MCP server.iat
: The issued at time, which is the time the token was issued.nbf
: The not before time, which is set to 1 minute before theiat
time to prevent replay attacks.exp
: The expiration time, which is set to 5 minutes after theiat
time.jti
: A unique identifier for the token, which is the transaction ID of the tool call. You can cross reference this transaction ID in your dashboard. This should be treated as a nonce to prevent replay attacks.
The public key for the signature is available at https://oauth.tollbit.com/.well-known/jwks.json with the key id mcp_key_01
, though this may change in the future.
We recommend that you can use the kid
header in the JWT to determine which key to use for verification.
Many JWT libraries will handle this automatically, but if you are using a lower-level library, you may need to implement this yourself.
Example of a TollBit token
You can plug this into jwt.io to see the decoded claims and verify the signature.
To verify the signature, you can use the public key available at https://oauth.tollbit.com/.well-known/jwks.json with the key id mcp_key_01
.
At the time of posting this, it should be: