Skip to main content
Glama

Xero MCP Server

XeroAuthMiddleware.ts777 B
import { XeroClientSession } from "../XeroApiClient.js"; import { AuthenticateTool } from "../Tools/Authenticate.js"; import { IRequestMiddleware } from "./IRequestMiddleware.js"; export const XeroAuthMiddleware: IRequestMiddleware = async (request, next) => { const { name } = request.params; if (name === AuthenticateTool.requestSchema.name) { return await AuthenticateTool.requestHandler(request); } if (!XeroClientSession.isAuthenticated()) { return Promise.resolve({ content: [ { type: "text", text: "You must authenticate with Xero first", }, ], }); } const tenantId = XeroClientSession.activeTenantId(); if (!tenantId) { throw new Error("No tenant selected"); } return next(request); };

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/john-zhang-dev/xero-mcp'

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