@prereason/mcp 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +32 -6
- package/bin/{cli.mjs → cli.js} +19 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.3 (2026-02-21)
|
|
4
|
+
|
|
5
|
+
- Add `PREREASON_API_KEY` environment variable support (fixes Windows `cmd.exe` quoting crash)
|
|
6
|
+
- Add `PREREASON_URL` environment variable for custom endpoint
|
|
7
|
+
- Update all config examples to use `env` block (matches Stripe/Supabase pattern)
|
|
8
|
+
- `--header` CLI args still supported for backward compatibility
|
|
9
|
+
|
|
10
|
+
## 0.1.2 (2026-02-21)
|
|
11
|
+
|
|
12
|
+
- Fix Windows path resolution issue in Claude Desktop (rename `.mjs` → `.js` bin entry)
|
|
13
|
+
- Add Windows troubleshooting section in README
|
|
14
|
+
|
|
3
15
|
## 0.1.1 (2026-02-21)
|
|
4
16
|
|
|
5
17
|
- Add MIT LICENSE file
|
package/README.md
CHANGED
|
@@ -18,10 +18,10 @@ Add to your `claude_desktop_config.json`:
|
|
|
18
18
|
"mcpServers": {
|
|
19
19
|
"prereason": {
|
|
20
20
|
"command": "npx",
|
|
21
|
-
"args": [
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
21
|
+
"args": ["-y", "@prereason/mcp"],
|
|
22
|
+
"env": {
|
|
23
|
+
"PREREASON_API_KEY": "YOUR_API_KEY"
|
|
24
|
+
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -102,6 +102,29 @@ Once connected, ask Claude:
|
|
|
102
102
|
- Restart Claude Desktop after editing config
|
|
103
103
|
- Verify JSON syntax: `node -e "JSON.parse(require('fs').readFileSync('path/to/config','utf8'))"`
|
|
104
104
|
|
|
105
|
+
### Windows: "'C:\Program' is not recognized"
|
|
106
|
+
|
|
107
|
+
If you still see this error, ensure you're using the `env` block (not `--header` args) as shown in Quick Start above. If the issue persists, install globally and use `node`:
|
|
108
|
+
|
|
109
|
+
1. Run: `npm install -g @prereason/mcp`
|
|
110
|
+
2. Use this config (replace `YOUR_USER` with your Windows username):
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"mcpServers": {
|
|
115
|
+
"prereason": {
|
|
116
|
+
"command": "node",
|
|
117
|
+
"args": [
|
|
118
|
+
"C:\\Users\\YOUR_USER\\AppData\\Roaming\\npm\\node_modules\\@prereason\\mcp\\bin\\cli.js"
|
|
119
|
+
],
|
|
120
|
+
"env": {
|
|
121
|
+
"PREREASON_API_KEY": "YOUR_API_KEY"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
105
128
|
### Auth errors on get_context / get_metric
|
|
106
129
|
- `list_templates`, `list_metrics`, and `get_health` work without a key
|
|
107
130
|
- `get_context` and `get_metric` require a valid API key
|
|
@@ -132,11 +155,14 @@ claude mcp add prereason --transport http https://api.prereason.com/api/mcp
|
|
|
132
155
|
## CLI Usage
|
|
133
156
|
|
|
134
157
|
```bash
|
|
135
|
-
#
|
|
158
|
+
# Using environment variable (recommended)
|
|
159
|
+
PREREASON_API_KEY=pr_live_... npx @prereason/mcp
|
|
160
|
+
|
|
161
|
+
# Using --header flag (backward compatible)
|
|
136
162
|
npx @prereason/mcp --header "Authorization:Bearer YOUR_API_KEY"
|
|
137
163
|
|
|
138
164
|
# Custom URL
|
|
139
|
-
|
|
165
|
+
PREREASON_URL=https://custom.endpoint/mcp npx @prereason/mcp
|
|
140
166
|
|
|
141
167
|
# Help
|
|
142
168
|
npx @prereason/mcp --help
|
package/bin/{cli.mjs → cli.js}
RENAMED
|
@@ -4,13 +4,17 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Connects Claude Desktop (stdio) to PreReason's Streamable HTTP MCP endpoint.
|
|
6
6
|
*
|
|
7
|
+
* Auth (preferred — works on all platforms):
|
|
8
|
+
* Set PREREASON_API_KEY env var in your MCP client config.
|
|
9
|
+
*
|
|
7
10
|
* Usage:
|
|
11
|
+
* npx @prereason/mcp
|
|
8
12
|
* npx @prereason/mcp [--header Key:Value]...
|
|
9
13
|
* npx @prereason/mcp <URL> [--header Key:Value]...
|
|
10
14
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
15
|
+
* Environment variables:
|
|
16
|
+
* PREREASON_API_KEY Your API key (adds Authorization: Bearer header)
|
|
17
|
+
* PREREASON_URL Override the default endpoint URL
|
|
14
18
|
*/
|
|
15
19
|
|
|
16
20
|
import { createRequire } from 'node:module';
|
|
@@ -25,8 +29,11 @@ if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
|
25
29
|
const pkg = require('../package.json');
|
|
26
30
|
process.stderr.write(`${pkg.name} v${pkg.version}\n\n`);
|
|
27
31
|
process.stderr.write('Usage:\n');
|
|
28
|
-
process.stderr.write(' npx @prereason/mcp
|
|
29
|
-
process.stderr.write(' npx @prereason/mcp
|
|
32
|
+
process.stderr.write(' npx @prereason/mcp\n');
|
|
33
|
+
process.stderr.write(' npx @prereason/mcp [--header Key:Value]...\n\n');
|
|
34
|
+
process.stderr.write('Environment variables (recommended):\n');
|
|
35
|
+
process.stderr.write(' PREREASON_API_KEY Your API key (adds Authorization: Bearer header)\n');
|
|
36
|
+
process.stderr.write(' PREREASON_URL Override the default endpoint URL\n\n');
|
|
30
37
|
process.stderr.write('Options:\n');
|
|
31
38
|
process.stderr.write(' --header Key:Value Add HTTP header (can be repeated)\n');
|
|
32
39
|
process.stderr.write(' --help, -h Show this help\n');
|
|
@@ -42,10 +49,15 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) {
|
|
|
42
49
|
process.exit(0);
|
|
43
50
|
}
|
|
44
51
|
|
|
45
|
-
// ---
|
|
46
|
-
let urlArg = DEFAULT_URL;
|
|
52
|
+
// --- Read environment variables (preferred, avoids Windows cmd.exe quoting issues) ---
|
|
53
|
+
let urlArg = process.env.PREREASON_URL || DEFAULT_URL;
|
|
47
54
|
const headers = {};
|
|
48
55
|
|
|
56
|
+
if (process.env.PREREASON_API_KEY) {
|
|
57
|
+
headers['Authorization'] = `Bearer ${process.env.PREREASON_API_KEY}`;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// --- Parse CLI arguments (override env vars) ---
|
|
49
61
|
for (let i = 2; i < process.argv.length; i++) {
|
|
50
62
|
if (process.argv[i] === '--header' && process.argv[i + 1]) {
|
|
51
63
|
const val = process.argv[++i];
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prereason/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Connect Claude Desktop to PreReason's Bitcoin & macro data API via MCP",
|
|
6
6
|
"bin": {
|
|
7
|
-
"prereason-mcp": "./bin/cli.
|
|
7
|
+
"prereason-mcp": "./bin/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin",
|