postmd-mcp-server 2.5.0 → 2.6.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/README.md +10 -2
- package/package.json +2 -2
- package/server.json +3 -3
- package/src/server.js +11 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PostMD MCP Server
|
|
2
2
|
|
|
3
|
-
[Model Context Protocol](https://modelcontextprotocol.io) server for **[PostMD](https://postmd.turink.com)** — publish a Markdown document, get a web page you share by link, and add a document graph that the viewer draws
|
|
3
|
+
[Model Context Protocol](https://modelcontextprotocol.io) server for **[PostMD](https://postmd.turink.com)** — publish a Markdown document, get a web page you share by link, and add a document graph that the viewer draws: the reading order, the bodies and rules a document names, a procedure spread over its chapters. Optional groups, document passwords and viewer themes. This server wraps PostMD's public API (`/api/v1`) so assistants can publish, read, update and organize documents.
|
|
4
4
|
|
|
5
5
|
**Publishing needs no account and no key.** With zero configuration this server can already turn Markdown into a shareable page, and the hosted server at `https://postmd.turink.com/mcp` needs no install either. An API key adds management: organizing documents in groups, and notes.
|
|
6
6
|
|
|
@@ -59,7 +59,7 @@ Managing documents — key with `documents:write` (or password / no credential f
|
|
|
59
59
|
|
|
60
60
|
### Graphs
|
|
61
61
|
|
|
62
|
-
A PostMD document can carry graph data that the viewer draws
|
|
62
|
+
A PostMD document can carry graph data that the viewer draws, showing
|
|
63
63
|
how the parts of the document relate. No tool here creates or edits a graph, because there is no
|
|
64
64
|
endpoint for one: the data sits in the Markdown as an HTML comment and travels with the body.
|
|
65
65
|
|
|
@@ -71,6 +71,14 @@ The format is at <https://postmd.turink.com/docs/graph>. Working out what the no
|
|
|
71
71
|
they connect requires reading the document, which is the calling agent's part; PostMD only draws
|
|
72
72
|
what it finds.
|
|
73
73
|
|
|
74
|
+
### Keeping the code in the file
|
|
75
|
+
|
|
76
|
+
A Markdown file can carry the code of the document it was published as, in an HTML comment at its
|
|
77
|
+
top marked `postmd:document`. A later session that opens the file can then tell which document to
|
|
78
|
+
update without being given the address. The format is at <https://postmd.turink.com/docs/api>,
|
|
79
|
+
"Keeping the code in the file". No tool here writes the comment; the calling agent edits its own
|
|
80
|
+
file.
|
|
81
|
+
|
|
74
82
|
### Replacing content on a document that has notes
|
|
75
83
|
|
|
76
84
|
Notes are located by the text they quote, not by a stored position. Replacing a
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postmd-mcp-server",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "MCP server for PostMD — publish Markdown as a shareable web page, with document graphs
|
|
3
|
+
"version": "2.6.1",
|
|
4
|
+
"description": "MCP server for PostMD — publish Markdown as a shareable web page, with document graphs",
|
|
5
5
|
"mcpName": "io.github.reinlainer/postmd-mcp-server",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "src/index.js",
|
package/server.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.reinlainer/postmd-mcp-server",
|
|
4
|
-
"description": "Publish Markdown as a shareable web page, with document graphs
|
|
5
|
-
"version": "2.
|
|
4
|
+
"description": "Publish Markdown as a shareable web page, with document graphs",
|
|
5
|
+
"version": "2.6.1",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://github.com/reinlainer/postmd-mcp-server",
|
|
8
8
|
"source": "github"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "postmd-mcp-server",
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.6.1",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|
package/src/server.js
CHANGED
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
* 전송에 따라 달라지는 것은 어느 도구를 여느냐 하나뿐이다(REMOTE_TOOLS).
|
|
7
7
|
*
|
|
8
8
|
* 필수 환경변수는 없다. POSTMD_BASE_URL 이 없으면 운영(https://postmd.turink.com)을
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* 그런 도구를 부르면 어느 스코프가
|
|
9
|
+
* 부른다. POSTMD_API_KEY 가 없어도 문서 한 건의 발행·조회·수정·삭제는 다 된다 — 비밀번호가
|
|
10
|
+
* 없는 문서는 누구나 고치고 지울 수 있고, 걸린 문서는 그 비밀번호를 받는다. 키는 여러 파일을
|
|
11
|
+
* 한꺼번에 올리거나 메모와 그룹을 다룰 때 필요하며, 키 없이 그런 도구를 부르면 어느 스코프가
|
|
12
|
+
* 필요한지 알려 준다.
|
|
12
13
|
*
|
|
13
14
|
* 도구 설명과 오류 문구는 영어다. 이 문장들은 사람이 아니라 에이전트가 읽는다.
|
|
14
15
|
*/
|
|
@@ -51,8 +52,8 @@ const INSTRUCTIONS_REMOTE =
|
|
|
51
52
|
"data.shareUrl - hand that URL to people. What else the service can do, and which page describes it, is listed at https://postmd.turink.com/llms.txt - including graph data, which is carried inside the Markdown rather than through a tool.";
|
|
52
53
|
|
|
53
54
|
/**
|
|
54
|
-
* 원격에서 여는 도구. 자격 증명 없이 끝까지 가는 것만 남겼다 - 발행과 조회,
|
|
55
|
-
*
|
|
55
|
+
* 원격에서 여는 도구. 자격 증명 없이 끝까지 가는 것만 남겼다 - 발행과 조회, 수정·삭제다.
|
|
56
|
+
* 비밀번호가 없는 문서는 누구나 고치고 지울 수 있고, 걸린 문서는 그 비밀번호를 받는다.
|
|
56
57
|
*
|
|
57
58
|
* 뺀 것은 두 부류다. API 키를 요구하는 도구는 원격에 키를 줄 길이 없어 부르면 반드시
|
|
58
59
|
* 실패하고, `filePath` 를 받는 도구는 그 파일이 이 서버가 도는 기계에 없다.
|
|
@@ -132,7 +133,7 @@ function textErr(message) {
|
|
|
132
133
|
* 키가 필요한 도구의 문지기. 키가 없으면 네트워크에 나가지 않고 여기서 알려 준다.
|
|
133
134
|
*
|
|
134
135
|
* 원격에는 키를 건네줄 길 자체가 없다. 그 자리에서 환경변수를 설정하라고 하면 부르는 쪽이
|
|
135
|
-
* 할 수 없는 일을 시키는 것이므로, 대신
|
|
136
|
+
* 할 수 없는 일을 시키는 것이므로, 대신 키를 넣어 로컬 서버를 띄우는 길을 가리킨다.
|
|
136
137
|
*/
|
|
137
138
|
function missingKey(ctx, scopes) {
|
|
138
139
|
if (ctx.key) return null;
|
|
@@ -213,7 +214,6 @@ async function readLocalFile(filePath) {
|
|
|
213
214
|
return { buffer: await fs.readFile(resolved), suggestedName: path.basename(resolved) };
|
|
214
215
|
}
|
|
215
216
|
|
|
216
|
-
/** 첨부는 서버가 확장자로 받아 준다. Content-Type 은 예의상 맞춰 보낸다. */
|
|
217
217
|
/**
|
|
218
218
|
* 만든 문서에는 나눠 줄 주소를 붙여 준다. 에이전트의 다음 행동이 바로 그것이다.
|
|
219
219
|
*
|
|
@@ -314,7 +314,9 @@ const TOOL_DEFS = [
|
|
|
314
314
|
"30-day retention period (data.retainedUntil) that extends on each read. Documents " +
|
|
315
315
|
"without a password can be updated or deleted by anyone; password-protected documents " +
|
|
316
316
|
"require the password or the owner's API key. With an API key the document belongs to " +
|
|
317
|
-
"that member; groupId files it into that group (key with documents:write)."
|
|
317
|
+
"that member; groupId files it into that group (key with documents:write). The returned " +
|
|
318
|
+
"docCode can be kept at the top of the source file in a `postmd:document` comment " +
|
|
319
|
+
"(format at /docs/api) so a later session finds the document.",
|
|
318
320
|
annotations: { title: "Publish document", destructiveHint: false },
|
|
319
321
|
inputSchema: {
|
|
320
322
|
type: "object",
|
|
@@ -323,7 +325,7 @@ const TOOL_DEFS = [
|
|
|
323
325
|
type: "string",
|
|
324
326
|
description:
|
|
325
327
|
"Full Markdown document as one UTF-8 string (the entire source, not a summary). " +
|
|
326
|
-
"May include graph data in an HTML comment, which the viewer draws
|
|
328
|
+
"May include graph data in an HTML comment, which the viewer draws; " +
|
|
327
329
|
"the format is at /docs/graph.",
|
|
328
330
|
},
|
|
329
331
|
title: {
|