Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables interaction with Claude and Gemini command-line tools through the MCP protocol, allowing users to send prompts to either or both LLMs and receive responses.

README.md

MCP LLM Server

A Model Context Protocol (MCP) server that provides tools to interact with Claude and Gemini CLI tools. This server enables seamless integration between MCP-compatible clients and command-line interfaces for Claude and Gemini LLMs.

Overview

This MCP server acts as a bridge between MCP clients and the Claude and Gemini command-line interfaces. It exposes three main tools that allow you to send prompts to these LLMs and receive responses through the standardized MCP protocol.

Prerequisites

  • Python 3.10 or higher
  • Claude CLI installed and configured
  • Gemini CLI installed and configured
  • uv package manager

Installation

# Clone the repository
git clone https://github.com/straygizmo/mcp_llm_cli
cd mcp_llm_cli

# Install dependencies using uv
uv sync

Usage

Configuration for MCP Clients

To use this server with an MCP client (like Claude Desktop), add it to your MCP configuration file:

{
  "mcpServers": {
    "llm-server": {
      "command": "uv",
      "args": ["run", "python", "-m", "mcp_llm_server.server"],
      "cwd": "/path/to/mcp_llm_cli"
    }
  }
}

Available Tools

The server provides three tools for interacting with LLMs:

1. claude_prompt

Send a prompt to Claude and receive a response.

Parameters:

  • prompt (string, required): The prompt to send to Claude

Example: ``json { "name": "claude_prompt", "arguments": { "prompt": "Explain quantum computing in simple terms" } } ``

2. gemini_prompt

Send a prompt to Gemini and receive a response.

Parameters:

  • prompt (string, required): The prompt to send to Gemini

Example: ``json { "name": "gemini_prompt", "arguments": { "prompt": "What are the benefits of renewable energy?" } } ``

3. llm_prompt

Send a prompt to both Claude and Gemini simultaneously and receive both responses.

Parameters:

  • prompt (string, required): The prompt to send to both LLMs

Example: ``json { "name": "llm_prompt", "arguments": { "prompt": "Compare and contrast machine learning and deep learning" } } ``

The response will include both Claude's and Gemini's answers in a formatted output.

Architecture

The server is built using the Model Context Protocol (MCP) framework and consists of:

  • Main Server (server.py): Handles MCP protocol communication and tool execution
  • Async subprocess execution: Calls Claude and Gemini CLIs asynchronously
  • Error handling: Gracefully handles missing CLI tools and execution errors

Development

Project Structure

mcp_llm_cli/
├── README.md
├── pyproject.toml
├── uv.lock
└── src/
    └── mcp_llm_server/
        ├── __init__.py
        └── server.py

Running in Development

For development, you can run the server with logging enabled:

uv run -m mcp_llm_server.server

Error Handling

The server handles various error scenarios:

  • Missing CLI tools (claude or gemini-cli not installed)
  • CLI execution errors
  • Invalid tool names
  • Malformed requests

All errors are returned as formatted text responses to maintain compatibility with MCP clients.

License

[Specify your license here]

Contributing

[Add contribution guidelines if applicable]

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use AI & ML servers.