<?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: guillaumefric0-del</title>
    <description>The latest articles on DEV Community by guillaumefric0-del (@guillaumefric0del).</description>
    <link>https://dev.to/guillaumefric0del</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%2F4266387%2Fdf431402-c092-4770-a802-7bdc37d81ea6.png</url>
      <title>DEV Community: guillaumefric0-del</title>
      <link>https://dev.to/guillaumefric0del</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/guillaumefric0del"/>
    <language>en</language>
    <item>
      <title>How I Built a Free MCP Server for Decoding 2,375 Cosmetic &amp; Perfume Batch Codes</title>
      <dc:creator>guillaumefric0-del</dc:creator>
      <pubDate>Thu, 26 Nov 2026 08:33:34 +0000</pubDate>
      <link>https://dev.to/guillaumefric0del/how-i-built-a-free-mcp-server-for-decoding-2375-cosmetic-perfume-batch-codes-5b50</link>
      <guid>https://dev.to/guillaumefric0del/how-i-built-a-free-mcp-server-for-decoding-2375-cosmetic-perfume-batch-codes-5b50</guid>
      <description>&lt;p&gt;Every bottle of Dior, Chanel, CeraVe, or COSRX has a short alphanumeric string engraved on the glass or crimped into the tube — a &lt;strong&gt;batch code&lt;/strong&gt; (like &lt;code&gt;4B01&lt;/code&gt; or &lt;code&gt;38Z401&lt;/code&gt;). Under EU Cosmetic Regulation (EC) 1223/2009, products with a shelf life over 30 months don't have to print an expiration date; consumers and second-hand buyers have to decode that batch code instead.&lt;/p&gt;

&lt;p&gt;While building &lt;strong&gt;&lt;a href="https://cosmescan.com/" rel="noopener noreferrer"&gt;CosmeScan&lt;/a&gt;&lt;/strong&gt; (a free batch code decoder and recall checker covering &lt;strong&gt;2,375 cosmetic, skincare, K-Beauty, and perfume brands&lt;/strong&gt;), I noticed a growing pattern in our traffic: a significant share of users were coming directly from AI assistants like ChatGPT and Claude asking &lt;em&gt;"When was Dior batch 4B01 made?"&lt;/em&gt; — and LLMs frequently hallucinated the manufacturing year because cosmetic conglomerates reuse 10-year cyclic codes and proprietary calendars.&lt;/p&gt;

&lt;p&gt;To give AI agents deterministic, verified answers instead of guesses, I built and published &lt;strong&gt;&lt;a href="https://github.com/guillaumefric0-del/cosmescan-mcp" rel="noopener noreferrer"&gt;&lt;code&gt;cosmescan-mcp&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt; — a free, read-only, zero-API-key &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt; server on &lt;a href="https://www.npmjs.com/package/cosmescan-mcp" rel="noopener noreferrer"&gt;npm&lt;/a&gt; and &lt;a href="https://glama.ai/mcp/servers/guillaumefric0-del/cosmescan-mcp" rel="noopener noreferrer"&gt;Glama&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is how it works and how you can wire it into Claude Desktop, Cursor, or any MCP-compatible client in 30 seconds.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why LLMs Struggle with Cosmetic Batch Codes
&lt;/h2&gt;

&lt;p&gt;Cosmetic batch codes are deceptively tricky for language models:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;10-year repeating cycles:&lt;/strong&gt; LVMH (&lt;code&gt;6B01&lt;/code&gt; = Feb 2026 &lt;em&gt;or&lt;/em&gt; Feb 2016), Estée Lauder (&lt;code&gt;A66&lt;/code&gt; = June 2026 &lt;em&gt;or&lt;/em&gt; June 2016), and L'Oréal (&lt;code&gt;38Z401&lt;/code&gt;) recycle year identifiers every decade.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sequential registries:&lt;/strong&gt; Chanel uses a rolling 4-digit monthly counter (~8-year cycle) that cannot be guessed from arithmetic alone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conglomerate M&amp;amp;A drift:&lt;/strong&gt; Acquired brands (like Byredo under Puig, Maison Francis Kurkdjian under LVMH, or Aesop under L'Oréal) have two or three different historical encoding schemes depending on the production year.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloned counterfeit lots:&lt;/strong&gt; On secondary marketplaces (Vinted, eBay, Depop), counterfeiters reuse valid vintage batch codes (for example, &lt;code&gt;19280&lt;/code&gt; on Baccarat Rouge 540 or &lt;code&gt;19S01&lt;/code&gt; on Creed Aventus). A naive date decoder tells the buyer &lt;em&gt;"Valid date!"&lt;/em&gt; even though the code is a known counterfeit signature.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Architecture: Thin Stdio MCP Client + Edge REST API
&lt;/h2&gt;

&lt;p&gt;I wanted &lt;code&gt;cosmescan-mcp&lt;/code&gt; to have &lt;strong&gt;zero secrets, zero local database bloat, and instant &lt;code&gt;npx&lt;/code&gt; startup&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Claude Desktop / Cursor / MCP Host
        │  (stdio JSON-RPC 2.0)
        ▼
cosmescan-mcp (Node.js + @modelcontextprotocol/sdk)
        │  (HTTPS GET, read-only, no API key)
        ▼
CosmeScan Public API (Cloudflare Worker + static JSON catalog)
  ├── /v1/decode?brand=dior&amp;amp;code=4B01
  ├── /v1/brands?q=cerave
  └── /v1/brand/dior
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The package is just &lt;strong&gt;~4.2 kB&lt;/strong&gt; unpacked, uses &lt;code&gt;@modelcontextprotocol/sdk&lt;/code&gt; over &lt;code&gt;StdioServerTransport&lt;/code&gt;, and exposes 3 deterministic, read-only tools:&lt;/p&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;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;decode_batch_code&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Decodes manufacturing date, product age, PAO shelf-life status, cloned counterfeit lot warnings, and EU Safety Gate / US FDA recall alerts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;search_brands&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Searches across all 2,375 supported cosmetic, skincare, K-Beauty, and fragrance brands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_brand_info&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Returns brand metadata, parent conglomerate, batch format hints, and direct decoder URL&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You can also inspect the underlying public REST endpoints directly in the &lt;strong&gt;&lt;a href="https://cosmescan.com/api-docs/" rel="noopener noreferrer"&gt;CosmeScan Open API Docs&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Setup (Claude Desktop / Cursor / Windsurf)
&lt;/h2&gt;

&lt;p&gt;No account or API key is required. Add this block to your &lt;code&gt;claude_desktop_config.json&lt;/code&gt; or &lt;code&gt;.cursor/mcp.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&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="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"cosmescan"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&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="s2"&gt;"cosmescan-mcp"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once connected, you can ask your assistant:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Check Christian Dior batch code 4B01 — when was it manufactured, is it fresh, and are there any recalls or counterfeit warnings?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The agent calls &lt;code&gt;decode_batch_code({ brand: "dior", code: "4B01" })&lt;/code&gt; and receives structured JSON with the exact manufacturing date (&lt;code&gt;2024-02&lt;/code&gt;), formula age, EU PAO freshness status, and whether the lot matches any active &lt;strong&gt;EU Safety Gate (RAPEX)&lt;/strong&gt;, &lt;strong&gt;US FDA&lt;/strong&gt;, or &lt;strong&gt;RappelConso&lt;/strong&gt; recall — or any of the &lt;strong&gt;306 known cloned counterfeit batch codes&lt;/strong&gt; documented in our &lt;strong&gt;&lt;a href="https://cosmescan.com/observatory-2026/" rel="noopener noreferrer"&gt;2026 Counterfeit &amp;amp; Recall Observatory&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Passing Glama Introspection &amp;amp; &lt;code&gt;awesome-mcp-servers&lt;/code&gt; Checks
&lt;/h2&gt;

&lt;p&gt;A quick tip if you're publishing your own Node.js MCP server to directories like Glama or &lt;code&gt;punkpeye/awesome-mcp-servers&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Include a minimal &lt;code&gt;Dockerfile&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;node:22-alpine&lt;/code&gt;, &lt;code&gt;npm install --omit=dev&lt;/code&gt;, &lt;code&gt;ENTRYPOINT ["node", "index.js"]&lt;/code&gt;) so automated registries can spin up your server in a container and run &lt;code&gt;initialize&lt;/code&gt; + &lt;code&gt;tools/list&lt;/code&gt; introspection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write a fast end-to-end stdio smoke test&lt;/strong&gt; spawning &lt;code&gt;node index.js&lt;/code&gt; and piping real JSON-RPC frames (&lt;code&gt;initialize&lt;/code&gt; → &lt;code&gt;notifications/initialized&lt;/code&gt; → &lt;code&gt;tools/list&lt;/code&gt; → &lt;code&gt;tools/call&lt;/code&gt;) before publishing to npm.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never write logs to &lt;code&gt;stdout&lt;/code&gt;&lt;/strong&gt; — &lt;code&gt;stdout&lt;/code&gt; is strictly reserved for JSON-RPC messages in stdio MCP servers; send all diagnostics to &lt;code&gt;stderr&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Links &amp;amp; Open Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository (MIT):&lt;/strong&gt; &lt;a href="https://github.com/guillaumefric0-del/cosmescan-mcp" rel="noopener noreferrer"&gt;https://github.com/guillaumefric0-del/cosmescan-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm Package:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/cosmescan-mcp" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/cosmescan-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Glama Verified Listing:&lt;/strong&gt; &lt;a href="https://glama.ai/mcp/servers/guillaumefric0-del/cosmescan-mcp" rel="noopener noreferrer"&gt;https://glama.ai/mcp/servers/guillaumefric0-del/cosmescan-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web App &amp;amp; Open API Docs:&lt;/strong&gt; &lt;a href="https://cosmescan.com/api-docs/" rel="noopener noreferrer"&gt;https://cosmescan.com/api-docs/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2026 Counterfeit &amp;amp; Recall Open Study:&lt;/strong&gt; &lt;a href="https://cosmescan.com/observatory-2026/" rel="noopener noreferrer"&gt;https://cosmescan.com/observatory-2026/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback, PRs, and new brand decoding rules are always welcome!&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>node</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
