stackby-mcp-server 0.2.2 → 0.3.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/README.md +157 -103
- package/dist/index.js +4 -547
- package/dist/list-workspaces.d.ts +1 -0
- package/dist/list-workspaces.js +31 -0
- package/dist/mcp-server.d.ts +5 -0
- package/dist/mcp-server.js +549 -0
- package/dist/request-context.d.ts +8 -0
- package/dist/request-context.js +21 -0
- package/dist/server-http.d.ts +1 -0
- package/dist/server-http.js +105 -0
- package/dist/stackby-api.d.ts +1 -5
- package/dist/stackby-api.js +41 -19
- package/package.json +44 -26
package/README.md
CHANGED
|
@@ -1,103 +1,157 @@
|
|
|
1
|
-
# Stackby MCP Server
|
|
2
|
-
|
|
3
|
-
Model Context Protocol (MCP) server for Stackby. Exposes tools so AI clients (Cursor, Claude Desktop, Cline, ChatGPT with MCP) can work with Stackby data.
|
|
4
|
-
|
|
5
|
-
**Auth:** Stackby Developer API via `STACKBY_API_KEY` (API key or Personal Access Token). See [CONFIG](https://github.com/stackby/Stackby_API/blob/production/MCP_SERVER/docs/CONFIG.md) in the planning repo (or sibling `Stackby_API/MCP_SERVER/docs/CONFIG.md`).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Install (one-click)
|
|
10
|
-
|
|
11
|
-
**1. Add to Cursor** — Edit `~/.cursor/mcp.json` (Mac/Linux) or `%USERPROFILE%\.cursor\mcp.json` (Windows):
|
|
12
|
-
|
|
13
|
-
```json
|
|
14
|
-
{
|
|
15
|
-
"mcpServers": {
|
|
16
|
-
"stackby": {
|
|
17
|
-
"command": "npx",
|
|
18
|
-
"args": ["-y", "stackby-mcp-server"],
|
|
19
|
-
"env": {
|
|
20
|
-
"STACKBY_API_KEY": "your-api-key-or-pat",
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Replace `your-api-key-or-pat` with your Stackby API key or PAT. Set `STACKBY_API_URL` to your Stackby API base URL (omit for default). Restart Cursor.
|
|
28
|
-
|
|
29
|
-
**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
##
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
1
|
+
# Stackby MCP Server
|
|
2
|
+
|
|
3
|
+
Model Context Protocol (MCP) server for Stackby. Exposes tools so AI clients (Cursor, Claude Desktop, Cline, ChatGPT with MCP) can work with Stackby data.
|
|
4
|
+
|
|
5
|
+
**Auth:** Stackby Developer API via `STACKBY_API_KEY` (API key or Personal Access Token). See [CONFIG](https://github.com/stackby/Stackby_API/blob/production/MCP_SERVER/docs/CONFIG.md) in the planning repo (or sibling `Stackby_API/MCP_SERVER/docs/CONFIG.md`).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Install (one-click)
|
|
10
|
+
|
|
11
|
+
**1. Add to Cursor** — Edit `~/.cursor/mcp.json` (Mac/Linux) or `%USERPROFILE%\.cursor\mcp.json` (Windows):
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"mcpServers": {
|
|
16
|
+
"stackby": {
|
|
17
|
+
"command": "npx",
|
|
18
|
+
"args": ["-y", "stackby-mcp-server"],
|
|
19
|
+
"env": {
|
|
20
|
+
"STACKBY_API_KEY": "your-api-key-or-pat",
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Replace `your-api-key-or-pat` with your Stackby API key or PAT. Set `STACKBY_API_URL` to your Stackby API base URL (omit for default). Restart Cursor.
|
|
28
|
+
|
|
29
|
+
**1b. Hosted (https://mcp.stackby.com)** — If you use the hosted MCP endpoint, add it in Cursor as **streamable HTTP** and send your API key in headers:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"stackby": {
|
|
35
|
+
"type": "streamableHttp",
|
|
36
|
+
"url": "https://mcp.stackby.com/mcp",
|
|
37
|
+
"headers": {
|
|
38
|
+
"X-Stackby-API-Key": "your-api-key-or-pat"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Alternatively use `"Authorization": "Bearer your-api-key-or-pat"` instead of `X-Stackby-API-Key`. Without one of these headers, the server returns 401 and Cursor may show connection/500-style errors. Restart Cursor after changing the config.
|
|
46
|
+
|
|
47
|
+
**2. Or install globally:** `npm install -g stackby-mcp-server` then use `"command": "stackby-mcp-server"` in `mcp.json`.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Tools (11)
|
|
52
|
+
|
|
53
|
+
| Tool | Description |
|
|
54
|
+
|------|-------------|
|
|
55
|
+
| `list_stacks` | List stacks (bases) the user can access. |
|
|
56
|
+
| `list_tables` | List tables in a stack. |
|
|
57
|
+
| `describe_table` | Table schema: fields (columns), views. |
|
|
58
|
+
| `list_records` | List rows in a table (with optional maxRecords). |
|
|
59
|
+
| `search_records` | Search rows by text. |
|
|
60
|
+
| `get_record` | Get one row by ID. |
|
|
61
|
+
| `create_record` | Create a row (fields keyed by column name). |
|
|
62
|
+
| `update_records` | Update rows (array of `{ id, fields }`, max 10). |
|
|
63
|
+
| `delete_records` | Soft-delete rows by ID (max 10). |
|
|
64
|
+
| `create_table` | Create a new table in a stack. |
|
|
65
|
+
| `create_field` | Create a new column (field) in a table. |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Setup
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm install
|
|
73
|
+
npm run build
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**How to verify the build:** After `npm run build` you should see `Build OK. Output in dist/`. Run `npm start` — the server runs over stdio (no visible output; it waits for Cursor/Claude to connect).
|
|
77
|
+
|
|
78
|
+
## Verify in Cursor (Step 1.2)
|
|
79
|
+
|
|
80
|
+
1. Open Cursor **Settings** → **MCP** (or edit the config file directly).
|
|
81
|
+
2. Add the Stackby MCP server. Use **project** or **user** config.
|
|
82
|
+
|
|
83
|
+
**Option A — User config** (`~/.cursor/mcp.json` on Mac/Linux, or `%USERPROFILE%\\.cursor\\mcp.json` on Windows):
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"mcpServers": {
|
|
88
|
+
"stackby": {
|
|
89
|
+
"command": "node",
|
|
90
|
+
"args": ["C:\\Users\\Admin\\Desktop\\Stackby\\stackby-mcp-server\\dist\\index.js"],
|
|
91
|
+
"env": {
|
|
92
|
+
"STACKBY_API_KEY": "your-api-key-or-pat"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
Use **command** + **args** (stdio). Do **not** add this server as a URL (streamableHttp/SSE) — that mode is for hosted HTTP and requires different setup.
|
|
99
|
+
|
|
100
|
+
**Option B — If you use `npx` from the project folder:** (from a terminal in `stackby-mcp-server` run `node dist/index.js`; Cursor can use that path in `args`.)
|
|
101
|
+
|
|
102
|
+
Use the **full path** to `dist/index.js` in `args` so Cursor can spawn the server.
|
|
103
|
+
3. Restart Cursor (or reload the window).
|
|
104
|
+
4. Set `STACKBY_API_KEY` (and optionally `STACKBY_API_URL`) in the `env` object. In a chat, check the **tools** list — you should see all 11 tools: **list_stacks**, **list_tables**, **describe_table**, **list_records**, **search_records**, **get_record**, **create_record**, **update_records**, **delete_records**, **create_table**, **create_field**.
|
|
105
|
+
|
|
106
|
+
## Run (stdio — for Cursor / Claude)
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
STACKBY_API_KEY=your_api_key STACKBY_API_URL=https://api.stackby.com npm start
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Or one-click: `npx stackby-mcp-server` (after npm publish)
|
|
113
|
+
|
|
114
|
+
## Config
|
|
115
|
+
|
|
116
|
+
| Env | Required | Description |
|
|
117
|
+
|-----|----------|-------------|
|
|
118
|
+
| `STACKBY_API_KEY` | Yes | Stackby API key (or PAT when implemented). |
|
|
119
|
+
|
|
120
|
+
**Full config** (Cursor, Claude Desktop, Cline, HTTP transport): see `Stackby_API/MCP_SERVER/docs/CONFIG.md` in the sibling repo.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Troubleshooting
|
|
125
|
+
|
|
126
|
+
**"Error - Show Output" for the stackby MCP server in Cursor**
|
|
127
|
+
|
|
128
|
+
1. **See the real error** — In Cursor go to **Settings → MCP**, find **stackby**, and click **"Show Output"**. The log will show why the server failed (e.g. missing file, missing env, or Node error).
|
|
129
|
+
2. **Using this repo locally** — You must **build** the project and point Cursor at the built file:
|
|
130
|
+
- In a terminal: `cd` to this repo, then run `npm install` and `npm run build`.
|
|
131
|
+
- In `%USERPROFILE%\.cursor\mcp.json` (Windows) use a **stdio** config with the **full path** to `dist\index.js`:
|
|
132
|
+
```json
|
|
133
|
+
"stackby": {
|
|
134
|
+
"command": "node",
|
|
135
|
+
"args": ["C:\\Users\\Admin\\Desktop\\Stackby\\stackby-mcp-server\\dist\\index.js"],
|
|
136
|
+
"env": { "STACKBY_API_KEY": "your-api-key-or-pat" }
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
Replace the path if your repo is elsewhere. Do not use `npx -y stackby-mcp-server` for local development unless you have published/installed that package.
|
|
140
|
+
3. **API key** — Ensure `STACKBY_API_KEY` (or PAT) is set in the server’s `env` in `mcp.json`. Restart Cursor after editing the config.
|
|
141
|
+
|
|
142
|
+
**"Error connecting to SSE server" or "Non-200 status code (500)" when using the hosted URL (https://mcp.stackby.com)**
|
|
143
|
+
|
|
144
|
+
- The hosted server **requires your API key on every request**. In Cursor you must add **headers** so the key is sent.
|
|
145
|
+
- Use **streamableHttp** with `url`: `https://mcp.stackby.com/mcp` and a **headers** object, for example:
|
|
146
|
+
- `"X-Stackby-API-Key": "your-api-key-or-pat"`
|
|
147
|
+
- or `"Authorization": "Bearer your-api-key-or-pat"`
|
|
148
|
+
- If no API key is sent, the server returns 401; Cursor can surface that as a connection or 500-style error. Add the header and restart Cursor.
|
|
149
|
+
- **If you still get 500 with the correct headers**, the error is on the server. Whoever runs **mcp.stackby.com** should: (1) Check server logs for `[MCP /mcp] Error handling request` or `[MCP] Unhandled rejection` to see the real error. (2) Deploy the latest `server-http` code from this repo so 500 responses include a JSON body `{ "error": "MCP handler error", "message": "..." }` and errors are logged.
|
|
150
|
+
|
|
151
|
+
**Same errors when adding as a local server**
|
|
152
|
+
|
|
153
|
+
- If you want to run the server locally, add it as a **command (stdio)** server, not as a URL: **Command** `npx`, **Args** `["-y", "stackby-mcp-server"]`, **Env** `{ "STACKBY_API_KEY": "your-api-key-or-pat" }`.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
Planning and design: `Stackby_API/MCP_SERVER/` (sibling repo).
|