Skip to main content
Glama
usegranthq

UseGrant MCP Server

Official
by usegranthq

create_access_token

Generate a new access token for a client using specified parameters like provider ID, client ID, and expiration time. Essential for authenticating and managing access on the UseGrant MCP Server.

Instructions

Create a new access token for a client

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audienceAsArrayNoWhether to use an array of audiences
clientIdYesThe ID of the client
expiresInNoThe number of seconds the token will be valid for
forceDefaultDomainNoWhether to force the default domain
providerIdYesThe ID of the provider
useJwtTypeNoWhether to use at+jwt token type in the header

Implementation Reference

  • MCP tool handler: destructures providerId, clientId, payload; calls usegrant.createToken; returns JSON-formatted token as text content.
    async ({ providerId, clientId, ...payload }) => { const token = await usegrant.createToken(providerId, clientId, payload); return { content: [{ type: 'text', text: JSON.stringify(token, null, 2) }], }; },
  • Input schema for the tool, combining ProviderIdSchema, ClientIdSchema, and CreateTokenSchema.shape from UgSchema.
    { providerId: UgSchema.ProviderIdSchema, clientId: UgSchema.ClientIdSchema, ...UgSchema.CreateTokenSchema.shape, },
  • src/index.ts:197-211 (registration)
    Registration of the create_access_token tool on the MCP server with name, description, input schema, and handler function.
    server.tool( 'create_access_token', 'Create a new access token for a client', { providerId: UgSchema.ProviderIdSchema, clientId: UgSchema.ClientIdSchema, ...UgSchema.CreateTokenSchema.shape, }, async ({ providerId, clientId, ...payload }) => { const token = await usegrant.createToken(providerId, clientId, payload); return { content: [{ type: 'text', text: JSON.stringify(token, null, 2) }], }; }, );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/usegranthq/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server