@shirbarzur/planform-mcp-server 1.0.2 → 1.0.4
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/.mcpregistry_github_token +1 -1
- package/.mcpregistry_registry_token +1 -1
- package/README.md +16 -0
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/index.ts +8 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ghu_ripPG2VqyTu9vtqakmQTML1wAoNIgD40rDTS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"token":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.
|
|
1
|
+
{"token":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtY3AtcmVnaXN0cnkiLCJleHAiOjE3NzE3MDM1MTUsIm5iZiI6MTc3MTcwMzIxNSwiaWF0IjoxNzcxNzAzMjE1LCJhdXRoX21ldGhvZCI6ImdpdGh1Yi1hdCIsImF1dGhfbWV0aG9kX3N1YiI6IlNoaXJCYXJadXIiLCJwZXJtaXNzaW9ucyI6W3siYWN0aW9uIjoicHVibGlzaCIsInJlc291cmNlIjoiaW8uZ2l0aHViLlNoaXJCYXJadXIvKiJ9XX0.ZTNZN9qX1mTTgDCzywpEi7ZKYvZfQqQ7hfmJy-cCeyUmeaezl6POmKIU2s6KWEAsi4pBP8OlG_JJIiU5Y-gUAA","expires_at":1771703515}
|
package/README.md
CHANGED
|
@@ -65,6 +65,20 @@ npm run build
|
|
|
65
65
|
npm start
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
+
## Running locally (against local backend)
|
|
69
|
+
|
|
70
|
+
When you run the server **from this repo** (`npm run dev` or `npm start`), it loads `.env` from this project root. To point at your local backend once:
|
|
71
|
+
|
|
72
|
+
1. In this repo, set in `.env`:
|
|
73
|
+
```env
|
|
74
|
+
BACKEND_BASE_URL=http://localhost:8000
|
|
75
|
+
FRONTEND_BASE_URL=http://localhost:5173
|
|
76
|
+
```
|
|
77
|
+
2. Run `npm run dev` or `npm run build && npm start`, and use the MCP (e.g. add a command in Cursor that runs `node` with `dist/index.js` and cwd set to this repo).
|
|
78
|
+
3. When you’re done, change `.env` back to the production URLs or leave it for next time.
|
|
79
|
+
|
|
80
|
+
The published package (npx) does not read your workspace `.env`; only when running from this repo does `.env` here apply.
|
|
81
|
+
|
|
68
82
|
## Add to Cursor
|
|
69
83
|
|
|
70
84
|
After the server is [published](#publishing-to-the-mcp-registry), you can add it in Cursor in either of these ways.
|
|
@@ -110,6 +124,8 @@ Example **`.cursor/mcp.json`**:
|
|
|
110
124
|
|
|
111
125
|
You can omit the `env` block to use the built-in defaults (production Planform API). Restart Cursor after changing the file.
|
|
112
126
|
|
|
127
|
+
The server loads `.env` only from the **package directory** (next to the executable), not from your workspace, so your project’s `.env` does not override the default (production) backend URL.
|
|
128
|
+
|
|
113
129
|
**First use:** When you use the MCP, the `device_start` tool will give you a link and code to sign in at [planform.io](https://www.planform.io) and authorize the connection.
|
|
114
130
|
|
|
115
131
|
## VS Code Integration
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { dirname, join } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
2
4
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
5
|
import dotenv from 'dotenv';
|
|
4
6
|
import { PlanformMCPServer } from './server.js';
|
|
5
|
-
// Load
|
|
6
|
-
|
|
7
|
+
// Load .env only from the package directory (not the workspace cwd), so workspace .env doesn't override defaults
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
dotenv.config({ path: join(__dirname, '..', '.env') });
|
|
10
|
+
const effectiveBackend = process.env.BACKEND_BASE_URL || 'https://www.planform.io/api';
|
|
7
11
|
async function main() {
|
|
12
|
+
console.error(`[planform-mcp] BACKEND_BASE_URL = ${effectiveBackend}`);
|
|
8
13
|
// Create server transport (stdio for VS Code integration)
|
|
9
14
|
const transport = new StdioServerTransport();
|
|
10
15
|
// Create MCP server instance
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAMjF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,iHAAiH;AACjH,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AAEvD,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,6BAA6B,CAAC;AAEvF,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,KAAK,CAAC,qCAAqC,gBAAgB,EAAE,CAAC,CAAC;IACvE,0DAA0D;IAC1D,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,6BAA6B;IAC7B,MAAM,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAEvC,mBAAmB;IACnB,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAE9B,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAC5D,CAAC;AAED,2BAA2B;AAC3B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;IACxB,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;IACzB,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"name": "io.github.ShirBarZur/planform-mcp",
|
|
4
4
|
"title": "Planform MCP Server",
|
|
5
5
|
"description": "Create and manage Planform UML diagrams, nodes, and links. For VS Code and Cursor.",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.4",
|
|
7
7
|
"packages": [
|
|
8
8
|
{
|
|
9
9
|
"registryType": "npm",
|
|
10
10
|
"identifier": "@shirbarzur/planform-mcp-server",
|
|
11
|
-
"version": "1.0.
|
|
11
|
+
"version": "1.0.4",
|
|
12
12
|
"transport": {
|
|
13
13
|
"type": "stdio"
|
|
14
14
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { dirname, join } from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
3
5
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
4
6
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
7
|
import {
|
|
@@ -10,10 +12,14 @@ import {
|
|
|
10
12
|
import dotenv from 'dotenv';
|
|
11
13
|
import { PlanformMCPServer } from './server.js';
|
|
12
14
|
|
|
13
|
-
// Load
|
|
14
|
-
|
|
15
|
+
// Load .env only from the package directory (not the workspace cwd), so workspace .env doesn't override defaults
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
dotenv.config({ path: join(__dirname, '..', '.env') });
|
|
18
|
+
|
|
19
|
+
const effectiveBackend = process.env.BACKEND_BASE_URL || 'https://www.planform.io/api';
|
|
15
20
|
|
|
16
21
|
async function main() {
|
|
22
|
+
console.error(`[planform-mcp] BACKEND_BASE_URL = ${effectiveBackend}`);
|
|
17
23
|
// Create server transport (stdio for VS Code integration)
|
|
18
24
|
const transport = new StdioServerTransport();
|
|
19
25
|
|