@modootoday/pmcp 0.8.1 → 0.8.2

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 CHANGED
@@ -191,12 +191,13 @@ export default { fetch: (request: Request) => skills.fetch(request) };
191
191
 
192
192
  The handler checks requests before they reach MCP:
193
193
 
194
- | Option | Default | Effect |
195
- | ----------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
196
- | `allowedOrigins` | none | A request with an `Origin` other than the server's own gets 403. Listed origins are served with CORS headers, and their preflight is answered. Requests without `Origin` are not from a browser page and pass. |
197
- | `allowedHosts` | any | When set, a `Host` outside the list gets 403 (DNS rebinding). |
198
- | `maxRequestBytes` | 1 MiB | A larger body gets 413; a declared length is refused before reading. |
199
- | `rateLimit` | off | `{ perMinute }` per caller id; past it, 429 with `retry-after`. |
194
+ | Option | Default | Effect |
195
+ | ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
196
+ | `allowedOrigins` | none | A request with an `Origin` other than the server's own gets 403. Listed origins are served with CORS headers, and their preflight is answered. `"*"` admits any origin. Requests without `Origin` are not from a browser page and pass. |
197
+ | `publicOrigins` | none | The server's own origins as browsers see them, when a proxy ends TLS and the request URL is `http://`. Without it, a same-site page behind such a proxy gets 403. |
198
+ | `allowedHosts` | any | When set, a `Host` outside the list gets 403 (DNS rebinding). |
199
+ | `maxRequestBytes` | 1 MiB | A larger body gets 413; a declared length is refused before reading. |
200
+ | `rateLimit` | off | `{ perMinute }` per caller id; past it, 429 with `retry-after`. |
200
201
 
201
202
  An MCP config (`.mcp.json`) is never served as written: every `env` and `headers` value is
202
203
  replaced with `<redacted>`, whichever entry reaches the file, and listed digests describe
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  openDatabase
3
- } from "./chunk-MO3LLVVY.js";
3
+ } from "./chunk-IRQTGYHA.js";
4
4
 
5
5
  // src/embed.ts
6
6
  var DEFAULT_MODEL_ID = "Xenova/multilingual-e5-small";
@@ -157,4 +157,4 @@ export {
157
157
  encodeEntries,
158
158
  openEntryVectors
159
159
  };
160
- //# sourceMappingURL=chunk-STBBSQ3R.js.map
160
+ //# sourceMappingURL=chunk-3JNWCUHA.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  normaliseIntent
3
- } from "./chunk-HB4VJ5VW.js";
3
+ } from "./chunk-UGRHZHHC.js";
4
4
 
5
5
  // src/cache.ts
6
6
  async function openDatabase(path) {
@@ -131,4 +131,4 @@ export {
131
131
  DEFAULT_INTENT_CACHE_LIMIT,
132
132
  openIntentCache
133
133
  };
134
- //# sourceMappingURL=chunk-MO3LLVVY.js.map
134
+ //# sourceMappingURL=chunk-IRQTGYHA.js.map
@@ -2,7 +2,7 @@ import {
2
2
  frontmatterObject,
3
3
  readCatalog,
4
4
  specProblems
5
- } from "./chunk-HB4VJ5VW.js";
5
+ } from "./chunk-UGRHZHHC.js";
6
6
 
7
7
  // src/config.ts
8
8
  import { existsSync, readFileSync } from "fs";
@@ -1139,4 +1139,4 @@ export {
1139
1139
  validateSkillDir,
1140
1140
  validateCatalog
1141
1141
  };
1142
- //# sourceMappingURL=chunk-DTQAN33I.js.map
1142
+ //# sourceMappingURL=chunk-O2P5AIHX.js.map
@@ -1590,7 +1590,7 @@ function registerReadTool(server, tools) {
1590
1590
 
1591
1591
  // src/mcp.ts
1592
1592
  var SERVER_NAME = "pmcp";
1593
- var SERVER_VERSION = "0.8.1";
1593
+ var SERVER_VERSION = "0.8.2";
1594
1594
  function registerSkillTools(server, tools) {
1595
1595
  registerCatalogTool(server, tools);
1596
1596
  registerFindTool(server, tools);
@@ -1661,4 +1661,4 @@ export {
1661
1661
  registerSkillTools,
1662
1662
  createSkillServer
1663
1663
  };
1664
- //# sourceMappingURL=chunk-HB4VJ5VW.js.map
1664
+ //# sourceMappingURL=chunk-UGRHZHHC.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createSkillServer
3
- } from "./chunk-HB4VJ5VW.js";
3
+ } from "./chunk-UGRHZHHC.js";
4
4
 
5
5
  // src/stdio.ts
6
6
  import { serveStdio } from "@modelcontextprotocol/server/stdio";
@@ -38,4 +38,4 @@ export {
38
38
  serve,
39
39
  main
40
40
  };
41
- //# sourceMappingURL=chunk-K7BX33LH.js.map
41
+ //# sourceMappingURL=chunk-UW7HTILA.js.map
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  loadEmbedder,
4
4
  openEntryVectors
5
- } from "./chunk-STBBSQ3R.js";
5
+ } from "./chunk-3JNWCUHA.js";
6
6
  import {
7
7
  ConfigError,
8
8
  ProjectError,
@@ -17,15 +17,15 @@ import {
17
17
  splitFrontmatter,
18
18
  validateCatalog,
19
19
  validateSkillDir
20
- } from "./chunk-DTQAN33I.js";
21
- import "./chunk-MO3LLVVY.js";
20
+ } from "./chunk-O2P5AIHX.js";
21
+ import "./chunk-IRQTGYHA.js";
22
22
  import {
23
23
  serve
24
- } from "./chunk-K7BX33LH.js";
24
+ } from "./chunk-UW7HTILA.js";
25
25
  import {
26
26
  kindOf,
27
27
  readCatalog
28
- } from "./chunk-HB4VJ5VW.js";
28
+ } from "./chunk-UGRHZHHC.js";
29
29
 
30
30
  // src/cli/command.ts
31
31
  var ArgumentError = class extends Error {
@@ -2347,7 +2347,7 @@ function dispatch(argv, options = {}) {
2347
2347
  }
2348
2348
  return run(command, rest, { ui, env, cwd });
2349
2349
  }
2350
- var VERSION = "0.8.1";
2350
+ var VERSION = "0.8.2";
2351
2351
  async function run(command, argv, context) {
2352
2352
  try {
2353
2353
  return await command.run({
package/dist/http.d.ts CHANGED
@@ -88,8 +88,10 @@ interface SkillHttpOptions extends SkillServerOptions {
88
88
  * here, so "private" unless the host knows every caller sees the same list.
89
89
  */
90
90
  readonly cacheScope?: "public" | "private";
91
- /** Browser origins, besides the server's own, whose pages may call; others get 403. */
91
+ /** Browser origins, besides the server's own, whose pages may call; others get 403. "*" admits any. */
92
92
  readonly allowedOrigins?: readonly string[];
93
+ /** The server's own public origins when a proxy ends TLS, e.g. "https://skills.example.com". */
94
+ readonly publicOrigins?: readonly string[];
93
95
  /** Host header values the server answers to; unset means any. */
94
96
  readonly allowedHosts?: readonly string[];
95
97
  /** Largest request body accepted; larger ones get 413. */
package/dist/http.js CHANGED
@@ -2,12 +2,12 @@ import {
2
2
  DEFAULT_MODEL_ID,
3
3
  encodeEntries,
4
4
  loadEmbedder
5
- } from "./chunk-STBBSQ3R.js";
6
- import "./chunk-MO3LLVVY.js";
5
+ } from "./chunk-3JNWCUHA.js";
6
+ import "./chunk-IRQTGYHA.js";
7
7
  import {
8
8
  createSkillServer,
9
9
  readCatalog
10
- } from "./chunk-HB4VJ5VW.js";
10
+ } from "./chunk-UGRHZHHC.js";
11
11
 
12
12
  // src/http.ts
13
13
  import {
@@ -22,11 +22,15 @@ var json = (status, body, headers = {}) => new Response(JSON.stringify(body), {
22
22
  status,
23
23
  headers: { "content-type": "application/json", ...headers }
24
24
  });
25
- function checkOrigin(request, allowedOrigins = []) {
25
+ function checkOrigin(request, allowedOrigins = [], publicOrigins = []) {
26
26
  const origin = request.headers.get("origin");
27
27
  if (origin === null) return { kind: "none" };
28
- if (origin === new URL(request.url).origin) return { kind: "same" };
29
- if (allowedOrigins.includes(origin)) return { kind: "allowed", origin };
28
+ if (origin === new URL(request.url).origin || publicOrigins.includes(origin)) {
29
+ return { kind: "same" };
30
+ }
31
+ if (allowedOrigins.includes(origin) || allowedOrigins.includes("*")) {
32
+ return { kind: "allowed", origin };
33
+ }
30
34
  return {
31
35
  kind: "refused",
32
36
  response: json(403, { error: "origin_not_allowed" })
@@ -192,7 +196,11 @@ function createSkillHttpHandler(options) {
192
196
  async fetch(request) {
193
197
  const wrongHost = checkHost(request, options.allowedHosts);
194
198
  if (wrongHost) return wrongHost;
195
- const origin = checkOrigin(request, options.allowedOrigins);
199
+ const origin = checkOrigin(
200
+ request,
201
+ options.allowedOrigins,
202
+ options.publicOrigins
203
+ );
196
204
  if (origin.kind === "refused") return origin.response;
197
205
  if (origin.kind !== "allowed") return serve(request);
198
206
  if (request.method === "OPTIONS") return preflight(origin.origin);
package/dist/index.d.ts CHANGED
@@ -304,7 +304,7 @@ declare function resolveSkillFileUri(uri: string, entries: readonly SkillEntry[]
304
304
 
305
305
  /** Reported to the host on connect. */
306
306
  declare const SERVER_NAME = "pmcp";
307
- declare const SERVER_VERSION = "0.8.1";
307
+ declare const SERVER_VERSION = "0.8.2";
308
308
  /**
309
309
  * Registers the skill_* tools on a server.
310
310
  *
package/dist/index.js CHANGED
@@ -14,11 +14,11 @@ import {
14
14
  readSpec,
15
15
  validateCatalog,
16
16
  validateSkillDir
17
- } from "./chunk-DTQAN33I.js";
17
+ } from "./chunk-O2P5AIHX.js";
18
18
  import {
19
19
  DEFAULT_INTENT_CACHE_LIMIT,
20
20
  openIntentCache
21
- } from "./chunk-MO3LLVVY.js";
21
+ } from "./chunk-IRQTGYHA.js";
22
22
  import {
23
23
  ASSET_KINDS,
24
24
  CATALOG_PAGE_MAX,
@@ -70,7 +70,7 @@ import {
70
70
  skillFileUri,
71
71
  specProblems,
72
72
  withoutBody
73
- } from "./chunk-HB4VJ5VW.js";
73
+ } from "./chunk-UGRHZHHC.js";
74
74
  export {
75
75
  ASSET_KINDS,
76
76
  CATALOG_PAGE_MAX,
package/dist/stdio.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  main,
4
4
  resolveRoots,
5
5
  serve
6
- } from "./chunk-K7BX33LH.js";
7
- import "./chunk-HB4VJ5VW.js";
6
+ } from "./chunk-UW7HTILA.js";
7
+ import "./chunk-UGRHZHHC.js";
8
8
  export {
9
9
  main,
10
10
  resolveRoots,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modootoday/pmcp",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "license": "Elastic-2.0",
5
5
  "author": "modootoday",
6
6
  "description": "An MCP server that finds the skills your installed packages already ship. Reads SKILL.md out of node_modules by shape rather than by path, so it sees the skills, .agent, .claude, .gemini and .codex conventions alike, and keeps session startup flat as the number of installed skills grows.",