Skip to main content

The model-context access tool for agents and humans

Project description

mcat-cli

The model-context access tool for agents and humans.

mcat is a concise CLI for:

  • OAuth authorization against MCP servers
  • MCP session initialization
  • tool listing/calling
  • resource listing/reading
  • prompt listing/fetching

Install

pip install mcat-cli

Requires Python 3.11+.

Quick Start

  1. Start OAuth authorization:
mcat auth start https://your-mcp-server.example/mcp \
  -k token.json \
  --state auth.json

This returns a pending result with action details (URL/code).
Use --wait if you want to block until completion.

  1. Complete authorization and store token:
mcat auth continue --state auth.json -k token.json

If token.json already exists, add -o/--overwrite.

  1. Initialize an MCP session:
mcat init https://your-mcp-server.example/mcp -k token.json -o session.json
  1. Call MCP tools/resources/prompts:
mcat tool list -s session.json
mcat tool call my_tool -i '{"foo":"bar"}' -s session.json

mcat resource list -s session.json
mcat resource list-template -s session.json
mcat resource read my://resource -s session.json

mcat prompt list -s session.json
mcat prompt get summarize -i '{"topic":"release notes"}' -s session.json

KEY_REF Formats

-k/--key-ref accepts:

  • env://VAR
  • .env://path:VAR
  • .env://:VAR (shortcut for .env://.env:VAR)
  • json://path
  • bare file path (same as json://path)

For auth flows, token output is written back to --key-ref.

  • Missing destination is allowed (first-time auth).
  • Existing destination requires -o/--overwrite.

OAuth Client Config (Optional)

mcat auth start accepts optional client configuration inputs:

  • -c/--client path/to/client-info.json
  • --client-id
  • --client-secret
  • --client-name

Resolution order is deterministic:

  1. CLI overrides
  2. --client JSON file
  3. Built-in defaults

If a resolved client_id exists, mcat uses static client mode and skips dynamic registration. If no client_id is resolved, mcat attempts dynamic registration once using resolved client_name (--client-name > client.name > default).

--key-ref remains token storage only. Client config is not read from key-ref.

Example client info files:

{"name":"Codex"}
{
  "id": "abc123",
  "secret": "env://FIGMA_CLIENT_SECRET",
  "scope": "mcp:connect",
  "resource": "https://mcp.figma.com/mcp"
}

Validation rules:

  • name conflicts with id/secret.
  • --client-name conflicts with --client-id/--client-secret.
  • secret (or --client-secret) requires id (or --client-id).

Output Contract

Most commands write compact JSON to stdout:

{"ok":true,"result":{}}
{"ok":false,"error":"message"}

Exception: mcat resource read ... -o - writes decoded bytes to stdout.

Logging

Logs are opt-in:

mcat --log auth --log-stderr auth start ...
mcat --log app --log mcp --log-file mcat.log tool list -s session.json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcat_cli-0.1.6.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcat_cli-0.1.6-py3-none-any.whl (30.8 kB view details)

Uploaded Python 3

File details

Details for the file mcat_cli-0.1.6.tar.gz.

File metadata

  • Download URL: mcat_cli-0.1.6.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcat_cli-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c389f38a8de8bd4b57632417c67f44b0e4869b3d9460dfc7a741eb85120801a9
MD5 fe3a2e2bcbeb45dbe11f62f5a5e53548
BLAKE2b-256 5936fa8b4c33010e55ccce978482fd125501756dc6847868c8eb402a909e4b95

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcat_cli-0.1.6.tar.gz:

Publisher: publish.yml on briceyan/mcat-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcat_cli-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: mcat_cli-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 30.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcat_cli-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 73a4c7b3dfd5e97f1c52cd4f9610ca9bee77008a2ce5149d5738bdb75ce772c0
MD5 5ca6f9819e4766345fba0c739daaaa84
BLAKE2b-256 179f04feaa6edc655dc2ca6bf9a3cccf10c24bd40d4eb90c0f5ffb9d241a6ee3

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcat_cli-0.1.6-py3-none-any.whl:

Publisher: publish.yml on briceyan/mcat-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page