@gloriginmind/mcp 0.1.1 → 0.1.3
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 +39 -26
- package/dist/auth.d.ts +2 -0
- package/dist/auth.js +4 -0
- package/dist/http.js +3 -0
- package/dist/tools.d.ts +4 -0
- package/dist/tools.js +6 -3
- package/package.json +16 -1
package/README.md
CHANGED
|
@@ -4,33 +4,55 @@ MCP server for OriginMind dual-auth skill routes. Auth is the same Bootstrap OAu
|
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
|
-
Run Bootstrap OAuth once on the machine:
|
|
8
|
-
|
|
9
7
|
```powershell
|
|
10
8
|
. ./skills/create/scripts/setup-oauth.ps1
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
Key lands in `~/.originmind/.env`. Do **not** paste it into `mcp.json`.
|
|
12
|
+
|
|
13
|
+
## Cursor — preferred (HTTP URL)
|
|
14
|
+
|
|
15
|
+
Run the HTTP server once (separate terminal / service):
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
npx -y -p @gloriginmind/mcp originmind-mcp-http
|
|
19
|
+
# or local: node path/to/skills/mcp/dist/http.js
|
|
15
20
|
```
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
Defaults: `http://127.0.0.1:3920/mcp` (`ORIGINMIND_MCP_PORT`, `ORIGINMIND_MCP_HOST`).
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
Cursor `mcp.json`:
|
|
20
25
|
|
|
21
26
|
```json
|
|
22
27
|
{
|
|
23
28
|
"mcpServers": {
|
|
24
29
|
"originmind": {
|
|
25
|
-
"
|
|
26
|
-
"args": ["-y", "@gloriginmind/mcp"],
|
|
27
|
-
"env": {}
|
|
30
|
+
"url": "http://127.0.0.1:3920/mcp"
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
```
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
The HTTP process reads `ORIGINMIND_API_KEY` from the machine env / `~/.originmind/.env`. Optional override via headers:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"originmind": {
|
|
42
|
+
"url": "http://127.0.0.1:3920/mcp",
|
|
43
|
+
"headers": {
|
|
44
|
+
"X-OriAI-Api-Key": "${env:ORIGINMIND_API_KEY}"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Hosted production URL (e.g. on `api.originmind.ai`) is not shipped yet — local HTTP first.
|
|
52
|
+
|
|
53
|
+
## Cursor — stdio (alternative)
|
|
54
|
+
|
|
55
|
+
Avoids a long-running process; `npx` can be slow on some networks:
|
|
34
56
|
|
|
35
57
|
```json
|
|
36
58
|
{
|
|
@@ -44,23 +66,19 @@ Local checkout (this monorepo):
|
|
|
44
66
|
}
|
|
45
67
|
```
|
|
46
68
|
|
|
47
|
-
|
|
69
|
+
Or `npx -y @gloriginmind/mcp` (pulls latest; first connect may be slow).
|
|
48
70
|
|
|
49
71
|
## Transports
|
|
50
72
|
|
|
51
73
|
| Transport | Entry | Use |
|
|
52
74
|
|-----------|-------|-----|
|
|
53
|
-
| **
|
|
54
|
-
| **
|
|
55
|
-
|
|
56
|
-
HTTP defaults: `ORIGINMIND_MCP_HOST=127.0.0.1`, `ORIGINMIND_MCP_PORT=3920`, path `/mcp`, health `GET /health`.
|
|
75
|
+
| **HTTP** | `originmind-mcp-http` / `dist/http.js` | Cursor `url`, LiveKit `MCPServerHTTP` |
|
|
76
|
+
| **stdio** | `mcp` / `originmind-mcp` / `dist/stdio.js` | Cursor command |
|
|
57
77
|
|
|
58
|
-
|
|
78
|
+
Health: `GET /health`.
|
|
59
79
|
|
|
60
80
|
### LiveKit (documented, not wired this pass)
|
|
61
81
|
|
|
62
|
-
When the HTTP server is running:
|
|
63
|
-
|
|
64
82
|
```python
|
|
65
83
|
from livekit.agents import mcp
|
|
66
84
|
|
|
@@ -70,8 +88,6 @@ mcp.MCPServerHTTP(
|
|
|
70
88
|
)
|
|
71
89
|
```
|
|
72
90
|
|
|
73
|
-
Do not attach alongside the existing `@function_tool`s until you choose which surface wins (avoids duplicate tools).
|
|
74
|
-
|
|
75
91
|
## Tools
|
|
76
92
|
|
|
77
93
|
**Read:** `list_projects`, `search_creative_dna`, `list_conversations`, `list_messages`, `get_transcript`
|
|
@@ -79,17 +95,14 @@ Do not attach alongside the existing `@function_tool`s until you choose which su
|
|
|
79
95
|
**Creations:** `list_creations`, `get_creation`, `create_creation`, `update_creation`
|
|
80
96
|
**References:** `list_references`, `create_reference`
|
|
81
97
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
**Creations** use the creations API (`list_creations` / `get_creation` / `create_creation` / `update_creation`). Notion tools are **not** exposed here (parked).
|
|
98
|
+
Notion tools are **not** exposed (parked).
|
|
85
99
|
|
|
86
100
|
## Dev
|
|
87
101
|
|
|
88
102
|
```bash
|
|
89
103
|
cd skills/mcp
|
|
90
|
-
npm install
|
|
104
|
+
npm install
|
|
91
105
|
npm run build
|
|
92
106
|
npm test
|
|
93
|
-
npm start
|
|
94
|
-
npm run start:http # HTTP
|
|
107
|
+
npm run start:http
|
|
95
108
|
```
|
package/dist/auth.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export type AuthCred = {
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function resolveAuth(options?: {
|
|
10
10
|
authorizationHeader?: string | null;
|
|
11
|
+
/** Optional X-OriAI-Api-Key from HTTP clients (e.g. Cursor headers). */
|
|
12
|
+
apiKeyHeader?: string | null;
|
|
11
13
|
cwd?: string;
|
|
12
14
|
/** Override machine env path; pass `null` to skip (~/.originmind/.env). */
|
|
13
15
|
machineEnvPath?: string | null;
|
package/dist/auth.js
CHANGED
|
@@ -42,6 +42,10 @@ export function resolveAuth(options) {
|
|
|
42
42
|
return { kind: "api_key", value: header };
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
const apiKeyHeader = options?.apiKeyHeader?.trim();
|
|
46
|
+
if (apiKeyHeader) {
|
|
47
|
+
return { kind: "api_key", value: apiKeyHeader };
|
|
48
|
+
}
|
|
45
49
|
if (process.env.ORIGINMIND_API_KEY?.trim()) {
|
|
46
50
|
return { kind: "api_key", value: process.env.ORIGINMIND_API_KEY.trim() };
|
|
47
51
|
}
|
package/dist/http.js
CHANGED
|
@@ -32,8 +32,11 @@ function readJsonBody(req) {
|
|
|
32
32
|
}
|
|
33
33
|
async function handleMcp(req, res) {
|
|
34
34
|
const authHeader = typeof req.headers.authorization === "string" ? req.headers.authorization : null;
|
|
35
|
+
const apiKeyRaw = req.headers["x-oriai-api-key"];
|
|
36
|
+
const apiKeyHeader = typeof apiKeyRaw === "string" ? apiKeyRaw : Array.isArray(apiKeyRaw) ? apiKeyRaw[0] : null;
|
|
35
37
|
const server = createMcpServer({
|
|
36
38
|
getAuthorizationHeader: () => authHeader,
|
|
39
|
+
getApiKeyHeader: () => apiKeyHeader,
|
|
37
40
|
});
|
|
38
41
|
const transport = new StreamableHTTPServerTransport({
|
|
39
42
|
sessionIdGenerator: undefined,
|
package/dist/tools.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { z } from "zod";
|
|
|
3
3
|
export type ToolAuthContext = {
|
|
4
4
|
/** Per-request Authorization header (HTTP transport). */
|
|
5
5
|
getAuthorizationHeader?: () => string | null | undefined;
|
|
6
|
+
/** Per-request X-OriAI-Api-Key (HTTP / Cursor headers). */
|
|
7
|
+
getApiKeyHeader?: () => string | null | undefined;
|
|
8
|
+
/** Override API base URL (orchestrator self-call / local). */
|
|
9
|
+
baseUrl?: string;
|
|
6
10
|
};
|
|
7
11
|
/** Zod shapes exported for unit tests. */
|
|
8
12
|
export declare const toolSchemas: {
|
package/dist/tools.js
CHANGED
|
@@ -10,10 +10,13 @@ function errorResult(message) {
|
|
|
10
10
|
return { content: [{ type: "text", text: message }], isError: true };
|
|
11
11
|
}
|
|
12
12
|
function clientFor(ctx) {
|
|
13
|
-
const auth = resolveAuth({
|
|
13
|
+
const auth = resolveAuth({
|
|
14
|
+
authorizationHeader: ctx.getAuthorizationHeader?.() ?? null,
|
|
15
|
+
apiKeyHeader: ctx.getApiKeyHeader?.() ?? null,
|
|
16
|
+
});
|
|
14
17
|
if ("error" in auth)
|
|
15
18
|
return { error: MISSING_KEY_MESSAGE };
|
|
16
|
-
return new OriginMindClient(auth);
|
|
19
|
+
return new OriginMindClient(auth, ctx.baseUrl);
|
|
17
20
|
}
|
|
18
21
|
async function runTool(ctx, fn) {
|
|
19
22
|
const client = clientFor(ctx);
|
|
@@ -103,7 +106,7 @@ export const toolSchemas = {
|
|
|
103
106
|
export function createServer(authCtx = {}) {
|
|
104
107
|
const server = new McpServer({
|
|
105
108
|
name: "originmind",
|
|
106
|
-
version: "0.1.
|
|
109
|
+
version: "0.1.3",
|
|
107
110
|
});
|
|
108
111
|
server.tool("list_projects", "List OriginMind projects for the authenticated user (GET /api/v1/projects).", toolSchemas.list_projects.shape, async () => runTool(authCtx, (c) => c.get("/api/v1/projects")));
|
|
109
112
|
server.tool("search_creative_dna", "Search Creative DNA for a project (POST /api/v1/projects/{id}/query).", toolSchemas.search_creative_dna.shape, async (args) => runTool(authCtx, (c) => c.post(`/api/v1/projects/${encodeURIComponent(args.project_id)}/query`, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gloriginmind/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "OriginMind MCP server — dual-auth skill routes via Bootstrap OAuth API key",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,6 +9,21 @@
|
|
|
9
9
|
"originmind-mcp-http": "dist/http.js"
|
|
10
10
|
},
|
|
11
11
|
"main": "./dist/stdio.js",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./dist/stdio.js",
|
|
14
|
+
"./server": {
|
|
15
|
+
"types": "./dist/tools.d.ts",
|
|
16
|
+
"import": "./dist/tools.js"
|
|
17
|
+
},
|
|
18
|
+
"./auth": {
|
|
19
|
+
"types": "./dist/auth.d.ts",
|
|
20
|
+
"import": "./dist/auth.js"
|
|
21
|
+
},
|
|
22
|
+
"./client": {
|
|
23
|
+
"types": "./dist/client.d.ts",
|
|
24
|
+
"import": "./dist/client.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
12
27
|
"files": [
|
|
13
28
|
"dist",
|
|
14
29
|
"README.md"
|