@nexgen-os/mcp 0.0.0-stage → 0.4.1

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.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The server before anybody has told it where the database is.
3
+ *
4
+ * A client lists a server's tools the moment it is added, and so do the
5
+ * directories that index servers. So when the connection is simply absent
6
+ * the server starts anyway, and every call answers with what to set.
7
+ * Nothing is connected and nothing is guessed.
8
+ */
9
+ import { GestureError } from '@nexgen-os/core';
10
+ import { ENV } from './config.js';
11
+ const ABSENT = ['missing_configuration', 'missing_credentials'];
12
+ /** Whether a configuration error only says that something is missing. */
13
+ export function isMissingConfiguration(error) {
14
+ return error instanceof GestureError && ABSENT.some((code) => error.message.startsWith(`${code}:`));
15
+ }
16
+ const HINT = `Add the variables to the "env" block of this server in the client's configuration, then restart the client: ${ENV.dbUrl}, and ` +
17
+ `${ENV.apiKey} (a key an owner issued with nexgen-os key create), ${ENV.accessToken} with ${ENV.supabaseUrl} and ${ENV.anonKey}, or ${ENV.actAsUserId}. ` +
18
+ `${ENV.write}=1 lets it write. No database yet: npx nexgen-os init installs one. Tell the person this; do not retry the call.`;
19
+ export function unconfiguredSession(reason) {
20
+ return {
21
+ actingAs: 'nobody',
22
+ writable: false,
23
+ run: () => Promise.reject(new GestureError(`not_configured: this server has no connection to a Nexgen OS database yet. ${reason.message}`, { code: 'not_configured', hint: HINT })),
24
+ close: () => Promise.resolve(),
25
+ };
26
+ }
package/package.json CHANGED
@@ -1,6 +1,54 @@
1
1
  {
2
2
  "name": "@nexgen-os/mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.1",
4
+ "description": "MCP server for Nexgen OS: let an AI agent describe, equip and study energy assets, as the person who asked it, under row level security.",
5
+ "keywords": [
6
+ "mcp",
7
+ "model-context-protocol",
8
+ "energy",
9
+ "digital-twin",
10
+ "supabase",
11
+ "postgres"
12
+ ],
13
+ "license": "AGPL-3.0-only",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/nexgen-os/nexgen-os.git",
17
+ "directory": "packages/mcp"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "type": "module",
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "nexgenOs": {
27
+ "schemaMin": "0.4.0"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "README.md",
32
+ "LICENSE"
33
+ ],
34
+ "bin": {
35
+ "nexgen-mcp": "./dist/bin.js"
36
+ },
37
+ "main": "./dist/index.js",
38
+ "types": "./dist/index.d.ts",
39
+ "exports": {
40
+ ".": {
41
+ "types": "./dist/index.d.ts",
42
+ "import": "./dist/index.js"
43
+ }
44
+ },
45
+ "scripts": {
46
+ "build": "tsc -p tsconfig.build.json && node ../../scripts/copy-license.mjs"
47
+ },
48
+ "dependencies": {
49
+ "@modelcontextprotocol/sdk": "1.31.0",
50
+ "@nexgen-os/core": "^0.4.0",
51
+ "zod": "4.6.2",
52
+ "pg": "^8.23.1"
53
+ }
54
+ }