@almyty/mcp-server 1.1.0 → 1.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/dist/auth.d.ts CHANGED
@@ -1,30 +1,6 @@
1
1
  /**
2
- * Credential resolver for @almyty/mcp-server.
3
- *
4
- * Authentication itself lives in the dedicated @almyty/auth package
5
- * (`npx @almyty/auth login`). This module just READS the shared
6
- * credentials store and surfaces them to the MCP server runtime.
7
- *
8
- * Lookup order:
9
- * 1. ALMYTY_TOKEN environment variable (CI / scripts / config files)
10
- * 2. ~/.almyty/credentials.json (interactive use, written
11
- * by `npx @almyty/auth login`)
2
+ * Thin re-export from the shared @almyty/client credential resolver.
3
+ * Keeps `./auth.js` imports working across the mcp-server codebase.
12
4
  */
13
- interface StoredCredentials {
14
- url: string;
15
- token: string;
16
- email?: string;
17
- frontendUrl?: string;
18
- }
19
- export declare function loadCredentials(): StoredCredentials | null;
20
- /**
21
- * Resolve token: env var > stored credentials. Returns null when no
22
- * credentials are available — the MCP server caller decides whether
23
- * that's fatal (it usually is, but read-only diagnostics may not need
24
- * a token).
25
- */
26
- export declare function resolveCredentials(): {
27
- url: string;
28
- token: string;
29
- } | null;
30
- export {};
5
+ export { resolveCredentials, resolveCredentialsOrExit, loadCredentials, CREDENTIALS_FILE, } from '@almyty/client';
6
+ export type { StoredCredentials } from '@almyty/client';
package/dist/auth.js CHANGED
@@ -1,44 +1,5 @@
1
1
  /**
2
- * Credential resolver for @almyty/mcp-server.
3
- *
4
- * Authentication itself lives in the dedicated @almyty/auth package
5
- * (`npx @almyty/auth login`). This module just READS the shared
6
- * credentials store and surfaces them to the MCP server runtime.
7
- *
8
- * Lookup order:
9
- * 1. ALMYTY_TOKEN environment variable (CI / scripts / config files)
10
- * 2. ~/.almyty/credentials.json (interactive use, written
11
- * by `npx @almyty/auth login`)
2
+ * Thin re-export from the shared @almyty/client credential resolver.
3
+ * Keeps `./auth.js` imports working across the mcp-server codebase.
12
4
  */
13
- import { readFileSync, existsSync } from 'fs';
14
- import { homedir } from 'os';
15
- import { join } from 'path';
16
- const CREDENTIALS_FILE = join(homedir(), '.almyty', 'credentials.json');
17
- export function loadCredentials() {
18
- try {
19
- if (!existsSync(CREDENTIALS_FILE))
20
- return null;
21
- return JSON.parse(readFileSync(CREDENTIALS_FILE, 'utf-8'));
22
- }
23
- catch {
24
- return null;
25
- }
26
- }
27
- /**
28
- * Resolve token: env var > stored credentials. Returns null when no
29
- * credentials are available — the MCP server caller decides whether
30
- * that's fatal (it usually is, but read-only diagnostics may not need
31
- * a token).
32
- */
33
- export function resolveCredentials() {
34
- const envToken = process.env.ALMYTY_TOKEN;
35
- const envUrl = process.env.ALMYTY_URL || 'https://api.almyty.com';
36
- if (envToken) {
37
- return { url: envUrl, token: envToken };
38
- }
39
- const creds = loadCredentials();
40
- if (creds?.token) {
41
- return { url: creds.url, token: creds.token };
42
- }
43
- return null;
44
- }
5
+ export { resolveCredentials, resolveCredentialsOrExit, loadCredentials, CREDENTIALS_FILE, } from '@almyty/client';
package/dist/proxy.js CHANGED
@@ -24,11 +24,11 @@ export class AlmytyProxy {
24
24
  this.warn = options.warn ?? ((m) => process.stderr.write(`[almyty mcp-server] ${m}\n`));
25
25
  }
26
26
  endpoint() {
27
- // Per-gateway scoping uses the slug-based MCP route (/mcp/:orgSlug/:gatewaySlug),
27
+ // Per-gateway scoping uses the GitHub-style route (/:orgSlug/:gatewaySlug),
28
28
  // which the caller must encode into ALMYTY_GATEWAY_ID as "orgSlug/gatewaySlug".
29
29
  // The unscoped route is the universal /mcp JSON-RPC endpoint.
30
30
  return this.gatewayId
31
- ? `${this.baseUrl}/mcp/${this.gatewayId}`
31
+ ? `${this.baseUrl}/${this.gatewayId}`
32
32
  : `${this.baseUrl}/mcp`;
33
33
  }
34
34
  nextId() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almyty/mcp-server",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Skill-first API proxy for any LLM — turns APIs into AI skills via MCP with minimal token overhead",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,7 +11,7 @@
11
11
  "dist"
12
12
  ],
13
13
  "scripts": {
14
- "build": "tsc",
14
+ "build": "tsc && chmod +x dist/index.js",
15
15
  "dev": "tsx src/index.ts",
16
16
  "prepublishOnly": "npm run build"
17
17
  },
@@ -31,6 +31,7 @@
31
31
  "author": "almyty",
32
32
  "license": "BSL-1.1",
33
33
  "dependencies": {
34
+ "@almyty/client": "^0.1.0",
34
35
  "@modelcontextprotocol/sdk": "^1.7.0",
35
36
  "zod": "^3.22.0"
36
37
  },