Observed since 20 Oct, 19:57 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
MCP server for 402ai.net - Lightning-paid OpenAI proxy tools
MCP (Model Context Protocol) server for 402ai.net - a Lightning-paid API proxy. Provides catalog-aware tools with compact/full profiles, bearer-first authentication, and dynamic tool refresh notifications.
Please update me when there are feature changes.
npm install
npm run build
npm test
ALBOM_BEARER_TOKEN=<your_token> npm start
npm install 402ai-mcp
Configure via environment variables:
| Variable | Default | Description |
|---|---|---|
ALBOM_BASE_URL | https://402ai.net | API base URL |
ALBOM_BEARER_TOKEN | (none) | Prepaid balance token (strongly recommended) |
ALBOM_TOOL_PROFILE | compact | Tool profile: compact or full |
ALBOM_INCLUDE_MODERATION | false (compact), true (full) | Include moderation tools |
ALBOM_INCLUDE_EMBEDDINGS | false (compact), true (full) | Include embedding tools |
ALBOM_INCLUDE_VIDEO | true | Include video generation tools |
ALBOM_ALLOW_RAW_TOOL | false | Expose albom_raw_call tool (full profile only) |
ALBOM_CATALOG_TTL_MS | 300000 (5 min) | Catalog cache TTL |
ALBOM_HTTP_TIMEOUT_MS | 90000 (90 sec) | HTTP request timeout |
ALBOM_MAX_RETRIES | 2 | Max retry attempts for failed requests |
ALBOM_MAX_UPLOAD_BYTES | 26214400 (25 MB) | Max upload file size |
Optimized for AI agents with minimal tool ambiguity. Consolidates overlapping endpoints into semantic tools:
| Tool | Purpose | Maps to Endpoint |
|---|---|---|
albom_catalog_get | Get live API catalog | /api/v1/catalog |
albom_text_generate | Generate text completions | /v1/responses |
albom_image_generate | Generate images | /v1/images/generations |
albom_image_edit | Edit images | /v1/images/edits |
albom_audio_transcribe | Transcribe audio (with optional translation) | /v1/audio/transcriptions (+ /translations) |
albom_audio_speech | Generate speech | /v1/audio/speech |
albom_video_generate | Generate videos (if enabled) | /v1/video/generations |
albom_safety_moderate | Content moderation (if enabled) | /v1/moderations |
albom_embedding_create | Create embeddings (if enabled) | /v1/embeddings |
Consolidations:
/v1/chat/completions in favor of /v1/responses (identical model sets)/v1/audio/translations into albom_audio_transcribe via boolean flagOne tool per catalog endpoint for comprehensive coverage:
albom_openai_chat_completionsalbom_openai_responsesalbom_openai_images_generationsalbom_openai_images_editsalbom_openai_images_variationsalbom_openai_audio_speechalbom_openai_audio_transcriptionsalbom_openai_audio_translationsalbom_openai_embeddingsalbom_openai_moderationsalbom_openai_video_generationsalbom_catalog_getalbom_raw_call (if ALBOM_ALLOW_RAW_TOOL=true)Set ALBOM_BEARER_TOKEN to your prepaid balance token. All requests will use Authorization: Bearer <token>.
Get a token:
# 1. Create topup invoice
curl -X POST https://402ai.net/api/v1/topup \
-H "Content-Type: application/json" \
-d '{"amount_sats":1000}'
# 2. Pay invoice with Lightning wallet, then claim
curl -X POST https://402ai.net/api/v1/topup/claim \
-H "Content-Type: application/json" \
-d '{"preimage":"<hex-preimage>"}'
Without a token, calls will return 402 Payment Required with a Lightning invoice. The MCP server will surface this as an error with payment details.
Add to claude_desktop_config.json:
{
"mcpServers": {
"402ai": {
"command": "node",
"args": ["/path/to/402ai-mcp/dist/server.js"],
"env": {
"ALBOM_BEARER_TOKEN": "abl_your_token_here",
"ALBOM_TOOL_PROFILE": "compact"
}
}
}
}
import { createAlbomServer } from '402ai-mcp';
const server = createAlbomServer({
baseUrl: 'https://402ai.net',
bearerToken: process.env.ALBOM_BEARER_TOKEN,
toolProfile: 'compact'
});
// Start server
await server.run();
npm run build
npm test # Run all tests
npm run test:watch # Watch mode
npm run dev # Watch and rebuild
npm run start:dev # Run without build
ALBOM_BEARER_TOKEN=<token> npm run smoke:live
catalog.ts: Fetches and validates /api/v1/catalog, detects changesconfig.ts: Environment variable configuration and validationdedup.ts: Model set deduplication logic (Jaccard similarity)httpClient.ts: HTTP client with retry logic, multipart support, bearer authtools/: Tool implementations for compact and full profilesresults.ts: Response normalization and error handlinguploads.ts: File upload handling (path and base64)server.ts: MCP server implementation/api/v1/catalog on startupALBOM_CATALOG_TTL_MSnotifications/tools/list_changed if catalog changesHTTP errors are normalized to MCP-friendly format:
402 Payment Required: Returns payment details (invoice, amount, expires_in)400 Bad Request: Returns validation errors429 Rate Limited: Returns retry-after info5xx Server Error: Returns error messageTest suite covers:
Run tests:
npm test
# 1. Build and test
npm run build
npm test
# 2. Check package contents
npm pack --dry-run
# 3. Publish
npm login
npm version patch # or minor/major
npm publish --access public
.
├── src/
│ ├── catalog.ts # Catalog fetching and tracking
│ ├── config.ts # Environment configuration
│ ├── dedup.ts # Model set deduplication
│ ├── httpClient.ts # HTTP client with retries
│ ├── server.ts # MCP server implementation
│ ├── tools/ # Tool implementations
│ │ ├── compact.ts # Compact profile tools
│ │ ├── full.ts # Full profile tools
│ │ └── shared.ts # Shared tool utilities
│ ├── results.ts # Response normalization
│ ├── uploads.ts # File upload handling
│ ├── types.ts # TypeScript types
│ └── index.ts # Public exports
├── test/ # Test suite
├── scripts/ # Utility scripts
├── dist/ # Compiled output
└── 402AI_MCP_IMPLEMENTATION_SPEC.md # Design spec
Documentation:
└── 402AI_MCP_IMPLEMENTATION_SPEC.md
This server implements MCP spec revision 2025-11-25.
Supported features:
tools/list_changed)title, readOnlyHint, idempotentHint)MIT - See LICENSE file.
See WORKLOG.md for recent changes and development history.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.0Registry latest | 5 Mar 2026 | 7 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:57 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:bae72354c3a806648ea94da5ebc7047b2323b92d22e323746b8123482945e458