CLI Reference
auth
Authenticate and store your API token locally
memctl auth
Store your API token locally so MCP configs only need org and project - no token in project files.
npx memctl authWhat it does
- Prompts for your API URL (defaults to
https://memctl.com/api/v1) - Prompts for your API token (from Settings → API Tokens in the dashboard)
- Verifies the token against the API
- Saves to
~/.memctl/config.json
After authenticating
Your MCP configs no longer need MEMCTL_TOKEN:
{
"mcpServers": {
"memctl": {
"command": "npx",
"args": ["-y", "memctl@latest"],
"env": {
"MEMCTL_ORG": "your-org",
"MEMCTL_PROJECT": "your-project"
}
}
}
}The CLI automatically reads the token from ~/.memctl/config.json when MEMCTL_TOKEN is not set.
Config file
~/.memctl/config.json structure:
{
"profiles": {
"default": {
"token": "mctl_...",
"apiUrl": "https://memctl.com/api/v1"
}
},
"projects": {}
}Resolution order
The CLI resolves credentials in this order:
- Environment variables (
MEMCTL_TOKEN,MEMCTL_ORG,MEMCTL_PROJECT) - Project config from
~/.memctl/config.json(matched by working directory) - Default profile token + env org/project