Follow these steps to get started running an agent and MCP-based tools in a Meshagent Room:

Environment Variables

Set the following environment variables with your own Descope project configuration:

  • DESCOPE_PROJECT_ID: Your Descope project ID.
  • DESCOPE_MANAGEMENT_KEY: Your Descope management key.

Example:

export DESCOPE_PROJECT_ID=your-descope-project-id-here
export DESCOPE_MANAGEMENT_KEY=your-descope-management-key-here

Installation & Run

  1. Install Meshagent and plugins

    pip install "meshagent[all]"
    
  2. Sign up and authenticate
    See Meshagent CLI Get Started for authentication steps.

  3. Launch the Descope MCP Service in a Meshagent Room

    meshagent service test --room=test --role=agent \
      --image=meshagent/mcp-descope:latest \
      --env MESHAGENT_PORT=8001 \
      --env DESCOPE_PROJECT_ID=your-descope-project-id-here \
      --env DESCOPE_MANAGEMENT_KEY=your-descope-management-key-here \
      --port="num=8001 path=/webhook liveness=/ type=meshagent.callable" \
      --name=mcp-descope-service
    

    This command starts a Meshagent Room (test) with the MCP server accessible as an agent. Rooms close if inactive.

  4. Join the Room with a Chatbot and Enabled Toolkits

    meshagent chatbot join --room=test --agent-name=sample --name=sample --toolkit=mcp-descope
    
    • Starts a chatbot in the test room that can use the Descope toolkit.
    • You may add multiple toolkits for the same agent in this way.
    • A link to the room to interact with the agent will appear in this command’s output.

Tools Available

The Meshagent-wrapped Descope MCP server provides the following tools:

ToolShort Description
create-userCreate a new user in Descope project
invite-userCreate and invite a new user to the Descope project
search-auditsSearch Descope project audit logs
search-usersSearch for users in Descope project

Tool Details

create-user

Create a new user in Descope project

ParametersTypeDescription
loginIdstringPrimary login identifier for the user
additionalLoginIdsarray optionalAdditional login identifiers
customAttributesobject optionalCustom attributes for the user
displayNamestring optionalUser’s display name
emailstring optionalUser’s email address
familyNamestring optionalUser’s family/last name
givenNamestring optionalUser’s given/first name
middleNamestring optionalUser’s middle name
phonestring optionalUser’s phone number in E.164 format
picturestring optionalURL to user’s profile picture
rolesarray optionalGlobal role names to assign to the user
ssoAppIdsarray optionalSSO application IDs to associate
userTenantsarray optionalTenant associations with specific roles
verifiedEmailboolean optionalWhether the email is pre-verified
verifiedPhoneboolean optionalWhether the phone is pre-verified

invite-user

Create and invite a new user to the Descope project

ParametersTypeDescription
loginIdstringPrimary login identifier for the user
additionalLoginIdsarray optionalAdditional login identifiers
customAttributesobject optionalCustom attributes for the user
displayNamestring optionalUser’s display name
emailstring optionalUser’s email address
familyNamestring optionalUser’s family/last name
givenNamestring optionalUser’s given/first name
inviteUrlstring optionalCustom URL for the invitation link
middleNamestring optionalUser’s middle name
phonestring optionalUser’s phone number in E.164 format
picturestring optionalURL to user’s profile picture
rolesarray optionalGlobal role names to assign to the user
sendMailboolean optionalSend invite via email (default follows project settings)
sendSMSboolean optionalSend invite via SMS (default follows project settings)
ssoAppIdsarray optionalSSO application IDs to associate
templateIdstring optionalCustom template ID for the invitation
templateOptionsobject optionalOptions for customizing the invitation template
userTenantsarray optionalTenant associations with specific roles
verifiedEmailboolean optionalWhether the email is pre-verified
verifiedPhoneboolean optionalWhether the phone is pre-verified

search-audits

Search Descope project audit logs

ParametersTypeDescription
actionsarray optionalFilter by specific action types
excludedActionsarray optionalActions to exclude from results
geosarray optionalFilter by geographic locations
hoursBacknumber optionalHours to look back (max 720 hours / 30 days)
limitnumber optionalNumber of audit logs to fetch (max 10)
loginIdsarray optionalFilter by specific login IDs
methodsarray optionalFilter by authentication methods
noTenantsboolean optionalIf true, only show events without tenants
tenantsarray optionalFilter by specific tenant IDs

search-users

Search for users in Descope project

ParametersTypeDescription
emailsarray optionalFilter by specific email addresses
limitnumber optionalNumber of users per page (max 100)
loginIdsarray optionalFilter by specific login IDs
pagenumber optionalPage number for pagination
phonesarray optionalFilter by specific phone numbers
rolesarray optionalFilter users by role names
ssoAppIdsarray optionalFilter users by SSO application IDs
statusesarray optionalFilter by user statuses (‘enabled’, ‘disabled’, or ‘invited’)
tenantIdsarray optionalFilter users by specific tenant IDs
testUsersOnlyboolean optionalReturn only test users
textstring optionalText to search for in user fields
withTestUserboolean optionalInclude test users in results

Additional Resources