@nup-white/nwdb-mcp 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NUP WHITE Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,110 @@
1
+ # @nup-white/nwdb-mcp
2
+
3
+ Official MCP server for **NW DB** — the AI-native PostgreSQL DBaaS.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@nup-white/nwdb-mcp.svg)](https://www.npmjs.com/package/@nup-white/nwdb-mcp)
6
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
+
8
+ Connect Claude Code, Claude Desktop, Cursor, Continue (or any MCP client) to your NW DB workspace in 30 seconds.
9
+
10
+ ## What is NW DB?
11
+
12
+ NW DB is "Supabase for AI agents." A managed PostgreSQL + pgvector DB with built-in cleansing/normalization/masking/embedding agents and an MCP-first API. Sign up at [nwdb.dev](https://nwdb.dev) — Hobby plan ¥5,000/month with 3-day free trial.
13
+
14
+ ## Quickstart
15
+
16
+ ### 1. Get an API key
17
+
18
+ Sign up at [nwdb.dev](https://nwdb.dev), create a workspace, and copy your API key from `Settings → API Keys`.
19
+
20
+ ### 2a. Claude Code
21
+
22
+ Add to `~/.claude/mcp.json`:
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "nwdb": {
28
+ "command": "npx",
29
+ "args": ["-y", "@nup-white/nwdb-mcp"],
30
+ "env": {
31
+ "NWDB_API_KEY": "your-api-key-here"
32
+ }
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### 2b. Claude Desktop
39
+
40
+ `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "nwdb": {
46
+ "command": "npx",
47
+ "args": ["-y", "@nup-white/nwdb-mcp"],
48
+ "env": {
49
+ "NWDB_API_KEY": "your-api-key-here"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ ### 2c. Cursor
57
+
58
+ Settings → MCP → Add new server:
59
+
60
+ ```json
61
+ {
62
+ "nwdb": {
63
+ "command": "npx",
64
+ "args": ["-y", "@nup-white/nwdb-mcp"],
65
+ "env": { "NWDB_API_KEY": "your-api-key-here" }
66
+ }
67
+ }
68
+ ```
69
+
70
+ ### 3. Restart your client
71
+
72
+ The 5 tools should appear: `list_tables`, `describe_table`, `query`, `insert`, `search_vectors`.
73
+
74
+ ## Tools
75
+
76
+ | Tool | Description | Annotations |
77
+ |---|---|---|
78
+ | `list_tables` | List all tables in the workspace | `readOnly` |
79
+ | `describe_table` | Get schema (columns + record count) | `readOnly` |
80
+ | `query` | Query with filters / order / limit | `readOnly` |
81
+ | `insert` | Insert a record | `destructive` |
82
+ | `search_vectors` | Cosine-similarity vector search | `readOnly` |
83
+
84
+ ## Environment variables
85
+
86
+ | Var | Required | Description |
87
+ |---|---|---|
88
+ | `NWDB_API_KEY` | yes | Workspace API key from [nwdb.dev/settings](https://nwdb.dev/settings) |
89
+ | `NWDB_WORKSPACE` | no | Workspace ID (omit if your key is workspace-scoped) |
90
+ | `NWDB_API_URL` | no | Override base URL (default: `https://api.nwdb.dev`) |
91
+
92
+ ## Pricing
93
+
94
+ | Plan | Price | Includes |
95
+ |---|---|---|
96
+ | **Hobby** | ¥5,000/mo + usage | 100K req / 1GB / 1M tokens |
97
+ | **Enterprise** | ¥100,000/mo + usage | SLA / VPC / CMEK / **white-label resale allowed** |
98
+
99
+ Enterprise resellers can rebrand NW DB completely and charge up to **10× the base rate**. Contact [sales@nupwhite.com](mailto:sales@nupwhite.com).
100
+
101
+ ## Links
102
+
103
+ - Website: [nwdb.dev](https://nwdb.dev)
104
+ - Docs: [nwdb.dev/docs](https://nwdb.dev/docs)
105
+ - GitHub: [github.com/nup-cloud/nw-db](https://github.com/nup-cloud/nw-db)
106
+ - Discord: TBA
107
+
108
+ ## License
109
+
110
+ MIT © NUP WHITE Inc.
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * NW DB — Official MCP Server
4
+ *
5
+ * stdio MCP server that proxies tool calls to api.nwdb.dev/api/v1/mcp/*.
6
+ * Designed for Claude Code, Claude Desktop, Cursor, Continue.
7
+ *
8
+ * Configuration via environment variables:
9
+ * NWDB_API_KEY (required) workspace API key from https://nwdb.dev/settings
10
+ * NWDB_WORKSPACE (optional) workspace ID (if your key is workspace-scoped you can omit this)
11
+ * NWDB_API_URL (optional) override base URL (default: https://api.nwdb.dev)
12
+ */
13
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * NW DB — Official MCP Server
4
+ *
5
+ * stdio MCP server that proxies tool calls to api.nwdb.dev/api/v1/mcp/*.
6
+ * Designed for Claude Code, Claude Desktop, Cursor, Continue.
7
+ *
8
+ * Configuration via environment variables:
9
+ * NWDB_API_KEY (required) workspace API key from https://nwdb.dev/settings
10
+ * NWDB_WORKSPACE (optional) workspace ID (if your key is workspace-scoped you can omit this)
11
+ * NWDB_API_URL (optional) override base URL (default: https://api.nwdb.dev)
12
+ */
13
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
14
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
15
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
16
+ const API_URL = (process.env.NWDB_API_URL || "https://api.nwdb.dev").replace(/\/$/, "");
17
+ const API_KEY = process.env.NWDB_API_KEY || "";
18
+ const WORKSPACE_ID = process.env.NWDB_WORKSPACE || "";
19
+ if (!API_KEY) {
20
+ console.error("[nwdb-mcp] NWDB_API_KEY environment variable is required.");
21
+ console.error("[nwdb-mcp] Get one at https://nwdb.dev/settings");
22
+ process.exit(1);
23
+ }
24
+ const TOOLS = [
25
+ {
26
+ name: "list_tables",
27
+ description: "List all tables in the NW DB workspace.",
28
+ inputSchema: { type: "object", properties: {}, required: [] },
29
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
30
+ },
31
+ {
32
+ name: "describe_table",
33
+ description: "Get the schema (columns + record count) of a table.",
34
+ inputSchema: {
35
+ type: "object",
36
+ properties: { table: { type: "string", description: "Table name" } },
37
+ required: ["table"],
38
+ },
39
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
40
+ },
41
+ {
42
+ name: "query",
43
+ description: "Query records from a table with optional filters, ordering, and limit.",
44
+ inputSchema: {
45
+ type: "object",
46
+ properties: {
47
+ table: { type: "string" },
48
+ filters: {
49
+ type: "array",
50
+ items: {
51
+ type: "object",
52
+ properties: {
53
+ field: { type: "string" },
54
+ operator: { type: "string", enum: ["=", "!=", "<", "<=", ">", ">=", "ILIKE"] },
55
+ value: {},
56
+ },
57
+ },
58
+ },
59
+ orderBy: { type: "string" },
60
+ orderDirection: { type: "string", enum: ["asc", "desc"] },
61
+ limit: { type: "number" },
62
+ },
63
+ required: ["table"],
64
+ },
65
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
66
+ },
67
+ {
68
+ name: "insert",
69
+ description: "Insert a record into a table. Modifies state.",
70
+ inputSchema: {
71
+ type: "object",
72
+ properties: {
73
+ table: { type: "string" },
74
+ data: { type: "object" },
75
+ },
76
+ required: ["table", "data"],
77
+ },
78
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
79
+ },
80
+ {
81
+ name: "search_vectors",
82
+ description: "Cosine-similarity search over a vector collection.",
83
+ inputSchema: {
84
+ type: "object",
85
+ properties: {
86
+ collection: { type: "string" },
87
+ embedding: { type: "array", items: { type: "number" } },
88
+ topK: { type: "number" },
89
+ minScore: { type: "number" },
90
+ },
91
+ required: ["collection", "embedding"],
92
+ },
93
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
94
+ },
95
+ ];
96
+ async function callRemote(tool, args) {
97
+ const headers = {
98
+ "Content-Type": "application/json",
99
+ "X-API-Key": API_KEY,
100
+ };
101
+ if (WORKSPACE_ID)
102
+ headers["X-Workspace-ID"] = WORKSPACE_ID;
103
+ const res = await fetch(`${API_URL}/api/v1/mcp/call`, {
104
+ method: "POST",
105
+ headers,
106
+ body: JSON.stringify({ tool, arguments: args ?? {} }),
107
+ });
108
+ const text = await res.text();
109
+ if (!res.ok) {
110
+ throw new Error(`NW DB API ${res.status}: ${text}`);
111
+ }
112
+ try {
113
+ return JSON.parse(text);
114
+ }
115
+ catch {
116
+ return text;
117
+ }
118
+ }
119
+ async function main() {
120
+ const server = new Server({ name: "nwdb-mcp", version: "0.1.0" }, { capabilities: { tools: {} } });
121
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
122
+ server.setRequestHandler(CallToolRequestSchema, async (req) => {
123
+ const { name, arguments: args } = req.params;
124
+ try {
125
+ const result = await callRemote(name, args);
126
+ return {
127
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
128
+ };
129
+ }
130
+ catch (err) {
131
+ const message = err instanceof Error ? err.message : String(err);
132
+ return {
133
+ content: [{ type: "text", text: `Error: ${message}` }],
134
+ isError: true,
135
+ };
136
+ }
137
+ });
138
+ const transport = new StdioServerTransport();
139
+ await server.connect(transport);
140
+ console.error("[nwdb-mcp] Connected to stdio. Awaiting tool calls.");
141
+ }
142
+ main().catch((err) => {
143
+ console.error("[nwdb-mcp] Fatal:", err);
144
+ process.exit(1);
145
+ });
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@nup-white/nwdb-mcp",
3
+ "version": "0.1.0",
4
+ "description": "Official MCP server for NW DB — AI-native PostgreSQL DBaaS. Connect Claude Code, Cursor, Continue, and any MCP client to your NW DB workspace.",
5
+ "license": "MIT",
6
+ "author": "NUP WHITE Inc.",
7
+ "homepage": "https://nwdb.dev",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/nup-cloud/nw-db.git",
11
+ "directory": "mcp-client"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/nup-cloud/nw-db/issues"
15
+ },
16
+ "type": "module",
17
+ "main": "./dist/index.js",
18
+ "bin": {
19
+ "nwdb-mcp": "./dist/index.js"
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "README.md",
24
+ "LICENSE"
25
+ ],
26
+ "scripts": {
27
+ "build": "tsc",
28
+ "prepublishOnly": "npm run build",
29
+ "start": "node dist/index.js"
30
+ },
31
+ "engines": {
32
+ "node": ">=18"
33
+ },
34
+ "keywords": [
35
+ "mcp",
36
+ "model-context-protocol",
37
+ "claude",
38
+ "claude-code",
39
+ "cursor",
40
+ "anthropic",
41
+ "database",
42
+ "postgresql",
43
+ "dbaas",
44
+ "ai",
45
+ "nw-db",
46
+ "vector-search"
47
+ ],
48
+ "dependencies": {
49
+ "@modelcontextprotocol/sdk": "^1.0.0"
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "^20.0.0",
53
+ "typescript": "^5.4.0"
54
+ }
55
+ }