@spotnik/superplanner-mcp 0.1.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.
- package/README.md +66 -0
- package/dist/index.js +66 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @spotnik/superplanner-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for [SuperPlanner](https://superplanner.monday.app). Works with any MCP-compatible client: Claude Desktop, Cursor, Windsurf, Continue, and more.
|
|
4
|
+
|
|
5
|
+
Full documentation: [docs.spot-nik.com/superplanner/mcp](https://docs.spot-nik.com/superplanner/mcp)
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Node.js 18+
|
|
10
|
+
- A SuperPlanner API token (`sp_...`) — generate one in SuperPlanner → Settings → API Tokens
|
|
11
|
+
|
|
12
|
+
## Setup
|
|
13
|
+
|
|
14
|
+
The server is launched via `npx` — no global install needed. Configure your MCP client to run it with your token and region.
|
|
15
|
+
|
|
16
|
+
### Claude Desktop
|
|
17
|
+
|
|
18
|
+
`claude_desktop_config.json`:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"superplanner": {
|
|
24
|
+
"command": "npx",
|
|
25
|
+
"args": ["-y", "@spotnik/superplanner-mcp", "--token", "sp_xxx", "--region", "us"]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Cursor
|
|
32
|
+
|
|
33
|
+
`.cursor/mcp.json`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"mcpServers": {
|
|
38
|
+
"superplanner": {
|
|
39
|
+
"command": "npx",
|
|
40
|
+
"args": ["-y", "@spotnik/superplanner-mcp", "--token", "sp_xxx", "--region", "us"]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Windsurf
|
|
47
|
+
|
|
48
|
+
`~/.codeium/windsurf/mcp_config.json`:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"superplanner": {
|
|
54
|
+
"command": "npx",
|
|
55
|
+
"args": ["-y", "@spotnik/superplanner-mcp", "--token", "sp_xxx", "--region", "us"]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Options
|
|
62
|
+
|
|
63
|
+
| Flag | Required | Description |
|
|
64
|
+
|------|----------|-------------|
|
|
65
|
+
| `--token` | yes | Your `sp_...` API token |
|
|
66
|
+
| `--region` | yes | Server region: `us`, `eu`, `au`, `il` |
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
3
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
6
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
const REGIONS = {
|
|
8
|
+
us: 'https://live1-service-7042312-f94c764b.us.monday.app/mcp',
|
|
9
|
+
eu: 'https://live1-service-7042312-f94c764b.eu.monday.app/mcp',
|
|
10
|
+
au: 'https://live1-service-7042312-f94c764b.au.monday.app/mcp',
|
|
11
|
+
il: 'https://live1-service-7042312-f94c764b.il.monday.app/mcp',
|
|
12
|
+
};
|
|
13
|
+
function parseArgs() {
|
|
14
|
+
const args = process.argv.slice(2);
|
|
15
|
+
const tokenIdx = args.indexOf('--token');
|
|
16
|
+
const regionIdx = args.indexOf('--region');
|
|
17
|
+
if (tokenIdx === -1 || !args[tokenIdx + 1] || regionIdx === -1 || !args[regionIdx + 1]) {
|
|
18
|
+
console.error('Usage: superplanner-mcp --token <sp_token> --region us|eu|au|il');
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
return { token: args[tokenIdx + 1], region: args[regionIdx + 1] };
|
|
22
|
+
}
|
|
23
|
+
async function main() {
|
|
24
|
+
const { token, region } = parseArgs();
|
|
25
|
+
const initialUrl = REGIONS[region];
|
|
26
|
+
if (!initialUrl) {
|
|
27
|
+
console.error(`Unknown region "${region}". Valid: ${Object.keys(REGIONS).join(', ')}`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
let client = new Client({ name: 'superplanner-mcp', version: '0.1.0' });
|
|
31
|
+
async function connectTo(url) {
|
|
32
|
+
await client.connect(new StreamableHTTPClientTransport(new URL(url), {
|
|
33
|
+
requestInit: { headers: { Authorization: `Bearer ${token}` } },
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
async function reconnectTo(url) {
|
|
37
|
+
await client.close();
|
|
38
|
+
client = new Client({ name: 'superplanner-mcp', version: '0.1.0' });
|
|
39
|
+
await connectTo(url);
|
|
40
|
+
}
|
|
41
|
+
await connectTo(initialUrl);
|
|
42
|
+
const server = new McpServer({ name: 'superplanner-mcp', version: '0.1.0' });
|
|
43
|
+
server.server.setRequestHandler(ListToolsRequestSchema, () => client.listTools());
|
|
44
|
+
server.server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
45
|
+
const result = await client.callTool(req.params);
|
|
46
|
+
if (result.isError) {
|
|
47
|
+
const content = result.content ?? [];
|
|
48
|
+
const errorText = content
|
|
49
|
+
.map((c) => (c.type === 'text' ? (c.text ?? '') : ''))
|
|
50
|
+
.join('');
|
|
51
|
+
// Backend returns "Wrong region. Connect to: <url>" — reconnect and retry once.
|
|
52
|
+
const match = errorText.match(/^Wrong region\. Connect to: (https?:\/\/\S+)/);
|
|
53
|
+
if (match) {
|
|
54
|
+
const correctBase = match[1].replace(/\/mcp\/?$/, '').replace(/\/$/, '');
|
|
55
|
+
await reconnectTo(`${correctBase}/mcp`);
|
|
56
|
+
return client.callTool(req.params);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
});
|
|
61
|
+
await server.connect(new StdioServerTransport());
|
|
62
|
+
}
|
|
63
|
+
main().catch((err) => {
|
|
64
|
+
console.error(err);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@spotnik/superplanner-mcp",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "MCP server for SuperPlanner — works with Claude Desktop, Cursor, Windsurf, and any MCP-compatible client",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"superplanner-mcp": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^22.0.0",
|
|
22
|
+
"typescript": "^5.7.0"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
}
|
|
27
|
+
}
|