Metadata-Version: 2.4
Name: mcp-cli-skill
Version: 0.2.0
Summary: Call any MCP server tool from the command line with shell composition support
Project-URL: Homepage, https://github.com/wise-toddler/mcp-cli-skill
Project-URL: Repository, https://github.com/wise-toddler/mcp-cli-skill
Author-email: Shivansh Singh <wiseeldrich2004@gmail.com>
License-Expression: MIT
Keywords: agent,cli,mcp,model-context-protocol,skills
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# mcp-cli

Call any MCP server tool from the command line with shell composition support.

## Install

```bash
# As a CLI tool (recommended)
pipx install mcp-cli-skill

# Or run directly without installing
uvx mcp-cli-skill --servers

# As a Claude Code skill
npx skills add wise-toddler/mcp-cli-skill -g
```

## Usage

```bash
mcp-call --servers                          # list configured servers
mcp-call <server> --tools                   # discover tools
mcp-call <server> <tool> --key=value ...    # call a tool
```

## Server Management

Config stored at `~/.mcp-cli/servers.json`. On first run, auto-seeds from `~/.claude/settings.json` and `~/.claude.json`. Supports both **stdio** and **HTTP** MCP transports.

```bash
mcp-call --add myserver uvx some-mcp --env API_KEY=abc123
mcp-call --add-http myapi http://localhost:8010/mcp
mcp-call --remove myserver
mcp-call --sync    # re-sync from Claude configs
```

## Why?

MCP tool calls can't use shell composition. This CLI lets agents (or you) use:

- File content as args: `--query="$(cat /tmp/query.sql)"`
- Pipe output: `| jq '.results'`
- Shell variables: `--name="$VAR"`
- Chaining: `cmd1 && cmd2`

## Examples

```bash
mcp-call redash redash_query \
  --action=adhoc --query="$(cat /tmp/q.sql)" --data_source_id=1

mcp-call slack slack_chat \
  --action=post --channel=C123 --text="$(cat /tmp/msg.txt)"

mcp-call redash redash_query \
  --action=list --page_size=5 | jq '.results[].name'
```

## Requirements

- Python 3.10+

## How it works

Reads MCP server config from `~/.mcp-cli/servers.json` (standalone, agent-agnostic). On first run, seeds from `~/.claude/settings.json` and `~/.claude.json`. For stdio servers, spawns the server as a subprocess and speaks JSON-RPC over stdin/stdout. For HTTP servers, sends JSON-RPC over HTTP with session ID tracking. Zero dependencies — pure Python stdlib.
