@modeltoolsprotocol/mtpcli
v1.3.4
Published
The command-line interface for the [Model Tools Protocol](https://github.com/modeltoolsprotocol/modeltoolsprotocol) (MTP). Discover, authenticate, and bridge tools that implement the `--mtp-describe` convention.
Readme
mtpcli
The command-line interface for the Model Tools Protocol (MTP). Discover, authenticate, and bridge tools that implement the --mtp-describe convention.
CLI tools are composable but not LLM-discoverable. MCP tools are discoverable but not composable. MTP bridges the gap with a single --mtp-describe flag. mtpcli turns any --mtp-describe CLI into an MCP server, turns any MCP server into a composable CLI, and handles discovery, auth, and validation along the way. See the protocol README for the full rationale.
Install
npm install -g @modeltoolsprotocol/mtpcliUsage
Serve CLI tools over MCP
Any CLI that supports --mtp-describe becomes an MCP server:
$ mtpcli serve --tool atlasctl --tool mytool
mtpcli serve: serving 6 tool(s) from 2 CLI tool(s)
- atlasctl__confluence page get
- atlasctl__config set
- atlasctl__config get
- mytool__convert
...Drop it into your Claude Desktop config and it works like any other MCP server. The bridge reads --mtp-describe, translates commands to MCP tools, and shells out to the real CLI when the host calls a tool.
Wrap an MCP server as a CLI
Atlassian ships an MCP server at mcp.atlassian.com. With mtpcli wrap, it's a CLI:
# Discover what tools the server offers
$ mtpcli wrap --url "https://mcp.atlassian.com/v1/mcp" --mtp-describe
# Fetch a Confluence page
$ mtpcli wrap --url "https://mcp.atlassian.com/v1/mcp" \
getConfluencePage -- --cloudId "$CLOUD_ID" --pageId 12345 --contentFormat markdown
# Pipe it into jq, grep, or anything else
$ mtpcli wrap --url "https://mcp.atlassian.com/v1/mcp" \
getConfluencePage -- --cloudId "$CLOUD_ID" --pageId 12345 --contentFormat markdown \
| jq -r '.body'
# Works with stdio servers too
$ mtpcli wrap --server "npx @mcp/server-github" --mtp-describeThe 2,500+ MCP servers people have built? They're all CLI tools now. Pipe their output, use them in scripts, compose them with other tools.
Search for tools and commands
# Search specific tools
mtpcli search "convert files" -- filetool mytool
# Search all cached tools
mtpcli search "deploy"
# Scan PATH for describe-compatible tools and search
mtpcli search --scan-path "git commit"Authenticate with a tool
# OAuth2 login (opens browser, handles callback)
mtpcli auth login mytool
# API key / bearer token login
mtpcli auth login mytool --token sk-xxx
# Check auth status
mtpcli auth status mytool
# Inject token into env
eval $(mtpcli auth env mytool)
# Log out
mtpcli auth logout mytoolSee AUTH.md for details on token storage, usage patterns, and bridge integration.
Validate a tool's --mtp-describe output
# Validate a tool against the MTP spec
mtpcli validate mytool
# Validate JSON from stdin (for CI)
cat describe.json | mtpcli validate --stdin
# JSON output
mtpcli validate mytool --jsonGenerate shell completions
# Bash
eval $(mtpcli completions bash mytool)
# Zsh
eval $(mtpcli completions zsh mytool)
# Fish
mtpcli completions fish mytool | sourceDescribe self
# mtpcli is itself an MTP-compliant tool
mtpcli --mtp-describeDevelopment
Requires Bun.
# Install dependencies
bun install
# Run tests
bun test
# Type check
bun run typecheck
# Build
bun run buildLicense
Apache-2.0
