The model-context access tool for agents and humans
Project description
mcat-cli
The model-context access tool for agents and humans.
mcat works with MCP servers through two file types:
- connection file: pre-init connection state (
-c, --connection) - session file: initialized MCP session state (
-s, --session)
Install
pip install mcat-cli
uv tool install mcat-cli
Requires Python 3.11+.
Command Summary
bridge start|stop|status: bridge a local stdio MCP server to HTTPauth: start or resume HTTP OAuth authorizationinit: initialize an MCP session from a connection filetool/resource/prompt: use server capabilities through a session file
Typical Flows
HTTP + Human
Authorize and block until the browser flow finishes:
mcat auth https://mcp.example.com/mcp \
-c prod.connection.json \
-k prod.token.json \
--complete
Initialize a session:
mcat init -c prod.connection.json -s prod.session.json
Use the session:
mcat tool list -s prod.session.json
mcat resource list -s prod.session.json
mcat prompt list -s prod.session.json
HTTP + Agent
Create or resume the connection without blocking:
mcat auth https://mcp.example.com/mcp \
-c prod.connection.json \
-k prod.token.json
The command returns JSON with result.action.url. Send that URL to the user.
After the browser step finishes, complete the stored flow:
mcat auth -c prod.connection.json --complete
Then initialize:
mcat init -c prod.connection.json -s prod.session.json
HTTP + Container / Callback Proxy
If the browser cannot reach the loopback callback listener directly, provide:
--callback URL: the public callback URL used in the OAuth authorization request--listen ADDR: wheremcatlistens locally for the forwarded callback (PORTorHOST:PORT)
Example:
mcat auth https://mcp.example.com/mcp \
-c prod.connection.json \
-k prod.token.json \
--callback https://auth-proxy.example.com/callback \
--listen 0.0.0.0:43123
The callback bridge should forward the raw callback query string to the local listener started by mcat.
STDIO + Human or Agent
Start a local stdio-to-HTTP bridge and record it in a connection file:
mcat bridge start -c local.connection.json -- codex mcp-server
Or pin the local HTTP port:
mcat bridge start -c local.connection.json --port 6010 -- codex mcp-server
Initialize and use the session:
mcat init -c local.connection.json -s local.session.json
mcat tool list -s local.session.json
Stop the bridge:
mcat bridge stop -c local.connection.json
Connection Files
Connection files are explicit JSON/JSON5 state shared across commands.
For HTTP connections they store:
- endpoint
- key reference
- current OAuth flow state
- callback/listener details when needed
For stdio connections they store:
- local bridge endpoint
- bridge process details
init reads the connection file so you do not need to repeat endpoint or token settings after auth or bridge start.
Sessions
init writes a session file:
mcat init -c prod.connection.json -s prod.session.json
All capability commands reuse that same file:
mcat tool call TOOL_NAME -i '{"key":"value"}' -s prod.session.json
mcat resource read RESOURCE_URI -s prod.session.json
mcat prompt get PROMPT_NAME -s prod.session.json -i '{"arg":"value"}'
Tokens and Secrets
Tokens and secrets can be specified with -k, --key-ref using:
env://VAR.env://path:VAR.env://:VARjson://pathpath(same asjson://path)
Notes:
authwrites the token back to--key-ref- existing destinations need
-o, --overwrite env://is read-only for writes
OAuth Client Information
Use client config when a provider expects a specific OAuth client.
auth supports:
--client CLIENT_INFO_FILE--client-id ID--client-secret KEY_SPEC--client-name NAME
Resolution order:
- CLI overrides
--clientfile- built-in defaults
Modes:
- static client mode: resolved
client_idpresent - dynamic registration mode: no resolved
client_id, uses resolvedclient_name
Validation:
nameconflicts withid/secret--client-nameconflicts with--client-id/--client-secretsecretrequiresid
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"}
When auth is pending, the result includes the browser action URL and the connection file path.
Resource output modes:
mcat resource read ... -s session.json: JSON resultmcat resource read ... -s session.json -o file.bin: save decoded content to file + JSON metadatamcat resource read ... -s session.json -o -: write decoded bytes to stdout
When logging is enabled, logs go to stderr by default. If you pass --log-output, logs go to that file instead.
Logging
-v sets the default log level for standard modules. --log overrides specific modules.
Use -v for info logs and -vv for debug logs:
mcat -v auth ...
Write logs to a file instead:
mcat -v --log-output mcat.log auth ...
Override specific module levels when needed:
mcat -v --log auth:debug,mcp:debug auth ...
Logging options are global and must be placed before the command name.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcat_cli-0.2.0.tar.gz.
File metadata
- Download URL: mcat_cli-0.2.0.tar.gz
- Upload date:
- Size: 123.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17a1bf6555edcf1523e40384e0fa9c5e187fa29fdddaa639e0e66018893b4b3f
|
|
| MD5 |
c8456c20f773cab6417c0af946bd122c
|
|
| BLAKE2b-256 |
bec1ebd755ab9a622a27850b41ce7efa1f481e305cef4795b350a9e9664e91ab
|
Provenance
The following attestation bundles were made for mcat_cli-0.2.0.tar.gz:
Publisher:
publish.yml on briceyan/mcat-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcat_cli-0.2.0.tar.gz -
Subject digest:
17a1bf6555edcf1523e40384e0fa9c5e187fa29fdddaa639e0e66018893b4b3f - Sigstore transparency entry: 1216688410
- Sigstore integration time:
-
Permalink:
briceyan/mcat-cli@00fcdc6bbac10ca5e616889da8290fae9f5c99ac -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/briceyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@00fcdc6bbac10ca5e616889da8290fae9f5c99ac -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcat_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcat_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 44.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
daf945ee85522fc6683c72e7bc825d631ff507bded73e521a76479c49a8d1b8a
|
|
| MD5 |
b21ec9cf7f4b8227ef4400dbc93cb147
|
|
| BLAKE2b-256 |
d2cb0d282831b19a4b3c6366371040cc000770f2341a43fed73c09d79e574eb2
|
Provenance
The following attestation bundles were made for mcat_cli-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on briceyan/mcat-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcat_cli-0.2.0-py3-none-any.whl -
Subject digest:
daf945ee85522fc6683c72e7bc825d631ff507bded73e521a76479c49a8d1b8a - Sigstore transparency entry: 1216688465
- Sigstore integration time:
-
Permalink:
briceyan/mcat-cli@00fcdc6bbac10ca5e616889da8290fae9f5c99ac -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/briceyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@00fcdc6bbac10ca5e616889da8290fae9f5c99ac -
Trigger Event:
push
-
Statement type: