- Update headline to "THE NPM FOR AI TOOLS" for clearer positioning - Add new integrations section showing Claude, Cursor, Windsurf support - Include config code example for easy onboarding - Fix search placeholder to use real tool names - Improve featured tools display (hide N/A scores, show "New" for 0 downloads) - Update site metadata and structured data with new tagline - Add comprehensive TPMJS features documentation
18 KiB
TPMJS Platform - Complete Feature Documentation
A comprehensive overview of all TPMJS functionality for marketing, fundraising, and pet project ideation.
Table of Contents
- Platform Overview
- Core Architecture
- Tool Registry & Discovery
- Tool Execution System
- MCP (Model Context Protocol) Implementation
- Collections System
- Agent System
- API Endpoints
- SDK & Packages
- Security & Privacy
- Infrastructure
- Use Cases
- Competitive Advantages
Platform Overview
TPMJS (Tool Package Manager for JavaScript) is an open platform for discovering, sharing, and executing AI tools via the Model Context Protocol (MCP). Think of it as "npm for AI tools" - a registry where developers can publish tools that AI assistants can use.
Key Value Propositions
- Unified Tool Registry - One place to discover and use AI tools
- Instant MCP Servers - Any collection becomes an MCP-compatible server
- Secure Execution - Sandboxed tool execution with rate limiting
- AI Agent Infrastructure - Build multi-turn conversational agents with tool access
- Developer-Friendly - Publish tools via npm, use via standard protocols
Core Architecture
Tech Stack
| Layer | Technology |
|---|---|
| Frontend | Next.js 16 (App Router), React 19, Tailwind CSS |
| Backend | Next.js API Routes (Serverless) |
| Database | PostgreSQL (Neon) with Prisma ORM |
| Auth | NextAuth.js (GitHub OAuth) |
| Hosting | Vercel (Edge + Serverless) |
| Package Registry | npm (mirrored) |
| Build System | Turborepo + pnpm workspaces |
Monorepo Structure
tpmjs/
├── apps/
│ ├── web/ # Main Next.js application (tpmjs.com)
│ └── playground/ # Interactive tool testing environment
├── packages/
│ ├── @tpmjs/types # Shared TypeScript types & Zod schemas
│ ├── @tpmjs/ui # React component library
│ ├── @tpmjs/utils # Utility functions
│ ├── @tpmjs/env # Environment variable validation
│ ├── @tpmjs/db # Prisma database client
│ ├── @tpmjs/mocks # MSW mock server for testing
│ └── @tpmjs/config # Shared configs (ESLint, Tailwind, TypeScript)
└── templates/
└── vercel-executor/ # Template for deploying tool executors
Tool Registry & Discovery
What is a TPMJS Tool?
A TPMJS tool is an npm package with:
- The
tpmjskeyword in package.json - A
tpmjsfield defining the tool's MCP schema
{
"name": "my-awesome-tool",
"keywords": ["tpmjs"],
"tpmjs": {
"name": "my-tool",
"description": "Does awesome things",
"inputSchema": {
"type": "object",
"properties": {
"query": { "type": "string" }
},
"required": ["query"]
}
}
}
Tool Tiers
| Tier | Description | Features |
|---|---|---|
| Minimal | Basic tool definition | Name, description, input schema only |
| Rich | Full-featured tool | Executor URL, examples, categories, tags |
Discovery Methods
-
npm Changes Feed Sync (every 2 minutes)
- Monitors npm's real-time changes feed
- Catches new packages and updates instantly
- Processes ~100 changes per run
-
Keyword Search Sync (every 15 minutes)
- Actively searches npm for
tpmjskeyword - Backfills any missed packages
- Processes up to 250 packages per run
- Actively searches npm for
-
Metrics Sync (hourly)
- Updates download statistics
- Calculates quality scores
- Refreshes ranking data
Quality Scoring Algorithm
Quality Score = Tier Score + Downloads Score + Stars Score
Where:
- Tier Score: rich = 0.6, minimal = 0.4
- Downloads Score: min(0.3, log10(downloads + 1) / 10)
- Stars Score: min(0.1, log10(githubStars + 1) / 10)
Tool Categories
- AI/ML
- Development Tools
- Data Processing
- Web Scraping
- APIs & Integrations
- Utilities
- And more...
Current Registry Stats
- 170+ Official Tools in the ajax-collection
- Growing Community Tools published by developers
- Real-time Sync with npm registry
Tool Execution System
Execution Flow
User Request → TPMJS API → Executor Selection → Sandboxed Execution → Response
Executor Types
- HTTP Executor - Calls external HTTP endpoints
- Serverless Executor - Runs in Vercel Edge/Serverless
- Code Executor - Executes arbitrary code in sandbox
Sandboxing Features
- Network Isolation - Zero-trust or semi-trusted modes
- Timeout Limits - Configurable per-tool (1-900 seconds)
- Resource Limits - Memory and CPU constraints
- Input Validation - Zod schema validation
Executor Template
The templates/vercel-executor/ provides a ready-to-deploy executor:
// Example executor implementation
export async function POST(request: Request) {
const { tool, input } = await request.json();
// Validate input against schema
const validated = toolSchema.parse(input);
// Execute tool logic
const result = await executeTool(tool, validated);
return Response.json(result);
}
Code Execution (via MCP Tool)
The platform includes a powerful code execution tool:
// Execute code in 42+ languages
{
"language": "python",
"code": "print('Hello, World!')",
"network_mode": "zerotrust", // or "semitrusted"
"ttl": 60 // timeout in seconds
}
Supported languages include:
- Python, JavaScript, TypeScript
- Go, Rust, C, C++
- Ruby, PHP, Perl
- Java, Kotlin, Scala
- And 30+ more
MCP (Model Context Protocol) Implementation
What is MCP?
MCP is an open protocol for AI assistants to interact with tools. TPMJS provides:
- MCP Server Hosting - Every collection is an MCP server
- Multiple Transports - HTTP and SSE support
- Standard Compliance - Full MCP specification support
Transport Options
HTTP Transport
POST /api/mcp/{username}/{collection-slug}/http
Content-Type: application/json
{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}
SSE Transport
POST /api/mcp/{username}/{collection-slug}/sse
Content-Type: application/json
{"jsonrpc": "2.0", "id": 1, "method": "initialize"}
MCP Methods Supported
| Method | Description |
|---|---|
initialize |
Initialize MCP session |
tools/list |
List available tools |
tools/call |
Execute a tool |
resources/list |
List available resources |
resources/read |
Read a resource |
prompts/list |
List available prompts |
prompts/get |
Get a specific prompt |
Authentication
- API Key Auth - Bearer token in Authorization header
- Session Auth - Cookie-based for web users
- Scopes - Granular permission control
mcp:access- Access MCP endpointsmcp:execute- Execute toolstools:read- List toolstools:execute- Execute specific toolscollections:read- Access collections
Integration Examples
Claude Desktop
{
"mcpServers": {
"tpmjs": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-remote",
"https://tpmjs.com/api/mcp/ajax/ajax-collection/sse"]
}
}
}
Cursor IDE
{
"mcpServers": {
"tpmjs": {
"url": "https://tpmjs.com/api/mcp/ajax/ajax-collection/sse"
}
}
}
Collections System
What are Collections?
Collections are curated groups of tools that form an MCP server. Users can:
- Create public or private collections
- Add tools from the registry
- Share collections as MCP endpoints
Collection Features
- Custom Naming - Unique slug per user
- Tool Curation - Add/remove tools
- Access Control - Public or private
- MCP Endpoint - Automatic server generation
Collection API
// Create collection
POST /api/collections
{ "name": "My Tools", "slug": "my-tools", "isPublic": true }
// Add tool to collection
POST /api/collections/{id}/tools
{ "toolId": "tool-123" }
// Get collection's MCP endpoint
GET /api/mcp/{username}/{collection-slug}/http
Agent System
What are TPMJS Agents?
Agents are AI-powered conversational interfaces with access to TPMJS tools. They enable:
- Multi-turn conversations
- Tool execution within context
- Custom system prompts
- Provider flexibility (OpenAI, Anthropic, etc.)
Agent Configuration
interface Agent {
id: string;
uid: string; // Unique identifier
name: string;
description?: string;
provider: "OPENAI" | "ANTHROPIC" | "GOOGLE";
modelId: string; // e.g., "gpt-4o-mini"
systemPrompt?: string;
isPublic: boolean;
tools: Tool[]; // Attached tools
}
Agent Features
-
Multi-Turn Conversations
- Persistent chat history
- Context-aware responses
- Tool execution in conversation
-
Provider Flexibility
- OpenAI (GPT-4, GPT-4o-mini)
- Anthropic (Claude)
- Google (Gemini)
- Custom providers
-
Tool Integration
- Attach any TPMJS tool
- Automatic tool calling
- Result injection into context
-
Public Chat Pages
- Share agents via public URL
- Embeddable chat interfaces
- No auth required for public agents
Agent API
// Create agent
POST /api/agents
{ "name": "My Agent", "provider": "OPENAI", "modelId": "gpt-4o-mini" }
// Chat with agent
POST /api/agents/{id}/chat
{ "messages": [{"role": "user", "content": "Hello!"}] }
// Stream response
POST /api/agents/{id}/chat
{ "messages": [...], "stream": true }
API Endpoints
Public Endpoints (No Auth)
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Health check with build info |
/api/stats |
GET | Platform statistics |
/api/stats/health |
GET | Tool health metrics |
/api/tools |
GET | List public tools |
/api/tools/{id} |
GET | Get tool details |
/api/tools/search |
GET | Search tools |
/api/collections/public |
GET | List public collections |
Authenticated Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/user |
GET | Current user profile |
/api/user/settings |
PATCH | Update user settings |
/api/user/api-keys |
GET/POST | Manage API keys |
/api/agents |
CRUD | Agent management |
/api/collections |
CRUD | Collection management |
MCP Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/mcp/{user}/{collection}/http |
POST | HTTP transport |
/api/mcp/{user}/{collection}/sse |
POST | SSE transport |
/api/mcp/{user}/{collection}/http |
GET | Server info |
Sync Endpoints (Cron)
| Endpoint | Schedule | Description |
|---|---|---|
/api/sync/changes |
*/2 * * * * | npm changes feed |
/api/sync/keyword |
*/15 * * * * | Keyword search |
/api/sync/metrics |
0 * * * * | Metrics update |
Tool Execution
| Endpoint | Method | Description |
|---|---|---|
/api/tools/{id}/execute |
POST | Execute a tool |
/api/execute/code |
POST | Execute code (sandbox) |
SDK & Packages
Published npm Packages
| Package | Description |
|---|---|
@tpmjs/types |
TypeScript types and Zod schemas |
@tpmjs/ui |
React component library |
@tpmjs/utils |
Utility functions |
@tpmjs/env |
Environment validation |
Type Definitions
// Tool types
interface TpmjsTool {
name: string;
description: string;
inputSchema: JSONSchema;
outputSchema?: JSONSchema;
executor?: string;
category?: string;
tags?: string[];
}
// MCP types
interface McpRequest {
jsonrpc: "2.0";
id: string | number;
method: string;
params?: Record<string, unknown>;
}
interface McpResponse {
jsonrpc: "2.0";
id: string | number;
result?: unknown;
error?: McpError;
}
UI Components
- Buttons, Cards, Badges
- Form inputs with validation
- Code editors with syntax highlighting
- Chat interfaces
- Tool cards and lists
Security & Privacy
Authentication Methods
- GitHub OAuth - Primary user auth
- API Keys - Programmatic access
- Session Cookies - Web auth
API Key Security
- SHA-256 hashed storage
- Prefix-only display after creation
- Scoped permissions
- Optional expiration
- Revocation support
Rate Limiting
- Per-user limits
- Per-IP limits
- Per-tool limits
- Customizable thresholds
Data Privacy
- No tool input logging by default
- Optional usage analytics
- GDPR-compliant data handling
- User data export/deletion
Sandbox Security
- Network isolation modes
- Resource limits
- No persistent storage
- Ephemeral execution
Infrastructure
Deployment Architecture
┌─────────────────────────────────────────────────────────────┐
│ Vercel │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Edge │ │ Serverless │ │ Serverless │ │
│ │ Network │→ │ Functions │→ │ Executors │ │
│ │ (CDN) │ │ (API) │ │ (Tool Runners) │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Neon PostgreSQL │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Tools │ │ Users │ │ Collections │ │
│ │ Registry │ │ & Auth │ │ & Agents │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Monitoring
- Health Checks - Every 5 minutes via GitHub Actions
- Vercel Analytics - Performance monitoring
- Sync Logging - All sync operations logged
- Error Tracking - Automatic error collection
CI/CD Pipeline
- Pre-commit - Lint, format, type-check (Lefthook)
- CI - Full test suite (GitHub Actions)
- Deploy - Automatic on merge (Vercel)
- Health Check - Post-deploy verification
Use Cases
For Developers
-
Publish AI Tools
- Package as npm module
- Add
tpmjskeyword - Automatically synced to registry
-
Build Tool Collections
- Curate tools for specific use cases
- Share as MCP endpoint
- Embed in applications
-
Create AI Agents
- Attach tools to agents
- Custom system prompts
- Deploy public chat interfaces
For AI Applications
-
Integrate Tools
- Connect via MCP protocol
- Use any TPMJS collection
- Standard JSON-RPC interface
-
Extend Capabilities
- Web scraping, code execution
- API integrations
- Data processing
-
Build Workflows
- Chain multiple tools
- Agent-based automation
- Custom orchestration
For Enterprises
-
Private Tool Registry
- Internal tools only
- Access control
- Usage analytics
-
Secure Execution
- Sandboxed environments
- Audit logging
- Compliance ready
-
Custom Agents
- Brand-specific AI assistants
- Internal knowledge access
- Tool-enabled support
Competitive Advantages
vs. Building Custom MCP Servers
| TPMJS | Custom MCP Server |
|---|---|
| Instant setup | Days/weeks of development |
| 170+ tools ready | Build each tool |
| Hosted infrastructure | Self-hosted required |
| Automatic scaling | Manual scaling |
vs. Other Tool Platforms
| Feature | TPMJS | Competitors |
|---|---|---|
| Open Protocol (MCP) | ✅ | Often proprietary |
| npm Integration | ✅ | Custom registries |
| Self-hostable | ✅ | Usually SaaS-only |
| Code Execution | ✅ | Limited |
| Agent System | ✅ | Separate product |
Unique Features
- npm-Native - Tools are just npm packages
- MCP-First - Built on open standard
- Hybrid Execution - Local + cloud options
- Collection System - Curated tool sets
- Agent Platform - Full conversational AI
Appendix: Official Tools Collection
The ajax-collection includes 170+ tools across categories:
Web & Data
firecrawl-aisdk- Web crawling and extractiontpmjs-tools-page-brief- Page summarizationtpmjs-tools-search- Web search
Development
tpmjs-unsandbox- Code execution (42+ languages)tpmjs-tools-toc-generate- Markdown TOC generatortpmjs-tools-changelog-entry- Changelog generation
Content
tpmjs-createblogpost- Blog post creationtpmjs-tools-recipe-hash- Recipe/workflow hashingtpmjs-tools-workflow-variant-generate- Workflow variations
And Many More...
- API integrations
- Data transformations
- File processing
- Image manipulation
- Text analysis
Summary
TPMJS is a comprehensive platform for AI tool discovery, execution, and orchestration. Key takeaways:
- Registry - npm-native tool discovery with automatic syncing
- Execution - Secure, sandboxed tool running
- MCP - Standard protocol for AI integration
- Collections - Curated tool sets as MCP servers
- Agents - Conversational AI with tool access
- Infrastructure - Production-ready, scalable, monitored
The platform enables developers to publish tools, AI applications to consume them, and enterprises to build secure, tool-enabled AI experiences.