@openpresentation/mcp 0.0.1 → 0.28.0
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/LICENSE +21 -0
- package/README.md +33 -1
- package/dist/bin.js +36 -0
- package/dist/bin.js.map +1 -0
- package/dist/chunk-7STOTAET.js +882 -0
- package/dist/chunk-7STOTAET.js.map +1 -0
- package/dist/chunk-PJIH6M4A.js +33 -0
- package/dist/chunk-PJIH6M4A.js.map +1 -0
- package/dist/chunk-XMKPAODJ.js +71 -0
- package/dist/chunk-XMKPAODJ.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +58 -0
- package/dist/server.js +11 -0
- package/dist/server.js.map +1 -0
- package/dist/stdio.d.ts +16 -0
- package/dist/stdio.js +11 -0
- package/dist/stdio.js.map +1 -0
- package/package.json +82 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Data-Advantage
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
# @openpresentation/mcp
|
|
2
|
+
|
|
3
|
+
The MCP server for OPF (Open Presentation Format). An agent or editor that speaks the [Model Context Protocol](https://modelcontextprotocol.io)
|
|
4
|
+
learns the format and checks decks through it, without shelling out and parsing text: documentation, schemas, the default catalog,
|
|
5
|
+
example decks and the six agent skills as resources, a `start_here` tool that gives a path for a goal, and `validate_deck`,
|
|
6
|
+
`get_schema`, `search_catalog`, `get_catalog_record`, `convert`, `search_docs` and `list_examples` as tools. It keeps no state, reads
|
|
7
|
+
no file, fetches nothing, and needs no API key. Node 22 or later.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
claude mcp add opf -- npx -y @openpresentation/mcp # Claude Code
|
|
11
|
+
npx -y @openpresentation/mcp # any MCP client: command npx, args -y @openpresentation/mcp
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Tools, resources (`opf://docs/format-card`, `opf://schema/presentation#Chart`, `opf://catalog/layouts/two-column`, ...), prompts, client
|
|
15
|
+
setup (Claude Code, Cursor, Claude Desktop) and a typical session: [the MCP server](https://github.com/OpenPresentation/opf/blob/main/docs/mcp.md).
|
|
16
|
+
|
|
17
|
+
## As a library
|
|
18
|
+
|
|
19
|
+
The server definition is separate from the transport and runs on an edge runtime (no Node builtin, no file read, precompiled
|
|
20
|
+
validators), for a hosted server:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { createOpfServer } from "@openpresentation/mcp"; // with the bundled docs, examples, skills and release notes
|
|
24
|
+
import { createOpfMcpServer } from "@openpresentation/mcp/server"; // the same without that data: you pass `sources`
|
|
25
|
+
|
|
26
|
+
const server = createOpfServer({ version: "0.27.0" });
|
|
27
|
+
await server.connect(transport); // stdio, or Streamable HTTP in a Worker
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`@openpresentation/mcp/stdio` is the Node stdio wrapper (`runStdio()`) that the `opf-mcp` binary and `opf mcp` of the CLI run. Layout
|
|
31
|
+
is measured with the real fonts when the optional peer `@openpresentation/opf-render` is installed beside it; otherwise it is estimated
|
|
32
|
+
and the report says so. The package is released with `@openpresentation/opf` and the other packages of
|
|
33
|
+
[OpenPresentation/opf](https://github.com/OpenPresentation/opf) at one version.
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
runStdio
|
|
4
|
+
} from "./chunk-PJIH6M4A.js";
|
|
5
|
+
import "./chunk-XMKPAODJ.js";
|
|
6
|
+
import "./chunk-7STOTAET.js";
|
|
7
|
+
|
|
8
|
+
// src/bin.ts
|
|
9
|
+
var arg = process.argv[2];
|
|
10
|
+
if (arg === "--help" || arg === "-h") {
|
|
11
|
+
process.stdout.write(`opf-mcp ${"0.28.0"}: the OPF MCP server on stdio.
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
npx -y @openpresentation/mcp run the server (an MCP client starts it: command npx, args -y @openpresentation/mcp)
|
|
15
|
+
opf-mcp --version
|
|
16
|
+
|
|
17
|
+
Tools: start_here, validate_deck, get_schema, search_catalog, get_catalog_record, convert, search_docs, list_examples.
|
|
18
|
+
Resources: opf://docs/<slug> (opf://docs/index lists them, opf://docs/whats-new), opf://schema/<name>[#<pointer or $defs name>],
|
|
19
|
+
opf://examples/<slug>, opf://catalog/<kind>/<id>, opf://skills/<name>. Prompts: learn_opf, author_deck, fix_validation_findings,
|
|
20
|
+
choose_layout. It keeps no state and reads no file. Claude Code: claude mcp add opf -- npx -y @openpresentation/mcp
|
|
21
|
+
`);
|
|
22
|
+
} else if (arg === "--version" || arg === "-v") {
|
|
23
|
+
process.stdout.write(`${"0.28.0"}
|
|
24
|
+
`);
|
|
25
|
+
} else if (arg !== void 0) {
|
|
26
|
+
process.stderr.write(`opf-mcp takes no arguments (got ${arg}). Run opf-mcp --help.
|
|
27
|
+
`);
|
|
28
|
+
process.exitCode = 2;
|
|
29
|
+
} else {
|
|
30
|
+
runStdio().catch((error) => {
|
|
31
|
+
process.stderr.write(`opf-mcp: ${error instanceof Error ? error.message : String(error)}
|
|
32
|
+
`);
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n// `opf-mcp` (and `npx -y @openpresentation/mcp`): the OPF MCP server on stdio. See docs/mcp.md.\nimport { runStdio } from \"./stdio.js\";\n\ndeclare const MCP_VERSION: string;\n\nconst arg = process.argv[2];\nif (arg === \"--help\" || arg === \"-h\") {\n\tprocess.stdout.write(`opf-mcp ${MCP_VERSION}: the OPF MCP server on stdio.\n\nUsage:\n npx -y @openpresentation/mcp run the server (an MCP client starts it: command npx, args -y @openpresentation/mcp)\n opf-mcp --version\n\nTools: start_here, validate_deck, get_schema, search_catalog, get_catalog_record, convert, search_docs, list_examples.\nResources: opf://docs/<slug> (opf://docs/index lists them, opf://docs/whats-new), opf://schema/<name>[#<pointer or $defs name>],\nopf://examples/<slug>, opf://catalog/<kind>/<id>, opf://skills/<name>. Prompts: learn_opf, author_deck, fix_validation_findings,\nchoose_layout. It keeps no state and reads no file. Claude Code: claude mcp add opf -- npx -y @openpresentation/mcp\n`);\n} else if (arg === \"--version\" || arg === \"-v\") {\n\tprocess.stdout.write(`${MCP_VERSION}\\n`);\n} else if (arg !== undefined) {\n\tprocess.stderr.write(`opf-mcp takes no arguments (got ${arg}). Run opf-mcp --help.\\n`);\n\tprocess.exitCode = 2;\n} else {\n\trunStdio().catch((error: unknown) => {\n\t\tprocess.stderr.write(`opf-mcp: ${error instanceof Error ? error.message : String(error)}\\n`);\n\t\tprocess.exitCode = 1;\n\t});\n}\n"],"mappings":";;;;;;;;AAMA,IAAM,MAAM,QAAQ,KAAK,CAAC;AAC1B,IAAI,QAAQ,YAAY,QAAQ,MAAM;AACrC,UAAQ,OAAO,MAAM,WAAW,QAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAU3C;AACD,WAAW,QAAQ,eAAe,QAAQ,MAAM;AAC/C,UAAQ,OAAO,MAAM,GAAG,QAAW;AAAA,CAAI;AACxC,WAAW,QAAQ,QAAW;AAC7B,UAAQ,OAAO,MAAM,mCAAmC,GAAG;AAAA,CAA0B;AACrF,UAAQ,WAAW;AACpB,OAAO;AACN,WAAS,EAAE,MAAM,CAAC,UAAmB;AACpC,YAAQ,OAAO,MAAM,YAAY,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,CAAI;AAC3F,YAAQ,WAAW;AAAA,EACpB,CAAC;AACF;","names":[]}
|