Skip to main content

Overview

The @atxp/server package is a support package used for packages like @atxp/express. You should generally not need to reference @atxp/server directly.
This package depends on types and utilities from @atxp/common. All shared types like ATXPArgs and payment utilities are documented in the common package.

Installation

Functions

atxpAccountId

Returns the accountId of the ATXP user of the current server request. Use this in the code of an MCP tool, or anywhere else inside the context of ATXP middleware, to get the current user.
Account ids should be treated as opaque strings. They are unique per user, but you should not assume they have any semantic meaning.
Arguments None Example usage

requirePayment

Requires payment before executing a tool. This function must be called before any paid tool logic.
The requirePayment function uses BigNumber for precise decimal arithmetic. Install it with npm install bignumber.js and import it as shown above.
Arguments Example usage