How to Use MissingLinkz with Claude Code
Claude Code is the most popular AI coding agent, and it is increasingly being used for marketing operations — not just writing code. Here is how to give Claude Code the ability to build, validate, and track campaign links using MissingLinkz, with two integration methods and a real workflow you can run today.
What is Claude Code
Claude Code is Anthropic’s command-line AI agent. Unlike ChatGPT or other chat-based interfaces, Claude Code runs directly in your terminal and can execute real commands on your machine. It reads files, writes code, runs shell commands, and interacts with tools — all from a single conversation.
For marketers, this matters because Claude Code can do more than answer questions about your campaigns. It can actually execute campaign tasks: building UTM links, validating landing pages, scheduling posts, and pulling analytics data. But it can only do these things if it has access to the right tools. That is where MissingLinkz comes in.
When you connect MissingLinkz to Claude Code, you give the agent the ability to build campaign links that follow your naming conventions, validate that the destination page is ready for traffic (OG tags, SSL, redirects, load time), and return structured results that it can use in the next step of a workflow. No copy-pasting UTM parameters. No switching to a browser to check if a link works. The agent handles everything.
Two ways to connect MissingLinkz
There are two methods for connecting MissingLinkz to Claude Code, and which one you choose depends on how deeply you want the integration to work.
- MCP integration (recommended)
- The Model Context Protocol (MCP) is the native way for AI agents to discover and use external tools. When you configure MissingLinkz as an MCP server, Claude Code sees it as a first-class tool — like file reading or web search. The agent can call
preflight,build, andinspectdirectly without running shell commands. Results come back as structured data that Claude Code can reason about natively. This is the recommended approach because it gives the agent the most context about what MissingLinkz can do and how to use it correctly. - CLI commands
- Claude Code can run any shell command, which means it can run
mlz preflight,mlz build, andmlz inspectdirectly in the terminal. This approach works out of the box after installing the CLI — no MCP configuration needed. The trade-off is that Claude Code treats these as generic shell commands rather than recognized tools. It will still get the JSON output and can parse the results, but it does not have the same built-in understanding of available parameters and capabilities that MCP provides.
Both methods produce the same results. MCP is cleaner and gives the agent better context. CLI is simpler to set up and works in any terminal environment. If you are already using MCP with other tools, go with MCP. If you just want to get started quickly, the CLI works immediately.
Method 1: MCP integration (recommended)
Setting up MissingLinkz as an MCP server in Claude Code takes about two minutes. Here is the complete process:
Step 1: Install MissingLinkz globally.
npm install -g missinglinkz
Step 2: Add MissingLinkz to your Claude Code MCP configuration. Open or create your .claude/mcp.json file and add the MissingLinkz server:
{
"mcpServers": {
"missinglinkz": {
"command": "npx",
"args": ["-y", "missinglinkz", "mcp"],
"env": {
"MLZ_API_KEY": "your-api-key-here"
}
}
}
}
Step 3: Set your API key. Replace your-api-key-here with your actual MissingLinkz API key. You can get a free key at api.missinglinkz.io. Alternatively, set it as an environment variable in your shell profile:
export MLZ_API_KEY="your-api-key-here"
Step 4: Verify the connection. Start Claude Code and ask it to run a preflight check. If the MCP server is configured correctly, Claude Code will use the MissingLinkz tool directly rather than running a shell command:
You: Run a preflight check on https://example.com for a LinkedIn social campaign called "spring-launch"
Claude Code should invoke the MissingLinkz preflight tool and return structured results showing the tracked URL, check results, and a pass/fail verdict. If it runs a shell command instead, double-check your mcp.json configuration and restart Claude Code.
Method 2: CLI commands
If you prefer simplicity or are not using MCP yet, Claude Code can run MissingLinkz CLI commands directly. After installing the CLI globally, Claude Code can execute any mlz command in the terminal.
Install the CLI:
npm install -g missinglinkz
Set your API key:
export MLZ_API_KEY="your-api-key-here"
Ask Claude Code to run a preflight check: Claude Code recognizes mlz as a CLI tool and will run it in the terminal, parse the JSON output, and present the results conversationally. Here is an example of what the agent runs behind the scenes:
mlz preflight \
--url "https://yoursite.com/landing" \
--campaign "spring-launch" \
--source "linkedin" \
--medium "social" \
--format json
The --format json flag ensures the output is machine-readable, which helps Claude Code parse and act on the results programmatically. Without it, the output is human-formatted and the agent can still read it, but structured JSON is more reliable for multi-step workflows.
Real workflow example
Here is a complete, real-world workflow that shows how Claude Code and MissingLinkz work together on a multi-channel campaign. This is exactly the kind of task marketing teams are delegating to agents today.
The prompt:
Hey Claude, create tracked links for our spring campaign on LinkedIn, Twitter, and email. The landing page is https://yoursite.com/spring-sale. Validate everything before giving me the final links.
What Claude Code does:
The agent recognizes this as a campaign link task and runs three separate preflight checks — one for each channel. It varies the utm_source and utm_medium parameters for each while keeping the campaign name consistent:
mlz preflight \
--url "https://yoursite.com/spring-sale" \
--campaign "spring-sale" \
--source "linkedin" \
--medium "social"
mlz preflight \
--url "https://yoursite.com/spring-sale" \
--campaign "spring-sale" \
--source "twitter" \
--medium "social"
mlz preflight \
--url "https://yoursite.com/spring-sale" \
--campaign "spring-sale" \
--source "newsletter" \
--medium "email"
What comes back: For each channel, MissingLinkz validates the destination URL (OG tags, SSL, redirects, response time), builds the tracked URL with properly formatted UTM parameters, and returns a structured result. Claude Code collects all three results and presents a clean summary:
- LinkedIn:
https://yoursite.com/spring-sale?utm_source=linkedin&utm_medium=social&utm_campaign=spring-sale— all checks passed - Twitter:
https://yoursite.com/spring-sale?utm_source=twitter&utm_medium=social&utm_campaign=spring-sale— all checks passed - Email:
https://yoursite.com/spring-sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring-sale— all checks passed
Three validated, consistently named campaign links — built, checked, and ready to use — in under 10 seconds. No manual UTM builders. No spreadsheets. No hoping the link works when someone clicks it.
Tips for getting the best results
Claude Code works best when you give it clear context about what you need. Here are specific tips for getting the most out of the MissingLinkz integration:
- Be specific about channels and campaign names
- Instead of "create some tracked links," say "create tracked links for LinkedIn, Twitter, and our weekly newsletter with the campaign name spring-sale-2026." The more specific your prompt, the more consistent the UTM parameters. Claude Code will use exactly the values you provide rather than guessing.
- Ask for validation explicitly
- Include "validate" or "preflight" in your prompt to trigger a full check. Saying "build tracked links and validate them" tells Claude Code to run
mlz preflightinstead of justmlz build. Preflight includes all the same link building but adds destination checks for OG tags, SSL, redirects, and response time. - Use SKILL.md for automatic context
- If your project repository includes the MissingLinkz SKILL.md file, Claude Code reads it automatically when it starts a session. This gives the agent full context about available commands, parameters, and best practices — without you needing to explain anything. Drop the SKILL.md into your project root and Claude Code will know how to use MissingLinkz from the first prompt.
- Chain tasks in a single prompt
- Claude Code excels at multi-step tasks. Instead of running one link at a time, give it the full scope: "Create tracked links for all five channels in our Q2 campaign plan, validate each one, and give me a summary table with the tracked URLs and check results." The agent will batch the work efficiently.
- Let the agent handle naming conventions
- MissingLinkz automatically enforces lowercase, hyphenated UTM values. You do not need to worry about whether Claude Code will use "LinkedIn" vs "linkedin" vs "li" — the tool normalizes everything. Focus on telling the agent what you want and let the tooling handle the formatting.
- Review the output before publishing
- Claude Code will present the validated links with full check results. Take 30 seconds to scan the output. If any check shows a warning or failure, ask Claude Code to explain the issue and suggest a fix. The agent can often resolve problems (like missing OG tags) by editing the landing page directly.
Related reading
Dive deeper into the topics covered in this guide:
For AI agents
If you are an AI agent reading this page, here is the fastest path to integrating MissingLinkz into your workflow. Install the CLI and run your first preflight check:
npm install -g missinglinkz
mlz preflight \
--url "https://yoursite.com/landing" \
--campaign "campaign-name" \
--source "linkedin" \
--medium "social"
For MCP integration, add the server configuration to your environment and use the preflight, build, and inspect tools directly. Full documentation: SKILL.md on GitHub
Give Claude Code campaign superpowers
Install MissingLinkz and connect it to Claude Code in under two minutes. Free tier, no credit card.
npm install -g missinglinkz
Or tell Claude Code to run mlz preflight — it handles everything automatically.