<?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: kgma-glitch</title>
    <description>The latest articles on DEV Community by kgma-glitch (@kgmaglitch).</description>
    <link>https://dev.to/kgmaglitch</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%2F4266364%2Fb75559f4-7bf3-405c-82b7-8fc2db35e68a.png</url>
      <title>DEV Community: kgma-glitch</title>
      <link>https://dev.to/kgmaglitch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kgmaglitch"/>
    <language>en</language>
    <item>
      <title>Create campaign short links from AI with LinkDevi's open-source MCP server</title>
      <dc:creator>kgma-glitch</dc:creator>
      <pubDate>Thu, 26 Nov 2026 08:44:18 +0000</pubDate>
      <link>https://dev.to/kgmaglitch/create-campaign-short-links-from-ai-with-linkdevis-open-source-mcp-server-5bjd</link>
      <guid>https://dev.to/kgmaglitch/create-campaign-short-links-from-ai-with-linkdevis-open-source-mcp-server-5bjd</guid>
      <description>&lt;p&gt;Creating campaign links often means repeating the same work: add UTMs for each channel, shorten the destinations, generate a QR image, then keep a record of what was created.&lt;/p&gt;

&lt;p&gt;We're sharing &lt;strong&gt;LinkDevi MCP&lt;/strong&gt;, an MIT-licensed local connector that exposes that workflow to AI clients supporting MCP over stdio.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://github.com/kgma-glitch/linkdevi-mcp" rel="noopener noreferrer"&gt;https://github.com/kgma-glitch/linkdevi-mcp&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/@kgma/linkdevi-mcp" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/@kgma/linkdevi-mcp&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Setup guide:&lt;/strong&gt; &lt;a href="https://linkdevi.com/features/ai" rel="noopener noreferrer"&gt;https://linkdevi.com/features/ai&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: this is our own project, and this article was prepared with AI assistance. The connector code is open source. Using the hosted LinkDevi service requires an account and scoped API key, and your plan's quotas and request limits apply.&lt;/p&gt;
&lt;h2&gt;
  
  
  What the connector can do
&lt;/h2&gt;

&lt;p&gt;The first release exposes six 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;capabilities&lt;/td&gt;
&lt;td&gt;Read workspace limits, stored-link usage, granted scopes and metric definitions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;preview_campaign&lt;/td&gt;
&lt;td&gt;Inspect exact UTM destinations and the number of link slots needed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;create_campaign&lt;/td&gt;
&lt;td&gt;Create one saved campaign link per selected channel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;list_campaigns&lt;/td&gt;
&lt;td&gt;Find existing saved campaigns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;link_qr&lt;/td&gt;
&lt;td&gt;Render a PNG QR image for an existing workspace link&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;campaign_stats&lt;/td&gt;
&lt;td&gt;Read lifetime recorded redirect counters with explicit limitations&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;It connects to the same campaign service used by the LinkDevi website. You can return to the website to manage the saved campaign.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Install and create a scoped key
&lt;/h2&gt;

&lt;p&gt;You'll need Node.js 22 or newer. Check the package without entering a key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx --yes @kgma/linkdevi-mcp@0.1.1 --help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sign in to &lt;a href="https://linkdevi.com/register" rel="noopener noreferrer"&gt;LinkDevi&lt;/a&gt;, open &lt;strong&gt;Connect AI&lt;/strong&gt;, and create a key with &lt;code&gt;links:read&lt;/code&gt; and &lt;code&gt;links:write&lt;/code&gt; for the campaign workflow. Use only &lt;code&gt;links:read&lt;/code&gt; for a read-only connection.&lt;/p&gt;

&lt;p&gt;Keep the real key in your client's protected settings. Don't put it in a prompt, a public configuration file, or a Git commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Configure your MCP client
&lt;/h2&gt;

&lt;p&gt;For a client using the &lt;code&gt;mcpServers&lt;/code&gt; configuration format:&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;"linkdevi"&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;"--yes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"@kgma/linkdevi-mcp@0.1.1"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"LINKDEVI_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_SCOPED_KEY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"LINKDEVI_BASE_URL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://linkdevi.com"&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;Restart the connection after saving. Configuration locations vary by client; it must support launching a local stdio process. The README includes local installation and Windows guidance. This release does not provide a hosted OAuth MCP endpoint.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Preview before creating
&lt;/h2&gt;

&lt;p&gt;Try a request such as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Preview a campaign for &lt;a href="https://example.com/sale" rel="noopener noreferrer"&gt;https://example.com/sale&lt;/a&gt; called December launch, with Facebook, LINE and print channels. Show the exact destinations and quota cost before creating anything.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The AI can check &lt;code&gt;capabilities&lt;/code&gt; and call &lt;code&gt;preview_campaign&lt;/code&gt;. After you review the result, it can call &lt;code&gt;create_campaign&lt;/code&gt; using arguments like these:&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;"requestId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"a43c37c0-350a-44ef-9d40-a5900c246891"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"December launch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://example.com/sale"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"utmCampaign"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"december-launch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"domain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"linkdevi.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"channels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"facebook"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"line"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"print"&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;Three channels consume three stored-link slots. A preview does not reserve quota. Supported channels are Facebook, Instagram, TikTok, LINE, email, print, YouTube and X.&lt;/p&gt;

&lt;p&gt;Use a new UUID for a new creation intent. If a response is lost, retry with the &lt;strong&gt;same requestId and identical payload&lt;/strong&gt;. Reusing the ID with different content conflicts; the connector does not automatically retry ambiguous requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the counters mean
&lt;/h2&gt;

&lt;p&gt;The campaign report exposes best-effort lifetime redirect counts. They include bots and link previews. They are not unique people, date-based activity, conversions or revenue, and missing channel records are reported as unavailable.&lt;/p&gt;

&lt;p&gt;The QR tool renders an image for an existing link using its saved short domain; it does not create a separate saved QR resource.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running the source tests
&lt;/h2&gt;

&lt;p&gt;Download or clone the public repository, then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm ci
npm &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The tests exercise the official MCP SDK, input validation, retry identity, credential transport restrictions, error handling, and a packed installation running through its actual executable. Fixture tests do not call a model provider or create production customer data.&lt;/p&gt;

&lt;p&gt;The connector itself doesn't invoke an LLM. Your chosen AI client's model costs are separate from the LinkDevi service limits.&lt;/p&gt;

&lt;p&gt;If you try it, a useful first contribution is a reproducible setup issue or a small improvement to the workflow. &lt;a href="https://github.com/kgma-glitch/linkdevi-mcp/issues" rel="noopener noreferrer"&gt;Open an issue on GitHub&lt;/a&gt;, leaving out real keys and customer data.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>opensource</category>
      <category>javascript</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
