Skip to main content
Glama

mcp-google-sheets

token-utils.ts1.28 kB
import { EnginePrincipal, PrincipalType } from '@activepieces/shared' import jwt from 'jsonwebtoken' import { workerMachine } from './machine' const ONE_WEEK = 7 * 24 * 3600 const ISSUER = 'activepieces' const ALGORITHM = 'HS256' export const tokenUtls = { async generateEngineToken({ jobId, projectId, platformId }: GenerateEngineTokenParams): Promise<string> { const settings = workerMachine.getSettings() const secret = settings.JWT_SECRET const enginePrincipal: EnginePrincipal = { id: jobId, type: PrincipalType.ENGINE, projectId, platform: { id: platformId, }, } const signOptions: jwt.SignOptions = { algorithm: ALGORITHM, expiresIn: ONE_WEEK, issuer: ISSUER, } return new Promise<string>((resolve, reject) => { jwt.sign(enginePrincipal, secret, signOptions, (err, token) => { if (err || !token) { return reject(err || new Error('Failed to generate token')) } return resolve(token) }) }) }, } type GenerateEngineTokenParams = { jobId: string projectId: string platformId: string }

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/activepieces/activepieces'

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