If you want to enforce permissions per user in your custom MCP Server, you have to use OAuth. This can be done for example by using SSO (single sign on) with Google, Azure or Peliqan OAuth.

If you want to build a custom MCP Server without OAuth (using an API key instead), click here.

Contents

How to build a Custom MCP Server on Peliqan with SSO using OAuth

Setup the API handler script in Peliqan

Use the following API handler script template in Peliqan:

Update the settings in this Python script:

Grant permissions based on SSO group memberships

The above template maps individual users from the SSO to Peliqan API keys. You can also grant permissions based on the groups that the user belongs to, e.g. groups in Azure Entra Id. Here’s some example code on how to do that:

Setup API endpoints in Peliqan

Add two API endpoints and link them both to the above API handler script: