@ziggs-ai/ziggs-mcp 0.1.4 → 0.1.5
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/dist/connectionCreds.d.ts +8 -0
- package/dist/connectionCreds.js +31 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.js +8 -3
- package/package.json +18 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Creds } from '@ziggs-ai/api-client';
|
|
2
|
+
import type { ZiggsMcpConfig } from './config.js';
|
|
3
|
+
export declare function parseBearerAuthorization(header: string | string[] | undefined): string;
|
|
4
|
+
/** Per-connection credentials from HTTP Authorization (ZIG-431 / ZIG-466). */
|
|
5
|
+
export declare function connectionFromBearer(bearer: string, httpBaseUrl: string, ownerUserId?: string): {
|
|
6
|
+
creds: Creds;
|
|
7
|
+
cfg: ZiggsMcpConfig;
|
|
8
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { resolveDelegateAgentId, MINT_KEY_HELP } from './operatorKey.js';
|
|
2
|
+
export function parseBearerAuthorization(header) {
|
|
3
|
+
const raw = Array.isArray(header) ? header[0] : header;
|
|
4
|
+
if (!raw?.startsWith('Bearer ')) {
|
|
5
|
+
throw new Error(`Authorization: Bearer <operator-key> required. ${MINT_KEY_HELP}`);
|
|
6
|
+
}
|
|
7
|
+
const token = raw.slice('Bearer '.length).trim();
|
|
8
|
+
if (!token) {
|
|
9
|
+
throw new Error(`empty bearer token. ${MINT_KEY_HELP}`);
|
|
10
|
+
}
|
|
11
|
+
return token;
|
|
12
|
+
}
|
|
13
|
+
/** Per-connection credentials from HTTP Authorization (ZIG-431 / ZIG-466). */
|
|
14
|
+
export function connectionFromBearer(bearer, httpBaseUrl, ownerUserId) {
|
|
15
|
+
const resolvedAgentId = resolveDelegateAgentId(bearer, undefined);
|
|
16
|
+
if (httpBaseUrl) {
|
|
17
|
+
process.env.HTTP_URL = httpBaseUrl;
|
|
18
|
+
}
|
|
19
|
+
const cfg = {
|
|
20
|
+
ZIGGS_OPERATOR_KEY: bearer,
|
|
21
|
+
ZIGGS_API_URL: httpBaseUrl,
|
|
22
|
+
HTTP_URL: httpBaseUrl,
|
|
23
|
+
ZIGGS_AGENT_ID: undefined,
|
|
24
|
+
ZIGGS_OWNER_USER_ID: ownerUserId,
|
|
25
|
+
resolvedAgentId,
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
creds: { operatorKey: bearer, agentId: resolvedAgentId },
|
|
29
|
+
cfg,
|
|
30
|
+
};
|
|
31
|
+
}
|
package/dist/server.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { Creds } from '@ziggs-ai/api-client';
|
|
3
|
+
import type { ZiggsMcpConfig } from './config.js';
|
|
4
|
+
/** Shared MCP server factory — stdio (local) and remote HTTP (backend) reuse this. */
|
|
5
|
+
export declare function createZiggsMcpServer(creds: Creds, cfg: ZiggsMcpConfig): McpServer;
|
|
1
6
|
export declare function startStdioServer(): Promise<void>;
|
package/dist/server.js
CHANGED
|
@@ -6,14 +6,19 @@ import { credsFromConfig } from './creds.js';
|
|
|
6
6
|
import { registerZiggsTools } from './tools.js';
|
|
7
7
|
const require = createRequire(import.meta.url);
|
|
8
8
|
const { version } = require('../package.json');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const creds = credsFromConfig(cfg);
|
|
9
|
+
/** Shared MCP server factory — stdio (local) and remote HTTP (backend) reuse this. */
|
|
10
|
+
export function createZiggsMcpServer(creds, cfg) {
|
|
12
11
|
const server = new McpServer({
|
|
13
12
|
name: 'ziggs-mcp',
|
|
14
13
|
version,
|
|
15
14
|
});
|
|
16
15
|
registerZiggsTools(server, creds, cfg);
|
|
16
|
+
return server;
|
|
17
|
+
}
|
|
18
|
+
export async function startStdioServer() {
|
|
19
|
+
const cfg = loadConfig();
|
|
20
|
+
const creds = credsFromConfig(cfg);
|
|
21
|
+
const server = createZiggsMcpServer(creds, cfg);
|
|
17
22
|
const transport = new StdioServerTransport();
|
|
18
23
|
await server.connect(transport);
|
|
19
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ziggs-ai/ziggs-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "MCP server for Claude Code, Cursor, and other MCP hosts — act as your Ziggs delegate agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,6 +8,23 @@
|
|
|
8
8
|
},
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./server": {
|
|
18
|
+
"types": "./dist/server.d.ts",
|
|
19
|
+
"import": "./dist/server.js",
|
|
20
|
+
"default": "./dist/server.js"
|
|
21
|
+
},
|
|
22
|
+
"./connection-creds": {
|
|
23
|
+
"types": "./dist/connectionCreds.d.ts",
|
|
24
|
+
"import": "./dist/connectionCreds.js",
|
|
25
|
+
"default": "./dist/connectionCreds.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
11
28
|
"scripts": {
|
|
12
29
|
"build": "tsc -p tsconfig.json",
|
|
13
30
|
"prepack": "npm run build",
|