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 CLI to interact with MCP servers from an endpoint.

mcat provides:

  • auth start: start authorization and return action details (URL/code)
  • auth continue: resume a paused auth flow
  • init: run MCP initialize and store session info
  • tool / resource / prompt: access server capabilities

Install

Example install commands:

pip install mcat-cli
uv tool install mcat-cli

Requires Python 3.11+.

Typical Flow

  1. Start auth (non-blocking):
mcat auth start https://mcp.example.com/mcp \
  -k token.json \
  --state auth.json
  1. Continue auth after browser approval:
mcat auth continue --state auth.json -k token.json
  1. Initialize MCP session:
mcat init https://mcp.example.com/mcp -k token.json -o session.json
  1. Discover and use server utilities:
mcat tool list -s session.json
mcat tool call TOOL_NAME -i '{"key":"value"}' -s session.json

mcat resource list -s session.json
mcat resource read RESOURCE_URI -s session.json

mcat prompt list -s session.json
mcat prompt get PROMPT_NAME -s session.json -i '{"arg":"value"}'

If you are a human using the CLI directly, add --wait to auth start:

mcat auth start https://mcp.example.com/mcp -k token.json --state auth.json --wait

Tokens and secrets

Tokens and secrets can be specified by -k/--key-ref and KEY_SPEC using these patterns:

  • env://VAR
  • .env://path:VAR
  • .env://:VAR (same as .env://.env:VAR)
  • json://path
  • path (same as json://path)

Notes:

  • auth writes token back to --key-ref
  • existing destination needs -o/--overwrite
  • env:// is read-only for writes

Examples:

  • Existing token/PAT in environment variable:
mcat init https://mcp.example.com/mcp -k env://MCP_TOKEN -o session.json
  • Existing token/PAT in .env file:
mcat init https://mcp.example.com/mcp -k .env://.env:MCP_TOKEN -o session.json

For GitHub MCP usage, if you already have a GitHub PAT, you can reference it from env://... or .env://... directly.

Provide OAuth Client Information

Use client config when a provider expects a specific OAuth client (for example, pre-registered client settings in services like Linear, or enterprise OAuth setups).

auth start supports:

  • -c/--client CLIENT_INFO_FILE
  • --client-id ID
  • --client-secret KEY_SPEC
  • --client-name NAME

Resolution order:

  1. CLI overrides
  2. --client file
  3. built-in defaults

Modes:

  • static client mode: resolved client_id present
  • dynamic registration mode: no resolved client_id, uses resolved client_name

Validation:

  • name conflicts with id/secret
  • --client-name conflicts with --client-id/--client-secret
  • secret requires id

Example client file (dynamic registration):

{"name":"your-public-client-name"}

Example client file (static client):

{
  "id": "your-client-id",
  "secret": "env://OAUTH_CLIENT_SECRET",
  "scope": "mcp:connect",
  "resource": "https://mcp.example.com/mcp"
}

Output

Most commands emit JSON to stdout:

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

Resource output modes:

  • mcat resource read ... -s session.json: JSON result
  • mcat resource read ... -s session.json -o file.bin: save decoded content to file + JSON metadata
  • mcat resource read ... -s session.json -o -: write decoded bytes to stdout

When logging is enabled, log output is sent to stderr by default.

Logging

If something goes wrong, enable logs for auth, mcp, and app:

mcat --log auth --log mcp --log app --log-stderr auth start ...

To include HTTP request/response bodies, use :debug level:

mcat --log auth:debug --log mcp:debug --log app:debug --log-stderr auth start ...

Logging options are global options and must be placed before the command name.

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.7.tar.gz (46.5 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.7-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcat_cli-0.1.7.tar.gz
  • Upload date:
  • Size: 46.5 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.7.tar.gz
Algorithm Hash digest
SHA256 907c737d4f16c26b2d9473cf0516ff044c00e02e1c2242cfef39fa90a8f1c2bf
MD5 f11fde431f04177f16c75d39ae9b9ee6
BLAKE2b-256 8f0c673de378909d4e63a7f9f7c640d03157e89dab5c63a7e1f2d6ec8f988d16

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcat_cli-0.1.7.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.7-py3-none-any.whl.

File metadata

  • Download URL: mcat_cli-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 34.5 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7d680171ea66b57bf3493012a07243b572b2466335a4f4fce37624fc9ca8fb22
MD5 becc0846f1ba8ab06bc3f15a82c2864b
BLAKE2b-256 e1a38cbefc433e86a702d8ba43b97f00a486feaf645634a0fa57141f4ed45104

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcat_cli-0.1.7-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