Search

Connectors

Contact support

Helpdesk portal

Build a custom MCP Server on Peliqan with OAuth

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:

Click to expand script

Update the settings in this Python script:

  • Your Peliqan account id
  • Set the OAuth provider to use: Microsoft Azure, Google or Peliqan OAuth
  • Enter your Microsoft Azure tenant id or Google client id (if applicable)
  • Add user mappings: the key is the SSO user name or email, the value is the personal API key of the user in Peliqan (see User Settings > API keys)

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:

Click to expand script

Setup API endpoints in Peliqan

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

  • POST /mcp
  • GET /mcp/*/*

Set both endpoints to “public”:

image
image

Create an OAuth app

Google OAuth app

Microsoft Azure OAuth app

Peliqan OAuth app

Redirect URI for your app

Configure your MCP Server using OAuth in an AI Client

Configure your MCP Server in ChatGPT

Configure your MCP Server in Claude

Configure your MCP Server in Microsoft Copilot