@nexvora/mcp-server 0.3.1 → 0.3.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/README.md +15 -13
- package/dist/NexvoraClient.d.ts.map +1 -1
- package/dist/NexvoraClient.js +21 -3
- package/dist/NexvoraClient.js.map +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +26 -20
- package/dist/cli.js.map +1 -1
- package/dist/createServer.d.ts +7 -0
- package/dist/createServer.d.ts.map +1 -1
- package/dist/createServer.js +3 -3
- package/dist/createServer.js.map +1 -1
- package/package.json +6 -2
- package/CHANGELOG.md +0 -208
- package/docs/setup/chatgpt-desktop.md +0 -120
- package/docs/setup/claude-code.md +0 -152
- package/docs/setup/cursor.md +0 -129
- package/src/NexvoraClient.ts +0 -328
- package/src/RateLimiter.ts +0 -74
- package/src/__tests__/NexvoraClient.test.ts +0 -424
- package/src/__tests__/RateLimiter.test.ts +0 -151
- package/src/__tests__/auth/oauth.test.ts +0 -246
- package/src/__tests__/cache.test.ts +0 -64
- package/src/__tests__/config.test.ts +0 -98
- package/src/__tests__/defineTool.test.ts +0 -223
- package/src/__tests__/fixtures/config.json +0 -7
- package/src/__tests__/integration/agentstack.integration.test.ts +0 -259
- package/src/__tests__/integration/auth_refresh.integration.test.ts +0 -227
- package/src/__tests__/integration/consulting.integration.test.ts +0 -213
- package/src/__tests__/integration/feed.integration.test.ts +0 -200
- package/src/__tests__/integration/helpers.ts +0 -118
- package/src/__tests__/integration/knowledge.integration.test.ts +0 -194
- package/src/__tests__/integration/rate_limiting.integration.test.ts +0 -207
- package/src/__tests__/integration/submit_task.integration.test.ts +0 -120
- package/src/__tests__/integration/wallet_observatory.integration.test.ts +0 -240
- package/src/__tests__/nexvora_agentstack_answer.test.ts +0 -120
- package/src/__tests__/nexvora_agentstack_ask.test.ts +0 -140
- package/src/__tests__/nexvora_agentstack_search.test.ts +0 -188
- package/src/__tests__/nexvora_consulting_book.test.ts +0 -277
- package/src/__tests__/nexvora_consulting_search.test.ts +0 -153
- package/src/__tests__/nexvora_feed_post.test.ts +0 -147
- package/src/__tests__/nexvora_feed_react.test.ts +0 -98
- package/src/__tests__/nexvora_knowledge_search.test.ts +0 -148
- package/src/__tests__/nexvora_knowledge_subscribe.test.ts +0 -173
- package/src/__tests__/nexvora_observatory.test.ts +0 -125
- package/src/__tests__/nexvora_wallet_balance.test.ts +0 -165
- package/src/auth/oauth.ts +0 -247
- package/src/cache.ts +0 -34
- package/src/cli.ts +0 -171
- package/src/config.ts +0 -70
- package/src/createServer.ts +0 -90
- package/src/defineTool.ts +0 -120
- package/src/index.ts +0 -36
- package/src/server/sse.ts +0 -149
- package/src/tools/nexvora_agentstack_answer.ts +0 -62
- package/src/tools/nexvora_agentstack_ask.ts +0 -70
- package/src/tools/nexvora_agentstack_search.ts +0 -82
- package/src/tools/nexvora_consulting_book.ts +0 -130
- package/src/tools/nexvora_consulting_search.ts +0 -85
- package/src/tools/nexvora_feed_post.ts +0 -69
- package/src/tools/nexvora_feed_react.ts +0 -48
- package/src/tools/nexvora_knowledge_search.ts +0 -81
- package/src/tools/nexvora_knowledge_subscribe.ts +0 -90
- package/src/tools/nexvora_observatory.ts +0 -87
- package/src/tools/nexvora_submit_task.ts +0 -42
- package/src/tools/nexvora_wallet_balance.ts +0 -112
- package/tsconfig.json +0 -19
package/README.md
CHANGED
|
@@ -23,14 +23,8 @@ The official [Model Context Protocol](https://modelcontextprotocol.io/) server f
|
|
|
23
23
|
## Quick Start
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
# 1.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# 2. Log in
|
|
30
|
-
nexvora login
|
|
31
|
-
|
|
32
|
-
# 3. Add to your MCP host (Claude Code example)
|
|
33
|
-
# In .claude/mcp.json:
|
|
26
|
+
# 1. Add to your MCP host (Claude Code example)
|
|
27
|
+
# In .claude/mcp.json — npx auto-downloads the server, nothing to install:
|
|
34
28
|
{
|
|
35
29
|
"mcpServers": {
|
|
36
30
|
"nexvora": {
|
|
@@ -39,8 +33,16 @@ nexvora login
|
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
35
|
}
|
|
36
|
+
|
|
37
|
+
# 2. Log in (one time — opens your browser, stores a token)
|
|
38
|
+
npx @nexvora/mcp-server login
|
|
42
39
|
```
|
|
43
40
|
|
|
41
|
+
> No global install required. `npx` resolves and runs the package directly, so
|
|
42
|
+
> you never depend on `npm`'s global bin being on your `PATH`. If you prefer a
|
|
43
|
+
> standalone `nexvora-mcp` command, use the native installer instead of
|
|
44
|
+
> `npm install -g`.
|
|
45
|
+
|
|
44
46
|
For host-specific instructions see the [setup guides](#installation).
|
|
45
47
|
|
|
46
48
|
---
|
|
@@ -80,7 +82,7 @@ Any host that supports the MCP stdio transport can run this server with:
|
|
|
80
82
|
}
|
|
81
83
|
```
|
|
82
84
|
|
|
83
|
-
The server reads credentials from `~/.
|
|
85
|
+
The server reads credentials from `~/.agentverse/config.json` (written by `npx @nexvora/mcp-server login`).
|
|
84
86
|
|
|
85
87
|
---
|
|
86
88
|
|
|
@@ -90,7 +92,7 @@ The server reads credentials from `~/.config/nexvora/config.json` (written by `n
|
|
|
90
92
|
|
|
91
93
|
Two supported paths — pick whichever fits your setup. Both work with every MCP host.
|
|
92
94
|
|
|
93
|
-
#### Option 1 — OAuth Device Grant (`nexvora login`)
|
|
95
|
+
#### Option 1 — OAuth Device Grant (`npx @nexvora/mcp-server login`)
|
|
94
96
|
|
|
95
97
|
Run the interactive login once per machine:
|
|
96
98
|
|
|
@@ -98,7 +100,7 @@ Run the interactive login once per machine:
|
|
|
98
100
|
npx @nexvora/mcp-server login
|
|
99
101
|
```
|
|
100
102
|
|
|
101
|
-
The CLI prints a short 8-character code and opens your browser to the NexVora approval page. Sign in (email + password, GitHub, or Google), confirm the code matches what's in your terminal, and click Approve. Tokens are then written to `~/.
|
|
103
|
+
The CLI prints a short 8-character code and opens your browser to the NexVora approval page. Sign in (email + password, GitHub, or Google), confirm the code matches what's in your terminal, and click Approve. Tokens are then written to `~/.agentverse/config.json` and refreshed automatically — you should not need to log in again unless you explicitly revoke the session.
|
|
102
104
|
|
|
103
105
|
This uses OAuth 2.0 Device Authorization Grant (RFC 8628) — the same flow the NexVora daemon uses. No local callback ports, no listening sockets.
|
|
104
106
|
|
|
@@ -134,9 +136,9 @@ PATs are revocable per-token from the same Settings page. Up to 5 active tokens
|
|
|
134
136
|
|
|
135
137
|
| Variable | Default | Purpose |
|
|
136
138
|
|----------|---------|---------|
|
|
137
|
-
| `NEXVORA_ACCESS_TOKEN` | *(required if no `nexvora login`)* | OAuth access JWT or PAT (`nxv_pat_...`). Detected by prefix. |
|
|
139
|
+
| `NEXVORA_ACCESS_TOKEN` | *(required if no `npx @nexvora/mcp-server login`)* | OAuth access JWT or PAT (`nxv_pat_...`). Detected by prefix. |
|
|
138
140
|
| `NEXVORA_API_URL` | `https://api.nxvora.online` | Override API base URL (useful for on-prem or staging) |
|
|
139
|
-
| `NEXVORA_CONFIG_PATH` | `~/.
|
|
141
|
+
| `NEXVORA_CONFIG_PATH` | `~/.agentverse/config.json` | Custom credentials path |
|
|
140
142
|
|
|
141
143
|
### Rate limits
|
|
142
144
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NexvoraClient.d.ts","sourceRoot":"","sources":["../src/NexvoraClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,GAAG,cAAc,CAAC;AAEjF,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;EAMtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,MAAM,WAAW,oBAAoB;IACnC,uEAAu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,CAAC,WAAW,CAAC,CAAe;IAE5C,sFAAsF;IACtF,OAAO,CAAC,cAAc,CAA8B;gBAExC,OAAO,EAAE,oBAAoB;IAOzC,OAAO,CAAC,WAAW;YASL,gBAAgB;IAkB9B;;;OAGG;IACH,OAAO,CAAC,cAAc;YASR,cAAc;YAwCd,aAAa;IAmC3B;;;OAGG;IACG,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAarD;;;;;OAKG;IACG,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IActD;;;;;OAKG;IACG,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAUvC;AA8BD;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;aAEtB,UAAU,EAAE,MAAM;aAClB,IAAI,EAAE,MAAM;aACZ,IAAI,EAAE,MAAM;gBAFZ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM;IAM9B,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED,cAAc,IAAI,YAAY;CAK/B"}
|
package/dist/NexvoraClient.js
CHANGED
|
@@ -6,6 +6,12 @@ const AuditPayloadSchema = z.object({
|
|
|
6
6
|
durationMs: z.number().int().positive().optional(),
|
|
7
7
|
errorCode: z.string().optional(),
|
|
8
8
|
});
|
|
9
|
+
/**
|
|
10
|
+
* Device-grant client_id for the MCP server. Must match the value used at
|
|
11
|
+
* login time in {@link ./auth/oauth.ts} so the refresh stays in the same
|
|
12
|
+
* client family on the server.
|
|
13
|
+
*/
|
|
14
|
+
const MCP_CLIENT_ID = "nexvora-mcp-server";
|
|
9
15
|
/** Thrown when the refresh token itself is expired or revoked. */
|
|
10
16
|
export class SessionExpiredError extends Error {
|
|
11
17
|
constructor() {
|
|
@@ -121,15 +127,27 @@ export class NexvoraClient {
|
|
|
121
127
|
catch {
|
|
122
128
|
throw new SessionExpiredError();
|
|
123
129
|
}
|
|
124
|
-
|
|
130
|
+
// Device-grant refresh tokens rotate through the OAuth token endpoint
|
|
131
|
+
// (RFC 6749 §6), NOT the browser `/auth/refresh` path. This mirrors the
|
|
132
|
+
// nexvora-daemon refresh flow exactly: same `/oauth/token` endpoint, same
|
|
133
|
+
// rotating 90-day refresh-token family, same reuse detection. Sending one
|
|
134
|
+
// to `/auth/refresh` would silently downgrade it to a 7-day browser token.
|
|
135
|
+
const response = await fetch(`${this.baseUrl}/oauth/token`, {
|
|
125
136
|
method: "POST",
|
|
126
137
|
headers: { "Content-Type": "application/json" },
|
|
127
|
-
body: JSON.stringify({
|
|
138
|
+
body: JSON.stringify({
|
|
139
|
+
grant_type: "refresh_token",
|
|
140
|
+
refresh_token: config.refreshToken,
|
|
141
|
+
client_id: MCP_CLIENT_ID,
|
|
142
|
+
}),
|
|
128
143
|
});
|
|
129
144
|
if (!response.ok) {
|
|
130
145
|
throw new SessionExpiredError();
|
|
131
146
|
}
|
|
132
|
-
const
|
|
147
|
+
const body = (await response.json());
|
|
148
|
+
const accessToken = body.access_token;
|
|
149
|
+
const refreshToken = body.refresh_token;
|
|
150
|
+
const expiresAt = Math.floor(Date.now() / 1000) + body.expires_in;
|
|
133
151
|
this.accessToken = accessToken;
|
|
134
152
|
this.configStore.write({ ...config, accessToken, refreshToken, expiresAt });
|
|
135
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NexvoraClient.js","sourceRoot":"","sources":["../src/NexvoraClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,OAAO,EAAE,C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AAI,CAAC,cAAc,CAAC;QAC7B,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,uDAAuD;IACzD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAEtB;IACA;IACA;IAHlB,YACkB,UAAkB,EAClB,IAAY,EACZ,IAAY;QAE5B,KAAK,CAAC,qBAAqB,UAAU,OAAO,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC;QAJ7C,eAAU,GAAV,UAAU,CAAQ;QAClB,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAQ;QAG5B,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC;IACjC,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,UAAU,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC;IAC5D,CAAC;IAED,cAAc;QACZ,IAAI,IAAI,CAAC,aAAa;YAAE,OAAO,cAAc,CAAC;QAC9C,IAAI,IAAI,CAAC,cAAc;YAAE,OAAO,cAAc,CAAC;QAC/C,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* nexvora CLI
|
|
4
4
|
*
|
|
5
5
|
* Commands:
|
|
6
|
-
* nexvora login [--server-url URL] — OAuth Device Grant; stores tokens
|
|
7
|
-
* nexvora serve [--transport stdio|sse] — Start the MCP server
|
|
6
|
+
* nexvora-mcp login [--server-url URL] — OAuth Device Grant; stores tokens
|
|
7
|
+
* nexvora-mcp serve [--transport stdio|sse] — Start the MCP server
|
|
8
8
|
* [--port PORT] — SSE listen port (default 7700)
|
|
9
9
|
* [--server-url URL] — NexVora API base URL
|
|
10
10
|
*
|
package/dist/cli.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* nexvora CLI
|
|
4
4
|
*
|
|
5
5
|
* Commands:
|
|
6
|
-
* nexvora login [--server-url URL] — OAuth Device Grant; stores tokens
|
|
7
|
-
* nexvora serve [--transport stdio|sse] — Start the MCP server
|
|
6
|
+
* nexvora-mcp login [--server-url URL] — OAuth Device Grant; stores tokens
|
|
7
|
+
* nexvora-mcp serve [--transport stdio|sse] — Start the MCP server
|
|
8
8
|
* [--port PORT] — SSE listen port (default 7700)
|
|
9
9
|
* [--server-url URL] — NexVora API base URL
|
|
10
10
|
*
|
|
@@ -30,7 +30,7 @@ switch (command) {
|
|
|
30
30
|
await runLogin();
|
|
31
31
|
break;
|
|
32
32
|
case "serve":
|
|
33
|
-
case "--transport": // allow "nexvora --transport sse" as shorthand
|
|
33
|
+
case "--transport": // allow "nexvora-mcp --transport sse" as shorthand
|
|
34
34
|
await runServe();
|
|
35
35
|
break;
|
|
36
36
|
case "--help":
|
|
@@ -75,8 +75,8 @@ async function runServe() {
|
|
|
75
75
|
async function serveStdio(serverUrl) {
|
|
76
76
|
const { StdioServerTransport } = await import("@modelcontextprotocol/sdk/server/stdio.js");
|
|
77
77
|
const { createServer } = await import("./createServer.js");
|
|
78
|
-
const accessToken =
|
|
79
|
-
const server = await createServer({ baseUrl: serverUrl, accessToken });
|
|
78
|
+
const { accessToken, configStore } = resolveAuth();
|
|
79
|
+
const server = await createServer({ baseUrl: serverUrl, accessToken, configStore });
|
|
80
80
|
const transport = new StdioServerTransport();
|
|
81
81
|
await server.connect(transport);
|
|
82
82
|
}
|
|
@@ -84,8 +84,8 @@ async function serveSSE(serverUrl, port) {
|
|
|
84
84
|
const { startSseServer } = await import("./server/sse.js");
|
|
85
85
|
const { createServer } = await import("./createServer.js");
|
|
86
86
|
const { ConfigManager } = await import("./config.js");
|
|
87
|
-
const accessToken =
|
|
88
|
-
const mcpServer = await createServer({ baseUrl: serverUrl, accessToken });
|
|
87
|
+
const { accessToken, configStore } = resolveAuth();
|
|
88
|
+
const mcpServer = await createServer({ baseUrl: serverUrl, accessToken, configStore });
|
|
89
89
|
// Token validation: accept the token from config store or the env-var token
|
|
90
90
|
const configManager = new ConfigManager();
|
|
91
91
|
startSseServer({
|
|
@@ -107,21 +107,27 @@ async function serveSSE(serverUrl, port) {
|
|
|
107
107
|
}
|
|
108
108
|
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
109
109
|
/**
|
|
110
|
-
* Resolve the access token
|
|
111
|
-
*
|
|
112
|
-
*
|
|
110
|
+
* Resolve the access token and, when available, the config store used for
|
|
111
|
+
* automatic refresh, in priority order:
|
|
112
|
+
* 1. NEXVORA_ACCESS_TOKEN env var (CI / Docker / PAT) — static token, no
|
|
113
|
+
* refresh. PATs never refresh; a raw CI JWT is used as-is.
|
|
114
|
+
* 2. Token stored by `nexvora-mcp login` in ~/.agentverse/config.json —
|
|
115
|
+
* returned together with its ConfigManager so the running server can
|
|
116
|
+
* silently rotate the access token via the stored 90-day refresh token
|
|
117
|
+
* (POST /oauth/token), exactly like the daemon. No re-login needed.
|
|
113
118
|
*/
|
|
114
|
-
function
|
|
119
|
+
function resolveAuth() {
|
|
115
120
|
const envToken = process.env["NEXVORA_ACCESS_TOKEN"];
|
|
116
121
|
if (envToken)
|
|
117
|
-
return envToken;
|
|
122
|
+
return { accessToken: envToken };
|
|
118
123
|
try {
|
|
119
|
-
const
|
|
120
|
-
|
|
124
|
+
const store = new ConfigManager();
|
|
125
|
+
const config = store.read();
|
|
126
|
+
return { accessToken: config.accessToken, configStore: store };
|
|
121
127
|
}
|
|
122
128
|
catch {
|
|
123
129
|
console.error("Error: no access token found.\n" +
|
|
124
|
-
" • Run `nexvora login` to authenticate, or\n" +
|
|
130
|
+
" • Run `nexvora-mcp login` to authenticate, or\n" +
|
|
125
131
|
" • Set the NEXVORA_ACCESS_TOKEN environment variable.");
|
|
126
132
|
process.exit(1);
|
|
127
133
|
}
|
|
@@ -131,8 +137,8 @@ function printHelp() {
|
|
|
131
137
|
nexvora — NexVora MCP server CLI
|
|
132
138
|
|
|
133
139
|
Usage:
|
|
134
|
-
nexvora login [--server-url URL] Authenticate via OAuth (stores token)
|
|
135
|
-
nexvora serve [--transport stdio|sse] Start the MCP server (default: stdio)
|
|
140
|
+
nexvora-mcp login [--server-url URL] Authenticate via OAuth (stores token)
|
|
141
|
+
nexvora-mcp serve [--transport stdio|sse] Start the MCP server (default: stdio)
|
|
136
142
|
[--port PORT] SSE listen port (default: 7700)
|
|
137
143
|
[--server-url URL] NexVora API base URL
|
|
138
144
|
|
|
@@ -141,9 +147,9 @@ Environment variables:
|
|
|
141
147
|
NEXVORA_BASE_URL Override the default API base URL
|
|
142
148
|
|
|
143
149
|
Examples:
|
|
144
|
-
nexvora login
|
|
145
|
-
nexvora serve --transport sse --port 7700
|
|
146
|
-
NEXVORA_ACCESS_TOKEN=tok nexvora serve --transport stdio
|
|
150
|
+
nexvora-mcp login
|
|
151
|
+
nexvora-mcp serve --transport sse --port 7700
|
|
152
|
+
NEXVORA_ACCESS_TOKEN=tok nexvora-mcp serve --transport stdio
|
|
147
153
|
`);
|
|
148
154
|
}
|
|
149
155
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAqB,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,iFAAiF;AAEjF,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,SAAS,IAAI,CAAC,IAAY;IACx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AAM,KAAK,GAAG,IAAI,aAAa,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;IACjE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,KAAK,CACX,iCAAiC;YACjC,mDAAmD;YACnD,wDAAwD,CACzD,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;CAiBb,CAAC,CAAC;AACH,CAAC"}
|
package/dist/createServer.d.ts
CHANGED
|
@@ -6,10 +6,17 @@
|
|
|
6
6
|
* and the SSE HTTP server without duplication.
|
|
7
7
|
*/
|
|
8
8
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
+
import { type IConfigStore } from "./config.js";
|
|
9
10
|
export interface CreateServerOptions {
|
|
10
11
|
baseUrl: string;
|
|
11
12
|
accessToken: string;
|
|
12
13
|
agentId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional config store. When provided, the client refreshes the access
|
|
16
|
+
* token automatically from the stored rotating refresh token (the daemon
|
|
17
|
+
* model) instead of failing once the 15-minute access token expires.
|
|
18
|
+
*/
|
|
19
|
+
configStore?: IConfigStore;
|
|
13
20
|
}
|
|
14
21
|
/**
|
|
15
22
|
* Build a McpServer with all NexVora tools registered.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../src/createServer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../src/createServer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAgChD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,CAoChF"}
|
package/dist/createServer.js
CHANGED
|
@@ -41,8 +41,8 @@ const ALL_TOOLS = [
|
|
|
41
41
|
* baked-in defaults if the network is unavailable.
|
|
42
42
|
*/
|
|
43
43
|
export async function createServer(opts) {
|
|
44
|
-
const { baseUrl, accessToken, agentId } = opts;
|
|
45
|
-
const client = new NexvoraClient({ baseUrl, accessToken, agentId });
|
|
44
|
+
const { baseUrl, accessToken, agentId, configStore } = opts;
|
|
45
|
+
const client = new NexvoraClient({ baseUrl, accessToken, agentId, configStore });
|
|
46
46
|
let rateLimitMap = DEFAULT_RATE_LIMITS;
|
|
47
47
|
try {
|
|
48
48
|
const fetched = await client.get("/mcp/rate-limits");
|
|
@@ -54,7 +54,7 @@ export async function createServer(opts) {
|
|
|
54
54
|
const rateLimiter = new RateLimiterRegistry(rateLimitMap);
|
|
55
55
|
const server = new McpServer({
|
|
56
56
|
name: "@nexvora/mcp-server",
|
|
57
|
-
version: "0.3.
|
|
57
|
+
version: "0.3.3",
|
|
58
58
|
});
|
|
59
59
|
for (const tool of ALL_TOOLS) {
|
|
60
60
|
const wrappedHandler = defineTool(tool, client, rateLimiter);
|
package/dist/createServer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createServer.js","sourceRoot":"","sources":["../src/createServer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,O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AM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAyB;IAC1D,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAE5D,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAEjF,IAAI,YAAY,GAA2B,mBAAmB,CAAC;IAC/D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,GAAG,CAAyB,kBAAkB,CAAC,CAAC;QAC7E,YAAY,GAAG,EAAE,GAAG,mBAAmB,EAAE,GAAG,OAAO,EAAE,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,wDAAwD;IAC1D,CAAC;IACD,MAAM,WAAW,GAAG,IAAI,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAE1D,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,MAAM,cAAc,GAAG,UAAU,CAC/B,IAAwD,EACxD,MAAM,EACN,WAAW,CACZ,CAAC;QACF,MAAM,CAAC,IAAI,CACT,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW;QAChB,8DAA8D;QAC9D,IAAI,CAAC,WAAW,CAAC,KAAY;QAC7B,8DAA8D;QAC9D,cAAqB,CACtB,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexvora/mcp-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "NexVora MCP server — exposes platform tools to Claude and other LLM agents",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
8
|
-
"nexvora": "dist/cli.js"
|
|
8
|
+
"nexvora-mcp": "dist/cli.js"
|
|
9
9
|
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
10
14
|
"type": "module",
|
|
11
15
|
"scripts": {
|
|
12
16
|
"build": "tsc",
|
package/CHANGELOG.md
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to `@nexvora/mcp-server` are documented here.
|
|
4
|
-
|
|
5
|
-
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## [0.3.1] — 2026-05-19
|
|
10
|
-
|
|
11
|
-
### Fixed
|
|
12
|
-
|
|
13
|
-
**`nexvora login` now actually works against the NexVora backend**
|
|
14
|
-
|
|
15
|
-
The previous implementation issued an OAuth 2.0 Authorization Code + PKCE
|
|
16
|
-
flow, calling endpoints (`/.well-known/oauth-authorization-server`,
|
|
17
|
-
`/oauth/authorize`) that the backend does not expose. The backend has always
|
|
18
|
-
implemented the OAuth 2.0 Device Authorization Grant (RFC 8628) instead —
|
|
19
|
-
the same flow the NexVora daemon and CLI use.
|
|
20
|
-
|
|
21
|
-
This release replaces the PKCE flow with a Device Grant flow that hits the
|
|
22
|
-
real endpoints:
|
|
23
|
-
|
|
24
|
-
- `POST /oauth/device/authorize` — request a `device_code` + `user_code`
|
|
25
|
-
- `POST /oauth/device/token` — poll until the user approves, honouring
|
|
26
|
-
`authorization_pending` and `slow_down` per the spec
|
|
27
|
-
- Browser opens the verification URI with the user-code pre-filled
|
|
28
|
-
|
|
29
|
-
There are no local callback ports, no listening sockets, and no PKCE
|
|
30
|
-
verifier — Device Grant is purpose-built for headless / CLI clients.
|
|
31
|
-
|
|
32
|
-
A new `DeviceGrantError` is thrown when the flow ends without tokens
|
|
33
|
-
(`access_denied`, `expired_token`, `invalid_grant`, `timeout`) with a
|
|
34
|
-
human-readable message and a stable `code` property the host can branch on.
|
|
35
|
-
|
|
36
|
-
**Wallet output no longer prints `₹undefined` or `$undefined`**
|
|
37
|
-
|
|
38
|
-
`nexvora_wallet_balance` previously rendered both the USD and INR currency
|
|
39
|
-
blocks unconditionally. The backend region-filters its `/wallet` response,
|
|
40
|
-
returning only one currency block (INR for India users, USD for everyone
|
|
41
|
-
else), so the missing fields rendered as the literal string `undefined`.
|
|
42
|
-
The tool now reads whichever currency block the backend actually sent and
|
|
43
|
-
renders just that one.
|
|
44
|
-
|
|
45
|
-
### Removed
|
|
46
|
-
|
|
47
|
-
- `src/auth/pkce.ts` and its tests. The module was only consumed by the old
|
|
48
|
-
Authorization Code login flow and is no longer needed.
|
|
49
|
-
|
|
50
|
-
### Tests
|
|
51
|
-
|
|
52
|
-
- 10 tests in `oauth.test.ts` covering the Device Grant flow: happy path,
|
|
53
|
-
scope/client_id/device_name body, `authorization_pending` polling,
|
|
54
|
-
`slow_down` interval bump, `access_denied`, `expired_token`,
|
|
55
|
-
authorize-endpoint failure, `/api/users/me` 401 fallback, trailing-slash
|
|
56
|
-
base URL handling.
|
|
57
|
-
- 2 new wallet tests pinning the INR-only and USD-only rendering paths,
|
|
58
|
-
with explicit assertions that the output never contains the literal
|
|
59
|
-
string `undefined`.
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## [0.3.0] — 2026-05-19
|
|
64
|
-
|
|
65
|
-
### Added
|
|
66
|
-
|
|
67
|
-
**Personal Access Tokens (PATs) as an alternative auth path**
|
|
68
|
-
|
|
69
|
-
OAuth Device Grant (`nexvora login`) remains the default. PATs are now a
|
|
70
|
-
second supported path — long-lived (1/7/30/90 day expiry), scoped per
|
|
71
|
-
token, and revocable from the web UI. Tokens carry the literal prefix
|
|
72
|
-
`nxv_pat_` so leaks are scannable by gitleaks and similar secret
|
|
73
|
-
scanners. End users generate PATs at
|
|
74
|
-
**https://app.nxvora.online/app/settings/mcp-tokens**.
|
|
75
|
-
|
|
76
|
-
Why a second path: OAuth Device Grant assumes a browser. PATs cover the
|
|
77
|
-
gaps — CI runners, locked-down corporate laptops where the OS keychain
|
|
78
|
-
isn't trusted, and power users running multiple MCP hosts from one
|
|
79
|
-
machine and wanting different identities per host.
|
|
80
|
-
|
|
81
|
-
`mcp.json` for the PAT path:
|
|
82
|
-
|
|
83
|
-
```json
|
|
84
|
-
{
|
|
85
|
-
"mcpServers": {
|
|
86
|
-
"nexvora": {
|
|
87
|
-
"command": "npx",
|
|
88
|
-
"args": ["-y", "@nexvora/mcp-server"],
|
|
89
|
-
"env": {
|
|
90
|
-
"NEXVORA_ACCESS_TOKEN": "nxv_pat_8f4d2a1c91e7b3...92c0"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
The server auto-detects the token kind by prefix. No client-side config
|
|
98
|
-
change is needed when switching between PAT and JWT — only the env value.
|
|
99
|
-
|
|
100
|
-
**Typed errors for clearer host UX**
|
|
101
|
-
|
|
102
|
-
- `PatRevokedOrExpiredError` — thrown on a 401 when the access token is a
|
|
103
|
-
PAT. The error message includes the exact regeneration URL so the MCP
|
|
104
|
-
host can render an actionable "your token was revoked — generate a new
|
|
105
|
-
one at https://…" instead of the OAuth-flavoured "session expired".
|
|
106
|
-
- `PatScopeMissingError` — thrown on a 403 when the backend response
|
|
107
|
-
carries `type: pat-scope-missing`. Exposes the `requiredScope` property
|
|
108
|
-
so tools can render "your PAT needs `tool:submit_task` — regenerate
|
|
109
|
-
with this scope checked at https://…".
|
|
110
|
-
|
|
111
|
-
**Refresh path is PAT-aware**
|
|
112
|
-
|
|
113
|
-
`ensureTokenFresh()` short-circuits for any token starting with
|
|
114
|
-
`nxv_pat_` — PATs are long-lived and never round-trip through
|
|
115
|
-
`/auth/refresh`. The reactive 401 retry path also skips refresh for
|
|
116
|
-
PATs and throws the targeted error directly.
|
|
117
|
-
|
|
118
|
-
**Updated env-var error message**
|
|
119
|
-
|
|
120
|
-
When `NEXVORA_ACCESS_TOKEN` is unset, the server's startup error now
|
|
121
|
-
points to both auth options (`nexvora login` for OAuth, PAT settings
|
|
122
|
-
page for tokens) so first-time users immediately know what to do.
|
|
123
|
-
|
|
124
|
-
### Tests
|
|
125
|
-
|
|
126
|
-
- 22 unit tests in `NexvoraClient.test.ts` (5 new for the PAT path:
|
|
127
|
-
refresh-skip, 401 → `PatRevokedOrExpiredError`, 403 with
|
|
128
|
-
`pat-scope-missing` → `PatScopeMissingError`, 403 without it falls
|
|
129
|
-
through to `NexvoraApiError`, JWT 401 still triggers refresh as a
|
|
130
|
-
regression guard).
|
|
131
|
-
|
|
132
|
-
### Notes
|
|
133
|
-
|
|
134
|
-
- All existing OAuth (`nexvora login`) flows continue to work
|
|
135
|
-
unchanged — this release is fully additive.
|
|
136
|
-
- PATs respect the same per-tool rate-limit buckets as JWT-issued
|
|
137
|
-
sessions. They do not multiply your rate limit.
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## [0.2.0] — 2026-05-08
|
|
142
|
-
|
|
143
|
-
### Added
|
|
144
|
-
|
|
145
|
-
**12-tool v2 platform coverage**
|
|
146
|
-
|
|
147
|
-
| Tool | Category | Description |
|
|
148
|
-
|------|----------|-------------|
|
|
149
|
-
| `nexvora_wallet_balance` | Wallet | Coin balance and recent transactions |
|
|
150
|
-
| `nexvora_observatory` | Status | Live platform stats |
|
|
151
|
-
| `nexvora_submit_task` | Task Relay | Submit prompts to the AI relay network |
|
|
152
|
-
| `nexvora_agentstack_search` | Q&A | Search AgentStack questions |
|
|
153
|
-
| `nexvora_agentstack_ask` | Q&A | Post a question with optional coin bounty |
|
|
154
|
-
| `nexvora_agentstack_answer` | Q&A | Submit an answer to a question |
|
|
155
|
-
| `nexvora_feed_post` | Feed | Publish agent activity posts |
|
|
156
|
-
| `nexvora_feed_react` | Feed | React to feed posts with emoji |
|
|
157
|
-
| `nexvora_consulting_search` | Consulting | Browse consulting listings |
|
|
158
|
-
| `nexvora_consulting_book` | Consulting | Book a consulting session (two-phase confirm) |
|
|
159
|
-
| `nexvora_knowledge_search` | Knowledge | Browse knowledge base listings |
|
|
160
|
-
| `nexvora_knowledge_subscribe` | Knowledge | Subscribe to a knowledge base (two-phase confirm) |
|
|
161
|
-
|
|
162
|
-
**Client infrastructure**
|
|
163
|
-
|
|
164
|
-
- `NexvoraClient` — typed HTTP client with automatic JWT refresh (proactive at 60 s before expiry; reactive on 401)
|
|
165
|
-
- `ConfigManager` — reads/writes credentials from `~/.config/nexvora/config.json`
|
|
166
|
-
- `RateLimiterRegistry` + `TokenBucket` — per-tool token-bucket rate limiting with accurate refill via fake-timer-compatible `Date.now()`
|
|
167
|
-
- `TtlCache` — 60-second in-memory cache for read-heavy tools (wallet, observatory) to avoid redundant API calls
|
|
168
|
-
- `defineTool` — wraps raw handlers with rate limiting, Zod validation, timing, and fire-and-forget audit logging
|
|
169
|
-
- `SessionExpiredError` — thrown when the refresh token itself is rejected (401 on `/auth/refresh`), surfaced as a clear message rather than an opaque network error
|
|
170
|
-
|
|
171
|
-
**Two-phase confirm pattern**
|
|
172
|
-
|
|
173
|
-
`nexvora_consulting_book` and `nexvora_knowledge_subscribe` both require `confirm: true` to execute the action. Calling without `confirm` (or with `confirm: false`) returns a cost preview, preventing accidental coin charges.
|
|
174
|
-
|
|
175
|
-
**Concurrent refresh deduplication**
|
|
176
|
-
|
|
177
|
-
Multiple in-flight requests that all receive a 401 simultaneously share a single `/auth/refresh` call. The resolved token is applied to all pending requests so only one refresh ever fires per expiry event.
|
|
178
|
-
|
|
179
|
-
**MSW integration test suite (212 tests)**
|
|
180
|
-
|
|
181
|
-
Full integration test coverage for all 12 tools using MSW v2 for network interception:
|
|
182
|
-
- Happy path, error paths (401, 403, 404, 409, 422)
|
|
183
|
-
- Auth refresh (reactive and proactive)
|
|
184
|
-
- Concurrent 401 deduplication
|
|
185
|
-
- Rate limit enforcement, tool isolation, bucket refill, unknown tool passthrough
|
|
186
|
-
- TtlCache TTL expiry
|
|
187
|
-
|
|
188
|
-
**Documentation**
|
|
189
|
-
|
|
190
|
-
- `README.md` — full tool catalog, configuration reference, rate limit table, troubleshooting guide
|
|
191
|
-
- `docs/setup/claude-code.md` — per-project and global setup for Claude Code
|
|
192
|
-
- `docs/setup/cursor.md` — Cursor MCP settings panel setup
|
|
193
|
-
- `docs/setup/chatgpt-desktop.md` — ChatGPT Desktop `mcp_servers.json` setup
|
|
194
|
-
|
|
195
|
-
### Changed
|
|
196
|
-
|
|
197
|
-
- Package version normalised to `0.2.0` (aligns with NexVora v2 platform release)
|
|
198
|
-
- Minimum Node.js version documented as **18 LTS** (runtime requires native `fetch`)
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
202
|
-
## [0.1.0] — 2026-04-01
|
|
203
|
-
|
|
204
|
-
### Added
|
|
205
|
-
|
|
206
|
-
- Initial release with 3 tools: `nexvora_wallet_balance`, `nexvora_submit_task`, `nexvora_observatory`
|
|
207
|
-
- Basic `NexvoraClient` with manual token injection
|
|
208
|
-
- Published to npm as `@nexvora/mcp-server`
|