← Discover MCPs and Agents
l
MCPAI & MLGitHub

llm-cli

Command-line interface for querying large language models

Links

README

From the repo.

llm-cli

license status python pypi downloads

Command-line interface for querying large language models

table of contents

install

pip install llm-cli

usage

# basic query
llm-cli "explain recursion in python"

# specify model
llm-cli --model gpt-4 "write a haiku about debugging"

# streaming output
llm-cli --stream "tell me a story"

# read from stdin
cat input.txt | llm-cli --stdin

# save to file
llm-cli "generate test data" > output.json

# set temperature
llm-cli --temperature 0.2 "what is 2+2"

# multi-line input
llm-cli --multiline
> first line
> second line
> ^D

api

command-line options

flagdescriptiondefault
--model, -mmodel to usegpt-3.5-turbo
--temperature, -tsampling temperature (0.0-2.0)0.7
--max-tokensmaximum response length2048
--stream, -sstream output token by tokenfalse
--stdinread prompt from stdinfalse
--multilineenable multi-line input modefalse
--systemsystem promptnull
--api-keyapi key (or use env var)$LLM_API_KEY

environment variables

export LLM_API_KEY="your-api-key"
export LLM_DEFAULT_MODEL="gpt-4"
export LLM_API_BASE="https://api.openai.com/v1"

configuration file

Create ~/.llm-cli/config.json:

{
  "default_model": "gpt-3.5-turbo",
  "temperature": 0.7,
  "max_tokens": 2048,
  "api_key": "your-api-key"
}

supported models

  • OpenAI: gpt-4, gpt-3.5-turbo
  • Anthropic: claude-3-opus, claude-3-sonnet
  • Local: ollama/llama2, ollama/mistral

contributing

prs welcome. open an issue first for big changes.

license

MIT

Collected info

  • 11 stars
  • Language: Python
  • Source updated: 5/20/2026

Config for your environment

Replace {MCP_ENDPOINT_URL} with this MCP’s endpoint URL (from its repo or docs above). No API key — you connect directly.

Tool

OS

Config file: ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp-server": {
      "url": "{MCP_ENDPOINT_URL}"
    }
  }
}

Paste into mcpServers in the config file. Restart Cursor after saving.

If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.