Skip to content
This repository was archived by the owner on Jul 8, 2026. It is now read-only.

Commit 535795a

Browse files
Merge pull request #144 from useshortcut/amcd/handle-gemini-token-issue
Support alternative token name.
2 parents 1b1b7e3 + dc0b8e5 commit 535795a

3 files changed

Lines changed: 66 additions & 4 deletions

File tree

README.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,64 @@ The MCP server for [Shortcut](https://shortcut.com).
1414

1515
## Usage
1616

17+
The only required input is your Shortcut API token. You can find it in your [Shortcut account settings](https://app.shortcut.com/settings/account/api-tokens).
18+
19+
Once you have a valid token, you can pass it to the MCP server as an environement variable or a CLI argument.
20+
21+
Examples:
22+
23+
```json
24+
"shortcut": {
25+
"command": "npx",
26+
"args": [
27+
"-y",
28+
"@shortcut/mcp@latest"
29+
],
30+
"env": {
31+
"SHORTCUT_API_TOKEN": "<YOUR_SHORTCUT_API_TOKEN>"
32+
}
33+
}
34+
```
35+
36+
```json
37+
"shortcut": {
38+
"command": "npx",
39+
"args": [
40+
"-y",
41+
"@shortcut/mcp@latest",
42+
"SHORTCUT_API_TOKEN=<YOUR_SHORTCUT_API_TOKEN>"
43+
]
44+
}
45+
```
46+
47+
Due to an issue in `gemini-cli` that redacts environment variables that contain the word "token", you can also use the alternative name `SHORTCUT_API_TKN` instead of `SHORTCUT_API_TOKEN`. This works for both the environment variable and the CLI argument:
48+
49+
```json
50+
"shortcut": {
51+
"command": "npx",
52+
"args": [
53+
"-y",
54+
"@shortcut/mcp@latest"
55+
],
56+
"env": {
57+
"SHORTCUT_API_TKN": "<YOUR_SHORTCUT_API_TOKEN>"
58+
}
59+
}
60+
```
61+
62+
```json
63+
"shortcut": {
64+
"command": "npx",
65+
"args": [
66+
"-y",
67+
"@shortcut/mcp@latest",
68+
"SHORTCUT_API_TKN=<YOUR_SHORTCUT_API_TOKEN>"
69+
]
70+
}
71+
```
72+
73+
For more information on how to setup the MCP for your tool of choice, see below.
74+
1775
### Windsurf
1876

1977
See the [official Windsurf docs](https://docs.windsurf.com/windsurf/cascade/mcp) for more information.
@@ -71,7 +129,6 @@ See the [official Claude Code docs](https://docs.anthropic.com/en/docs/claude-co
71129
Add the MCP server from the command line:
72130

73131
```shell
74-
# Grab your Shortcut token here: https://app.shortcut.com/settings/account/api-tokens
75132
claude mcp add shortcut --transport stdio -e SHORTCUT_API_TOKEN=$SHORTCUT_API_TOKEN -- npx -y @shortcut/mcp@latest
76133
```
77134

@@ -319,6 +376,10 @@ You can also check the list of [common issues](#common-issues) below to see if t
319376

320377
### Common Issues and Solutions
321378

379+
#### MCP fails on startup in Gemini CLI
380+
381+
If you are using the Gemini CLI and the MCP fails with the following error: `✕ Error during discovery for MCP server 'shortcut': MCP error -32000: Connection closed`, it might be due to an issue in Gemini where it redacts environment variables that contain the word `token`. You can either pass the Shortcut token as a CLI argument, or use the alternative name `SHORTCUT_API_TKN` instead of `SHORTCUT_API_TOKEN`. See the [Usage section](#usage) for more information.
382+
322383
#### NPX command not working when using MISE for version management
323384

324385
If you are using MISE for managing Node and NPM versions, you may encounter a "Client closed" error when trying to run the MCP server. Installing this extension into your IDE might help: https://github.com/hverlin/mise-vscode/.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shortcut/mcp",
3-
"version": "0.19.0",
3+
"version": "0.20.0",
44
"description": "Shortcut MCP Server",
55
"keywords": [
66
"shortcut",

src/server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { TeamTools } from "./tools/teams";
1212
import { UserTools } from "./tools/user";
1313
import { WorkflowTools } from "./tools/workflows";
1414

15-
let apiToken = process.env.SHORTCUT_API_TOKEN;
15+
let apiToken = process.env.SHORTCUT_API_TKN || process.env.SHORTCUT_API_TOKEN;
1616
let isReadonly = process.env.SHORTCUT_READONLY === "true";
1717
let enabledTools = (process.env.SHORTCUT_TOOLS || "")
1818
.split(",")
@@ -25,6 +25,7 @@ if (process.argv.length >= 3) {
2525
.slice(2)
2626
.map((arg) => arg.split("="))
2727
.forEach(([name, value]) => {
28+
if (name === "SHORTCUT_API_TKN") apiToken = value;
2829
if (name === "SHORTCUT_API_TOKEN") apiToken = value;
2930
if (name === "SHORTCUT_READONLY") isReadonly = value === "true";
3031
if (name === "SHORTCUT_TOOLS")
@@ -36,7 +37,7 @@ if (process.argv.length >= 3) {
3637
}
3738

3839
if (!apiToken) {
39-
console.error("SHORTCUT_API_TOKEN is required");
40+
console.error("A Shortcut api token is required.");
4041
process.exit(1);
4142
}
4243

0 commit comments

Comments
 (0)