Building a Payment-Enabled MCP Server: Let AI Agents Pay for Skills via HTTP 402
The Problem
In the traditional SaaS model, users need to sign up, subscribe, and bind a credit card before they can use an AI tool. This creates high friction.
The answer is HTTP 402 Payment Required — a rarely-used HTTP status code perfect for pay-per-use AI APIs.
What is HTTP 402?
HTTP 402 "Payment Required" is a standard HTTP status code. When a client calls an API without payment, the server returns 402 with payment parameters. After payment, the request is processed.
The Architecture
I built this for CHROMATIC-MCP — an MCP Server exposing 252 AI skills through 12 MCP tools:
Client → API Gateway (Auth + Payment Check) → Skill Router → Skill Server
Key Components
- Free Tier: 10 free calls per skill per day, no auth needed
- Alipay AI Pay: Auto-debit agreement for seamless payments
- MCP Tools: Each skill registered as individual MCP tool
12 MCP Tools
| Tool | Price | Description |
|---|---|---|
| discover_skills | Free | Browse all 252 skills |
| skill_mbti-deep-analysis | ¥0.10 | MBTI assessment |
| skill_bianzhen | ¥0.50 | Multi-model fact-checking |
| skill_ad-copywriter | ¥0.10 | Ad copy generation |
| skill_zhuojian | ¥0.50 | 5-layer deep analysis |
| skill_cuilu | ¥0.50 | Skill forging engine |
| skill_weekly-report | ¥0.10 | Weekly report generator |
| skill_taobao-listing | ¥0.10 | E-commerce copywriting |
| skill_contract-guardian | ¥0.10 | AI contract review |
| skill_game-audio | ¥0.10 | Game audio design |
| skill_shijin | ¥0.50 | Skill quality testing |
| get_skill_detail | Free | Get skill details |
Quick Start
Install via npx
npx -y chromatic-mcp-skills@latest
Configure in Claude Desktop / Cursor
{
"mcpServers": {
"CHROMATIC-MCP": {
"command": "npx",
"args": ["-y", "chromatic-mcp-skills@latest"]
}
}
}
Try a Skill (Free)
curl http://124.222.26.218:3000/api/skill/mbti-deep-analysis
Why HTTP 402 Works for AI
- Zero friction: No signup, no credit card. First 10 calls free.
- Standard protocol: Any HTTP client understands 402.
- Agent-friendly: AI agents can detect 402 and handle payment.
- Granular pricing: ¥0.10–¥0.50 per call depending on complexity.
Lessons Learned
- 402 is underutilized but semantically correct for payment walls
- Free tier removes all friction for evaluation
- Alipay AI Pay auto-debit means returning users never see payment prompts
- MCP is the future — any AI agent can discover and use skills
What's Next
- Multi-model support
- Volume discounts
- Third-party skill submissions
- More payment methods
GitHub: https://github.com/Chromatic0618/alipay-mcp-server
npm: chromatic-mcp-skills
Live API: http://124.222.26.218:3000/api/skills
Built by Chromatic0618. MIT License.
Top comments (0)