<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: XYG-LUNA</title>
    <description>The latest articles on DEV Community by XYG-LUNA (@xygluna).</description>
    <link>https://dev.to/xygluna</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4028240%2Fd04eb61b-59a7-4dd6-bb53-4ec8f3b423a8.png</url>
      <title>DEV Community: XYG-LUNA</title>
      <link>https://dev.to/xygluna</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xygluna"/>
    <language>en</language>
    <item>
      <title>Building a Payment-Enabled MCP Server: Let AI Agents Pay for Skills via HTTP 402</title>
      <dc:creator>XYG-LUNA</dc:creator>
      <pubDate>Tue, 14 Jul 2026 07:15:05 +0000</pubDate>
      <link>https://dev.to/xygluna/building-a-payment-enabled-mcp-server-let-ai-agents-pay-for-skills-via-http-402-2ao5</link>
      <guid>https://dev.to/xygluna/building-a-payment-enabled-mcp-server-let-ai-agents-pay-for-skills-via-http-402-2ao5</guid>
      <description>&lt;h1&gt;
  
  
  Building a Payment-Enabled MCP Server: Let AI Agents Pay for Skills via HTTP 402
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;The answer is &lt;strong&gt;HTTP 402 Payment Required&lt;/strong&gt; — a rarely-used HTTP status code perfect for pay-per-use AI APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is HTTP 402?
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture
&lt;/h2&gt;

&lt;p&gt;I built this for &lt;strong&gt;CHROMATIC-MCP&lt;/strong&gt; — an MCP Server exposing 252 AI skills through 12 MCP tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client → API Gateway (Auth + Payment Check) → Skill Router → Skill Server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Components
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Free Tier&lt;/strong&gt;: 10 free calls per skill per day, no auth needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alipay AI Pay&lt;/strong&gt;: Auto-debit agreement for seamless payments&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP Tools&lt;/strong&gt;: Each skill registered as individual MCP tool&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  12 MCP Tools
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;discover_skills&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;Browse all 252 skills&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skill_mbti-deep-analysis&lt;/td&gt;
&lt;td&gt;¥0.10&lt;/td&gt;
&lt;td&gt;MBTI assessment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skill_bianzhen&lt;/td&gt;
&lt;td&gt;¥0.50&lt;/td&gt;
&lt;td&gt;Multi-model fact-checking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skill_ad-copywriter&lt;/td&gt;
&lt;td&gt;¥0.10&lt;/td&gt;
&lt;td&gt;Ad copy generation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skill_zhuojian&lt;/td&gt;
&lt;td&gt;¥0.50&lt;/td&gt;
&lt;td&gt;5-layer deep analysis&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skill_cuilu&lt;/td&gt;
&lt;td&gt;¥0.50&lt;/td&gt;
&lt;td&gt;Skill forging engine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skill_weekly-report&lt;/td&gt;
&lt;td&gt;¥0.10&lt;/td&gt;
&lt;td&gt;Weekly report generator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skill_taobao-listing&lt;/td&gt;
&lt;td&gt;¥0.10&lt;/td&gt;
&lt;td&gt;E-commerce copywriting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skill_contract-guardian&lt;/td&gt;
&lt;td&gt;¥0.10&lt;/td&gt;
&lt;td&gt;AI contract review&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skill_game-audio&lt;/td&gt;
&lt;td&gt;¥0.10&lt;/td&gt;
&lt;td&gt;Game audio design&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;skill_shijin&lt;/td&gt;
&lt;td&gt;¥0.50&lt;/td&gt;
&lt;td&gt;Skill quality testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;get_skill_detail&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;Get skill details&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install via npx
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx &lt;span class="nt"&gt;-y&lt;/span&gt; chromatic-mcp-skills@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configure in Claude Desktop / Cursor
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"CHROMATIC-MCP"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"chromatic-mcp-skills@latest"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Try a Skill (Free)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl http://124.222.26.218:3000/api/skill/mbti-deep-analysis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why HTTP 402 Works for AI
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Zero friction&lt;/strong&gt;: No signup, no credit card. First 10 calls free.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standard protocol&lt;/strong&gt;: Any HTTP client understands 402.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent-friendly&lt;/strong&gt;: AI agents can detect 402 and handle payment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Granular pricing&lt;/strong&gt;: ¥0.10–¥0.50 per call depending on complexity.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;402 is underutilized but semantically correct for payment walls&lt;/li&gt;
&lt;li&gt;Free tier removes all friction for evaluation&lt;/li&gt;
&lt;li&gt;Alipay AI Pay auto-debit means returning users never see payment prompts&lt;/li&gt;
&lt;li&gt;MCP is the future — any AI agent can discover and use skills&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Multi-model support&lt;/li&gt;
&lt;li&gt;Volume discounts&lt;/li&gt;
&lt;li&gt;Third-party skill submissions&lt;/li&gt;
&lt;li&gt;More payment methods&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/Chromatic0618/alipay-mcp-server" rel="noopener noreferrer"&gt;https://github.com/Chromatic0618/alipay-mcp-server&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;npm&lt;/strong&gt;: &lt;code&gt;chromatic-mcp-skills&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Live API&lt;/strong&gt;: &lt;a href="http://124.222.26.218:3000/api/skills" rel="noopener noreferrer"&gt;http://124.222.26.218:3000/api/skills&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built by Chromatic0618. MIT License.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>api</category>
      <category>mcp</category>
    </item>
  </channel>
</rss>
