Skip to content

MCP & agent access control

This guide is for Sellers whose licensed offering is an MCP server, API or agent tool used through AI assistants and agent platforms.

Responsibility Your delivery system LicenChain
Authenticate the user (OAuth 2.1 / OIDC) ✅ Your own authorization server or identity provider —
Map a named user to a customer organization, product and seat assignment ✅ —
Record license terms, Buyer acceptance and issuance — ✅
Report whether the corporate license is currently valid — ✅ Verify API
Allow or deny each session or tool call ✅ —

LicenChain verifies the corporate license held by the Buyer organization. It is not an OAuth identity provider for AI assistants, does not issue user tokens, and is not an MCP host. An NFT or other blockchain record does not by itself enforce access; your delivery system does.

Authorization flow per session or tool call

Section titled “Authorization flow per session or tool call”
  1. Authenticate. The AI client presents an access token issued by your authorization server. Validate it as your MCP server’s OAuth guidance requires (issuer, audience, expiry, scopes).
  2. Resolve the user. Map the token subject to a customer organization, the licensed product and the user’s seat assignment in your own database.
  3. Look up the license. Find the licenceKey you stored from licence.issued for that organization and product.
  4. Verify. Call the verification API from your server — or reuse a short-lived positive result that has not passed validUntil.
  5. Decide. Allow only if steps 1–4 all succeed and valid === true. Otherwise return your normal authorization error to the client.
Terminal window
curl --request POST "$LICENCHAIN_API_BASE_URL/api/integrations/v1/licenses/verify" \
--header "Authorization: Bearer $LICENCHAIN_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"licenceKey": "11155111:0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:42"
}'
  • Make the verification call in server code that the model cannot influence. Do not let a tool argument choose the licenceKey; derive it from the authenticated user’s organization.
  • Fail closed. If verification is unavailable, deny new sessions and tool calls that need the license.
  • Return a generic, non-sensitive error to the agent (for example “License not active for your organization”) rather than raw API responses.
  • Re-check the license periodically for long-lived sessions instead of trusting the first result forever.
// Pseudocode for an MCP tool handler in your delivery system.
async function authorizeToolCall(accessToken: string): Promise<boolean> {
const user = await validateAccessToken(accessToken); // your OAuth / OIDC provider
if (!user) return false;
const assignment = await findSeatAssignment(user.id); // your database
if (!assignment) return false;
// Server-side LicenChain check on the corporate license (see Verify license).
return isLicenceValid(assignment.licenceKey);
}

validateAccessToken and findSeatAssignment are placeholders for your own identity and data layer. isLicenceValid is the helper from Verify license.