Skip to main content
Zen MCP is a Model Context Protocol server that enables CLI tools to communicate with each other. Think of it as middleware that can let Claude Code, Gemini CLI, and Codex work together on the same problem.
Real-world use in this project: During documentation expansion (in a conversation lost to folder rename!), we used Zen MCP’s clink function to consult Codex and Gemini for suggestions while working in Claude Code. Multiple AI perspectives in one workflow!

What is Clink?

Clink (CLI + Link) is Zen MCP’s killer feature - it lets one CLI tool spawn and communicate with OTHER CLI tools. Example workflow:
You're in Claude Code → Use clink to ask Gemini CLI for suggestions
→ Gemini's 1M context analyzes your entire codebase
→ Returns insights back to Claude Code
→ You continue in Claude with Gemini's perspective

Why This Matters for Research

  • Large Corpus
  • Cost-Optimized
  • Multi-Perspective
Scenario: Analyzing 50+ papers when your context is limited
  • Claude Code (200K context): Handles detailed analysis of 10-15 papers
  • clink to Gemini CLI (1M context): Analyzes all 50+ papers for patterns
  • Result: Claude Code receives Gemini’s findings and continues synthesis
Perfect for systematic reviews with extensive literature.

From within Claude Code (or any supported CLI), you can:
# Ask Gemini CLI to analyze something
clink gemini "Analyze the entire /literature folder (47 papers).
What are the 5 most common theoretical frameworks?"

# Ask Codex for code generation
clink codex "Generate a Python script to parse all Zotero exports
and create a citation frequency matrix"

# Launch autonomous agent
clink claude --yolo "Review all markdown files in /drafts
and fix citation formatting inconsistently"
What happens:
  1. Your main CLI session stays clean (context not polluted)
  2. The subagent CLI launches in isolated context
  3. It has autonomous permissions (can edit files, use tools)
  4. Results return to your main session
  5. You maintain orchestration control

Real Example: This Documentation Project

The situation: We needed to expand the Implementation section with more CLI tools. The workflow:
  1. Claude Code (me!): Initial research and draft
  2. clink to Codex: “What CLI tools should researchers know about?”
  3. clink to Gemini: “Compare Gemini CLI vs OpenCode - which fits Research Memex philosophy?”
  4. Back to Claude Code: Synthesized their suggestions into final guides
Result: The “Agentic AI Tools” section you’re reading now! Gemini CLI and OpenCode guides were informed by multi-AI consultation.

Setup & Installation

Prerequisites:
  • Claude Code, Gemini CLI, or Codex installed
  • Node.js and npm
Install Zen MCP:
npm install -g @beehiveinnovations/zen-mcp-server
Configure in Claude Code: Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
  "mcpServers": {
    "zen": {
      "command": "npx",
      "args": ["-y", "@beehiveinnovations/zen-mcp-server"]
    }
  }
}
Restart Claude Code and you’ll have access to:
  • clink - Launch other CLI tools
  • chat - Multi-model consultation
  • consensus - Get multiple AI opinions
  • thinkdeep - Multi-stage reasoning
  • codereview - Systematic code analysis
  • And 10+ more tools!

Use Cases for Research

1. Literature Corpus Analysis

Problem: You have 60 papers but Claude Code’s 200K context can only handle ~15 at once. Solution:
In Claude Code:
"I need to analyze all papers in /literature for common themes.
Use clink to spawn Gemini CLI (1M context) to process the full
corpus, then return the top 5 themes with paper citations."
Gemini handles the volume, Claude synthesizes the insights!

2. Cost-Optimized Workflows

Problem: Premium Claude usage adds up for large projects. Solution:
Phase 1 (Exploration): clink gemini --free-tier
"Scan all papers and identify which ones mention 'organizational learning'"

Phase 2 (Analysis): Stay in Claude Code
"Now analyze ONLY the 12 papers Gemini identified, extract frameworks"

Phase 3 (Synthesis): Claude Code (your expertise)
"Build theoretical model from the extracted frameworks"
Use free/cheap models for filtering, premium for thinking!

3. Multi-AI Peer Review

Problem: You want multiple perspectives on your analysis. Solution:
Main analysis in Claude Code → clink to ask:
- Gemini: "What alternative interpretations exist?"
- Codex: "How would you structure this data pipeline?"
- Back to Claude: Synthesize the peer perspectives
Different AIs have different “personalities” and training - leverage that diversity!

Advanced: The Consensus Tool

Zen MCP includes a consensus tool that automatically consults multiple models and synthesizes their views:
In Claude Code:
"Use consensus tool with Gemini, Codex, and GPT-5 to evaluate:
Should we use qualitative or quantitative methods for this
research question? Get all three perspectives."
Result: You get majority opinion, minority views, and synthesis - like having an AI committee! Perfect for methodological decisions.

Limitations & Considerations

Context Isolation:
  • Clink subagents start FRESH (no memory of your main conversation)
  • You need to provide sufficient context in the clink prompt
  • Results come back as text (not live conversation)
Cost:
  • Clink to paid models (GPT-5, Claude) uses YOUR API keys/credits
  • Gemini free tier: 60 req/min, 1,000/day limit
  • Monitor usage across all spawned agents!
Permissions:
  • Clink agents can have --yolo mode (auto-approve everything)
  • Great for delegation, risky for critical files
  • Use with care!

When to Use Zen MCP vs. Regular Tools

Use Zen MCP when:
  • ✅ You need perspectives from multiple AI models
  • ✅ Task exceeds your current CLI’s context window
  • ✅ You want to delegate heavy work without polluting main context
  • ✅ You need cost optimization (mix free + premium)
  • ✅ You want automated consensus building
Stick to regular tools when:
  • ❌ Single AI is sufficient
  • ❌ Task is small and contained
  • ❌ You don’t need context isolation
  • ❌ Adding orchestration overhead isn’t worth it

Zen MCP in the Research Memex Workflow

This tool embodies interpretive orchestration at the AI layer:
  • You (human) orchestrate Claude Code
  • Claude Code orchestrates other AI agents via clink
  • Each AI contributes its strengths
  • You maintain final judgment and synthesis
It’s orchestration all the way down! 🐢✨

Resources


This page was informed by clink! In a lost conversation (folder rename casualty), we used Zen MCP to consult Codex and Gemini about which CLI tools to include in this documentation. Their suggestions shaped the “Agentic AI Tools” section!Meta-note: An AI (Claude) writing about using Zen MCP to ask other AIs (Codex, Gemini) for advice about documenting AI tools. Recursion achieved. 🌀

← Back to Advanced Topics
I