Security
Generate cryptographically secure one-time tokens for web security scenarios — CSRF tokens, OAuth/OIDC state parameters, session nonces, and PKCE code_verifier/code_challenge (S256). Uses crypto.randomBytes, never Math.random.
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/api/tools/nonce-generator' \
-H 'Content-Type: application/json' \
-d '{"scenario":"pkce","byteLength":32,"encoding":"base64url","timestampPrefix":false,"ttlSeconds":300,"count":1}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/nonce-generator| Name | Type | Required | Description |
|---|---|---|---|
| scenario | select | No | — |
| byteLength | number | No | — |
| encoding | select | No | — |
| timestampPrefix | checkbox | No | — |
| ttlSeconds | number | No | — |
| count |
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-nonce-generator": {
"name": "nonce-generator",
"description": "Generate cryptographically secure one-time tokens for web security scenarios — CSRF tokens, OAuth/OIDC state parameters, session nonces, and PKCE code_verifier/code_challenge (S256). Uses crypto.randomBytes, never Math.random.",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=nonce-generator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "nonce-generator",
"arguments": {
"scenario": "pkce",
"byteLength": 32,
"encoding": "base64url",
"timestampPrefix": false,
"ttlSeconds": 300,
"count": 1
}
}
}Questions or issues? Contact [email protected]
| number |
| No |
| — |
HTML result
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}