mdshare 1.0.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/README.md +52 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# mdshare
|
|
2
|
+
|
|
3
|
+
**The output layer for AI agents** — turn any markdown into a beautiful shareable link.
|
|
4
|
+
|
|
5
|
+
MCP server that gives Claude (and any MCP-compatible AI) a `share_markdown` tool.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g mdshare
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Configure Claude Desktop
|
|
14
|
+
|
|
15
|
+
Add to your `claude_desktop_config.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"mdshare": {
|
|
21
|
+
"command": "mdshare"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Config file locations:
|
|
28
|
+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
29
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
30
|
+
- **Linux:** `~/.config/Claude/claude_desktop_config.json`
|
|
31
|
+
|
|
32
|
+
Restart Claude Desktop. You'll see `share_markdown` in the tools panel.
|
|
33
|
+
|
|
34
|
+
## What it does
|
|
35
|
+
|
|
36
|
+
Ask Claude to share any response as a link:
|
|
37
|
+
|
|
38
|
+
> "Share this analysis as a link I can send to my team"
|
|
39
|
+
|
|
40
|
+
Claude calls `share_markdown` → returns a rendered URL → paste it anywhere.
|
|
41
|
+
|
|
42
|
+
## Self-hosting
|
|
43
|
+
|
|
44
|
+
By default, mdshare uses the public API. To self-host:
|
|
45
|
+
|
|
46
|
+
1. Clone the repo: `github.com/RileyLin/mdshare`
|
|
47
|
+
2. Deploy to Vercel (one-click button in repo README)
|
|
48
|
+
3. Set `MDSHARE_API` env var to your instance URL
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
const MDSHARE_API = "https://mdshare-rileylins-projects.vercel.app/api/share";
|
|
6
|
+
const server = new Server({
|
|
7
|
+
name: "mdshare-mcp",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
}, {
|
|
10
|
+
capabilities: {
|
|
11
|
+
tools: {},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
15
|
+
return {
|
|
16
|
+
tools: [
|
|
17
|
+
{
|
|
18
|
+
name: "share_markdown",
|
|
19
|
+
description: "Share markdown as a beautifully rendered web page. Returns a URL you can send in any chat app.",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
markdown: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "The markdown content to render and share",
|
|
26
|
+
},
|
|
27
|
+
ttl: {
|
|
28
|
+
type: "number",
|
|
29
|
+
description: "Time-to-live in seconds (optional, default: 86400 = 24h)",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
required: ["markdown"],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
39
|
+
if (request.params.name !== "share_markdown") {
|
|
40
|
+
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
41
|
+
}
|
|
42
|
+
const args = request.params.arguments;
|
|
43
|
+
if (!args.markdown || typeof args.markdown !== "string") {
|
|
44
|
+
throw new Error("markdown argument is required and must be a string");
|
|
45
|
+
}
|
|
46
|
+
const body = {
|
|
47
|
+
markdown: args.markdown,
|
|
48
|
+
};
|
|
49
|
+
if (args.ttl !== undefined) {
|
|
50
|
+
body.ttl = args.ttl;
|
|
51
|
+
}
|
|
52
|
+
const response = await fetch(MDSHARE_API, {
|
|
53
|
+
method: "POST",
|
|
54
|
+
headers: {
|
|
55
|
+
"Content-Type": "application/json",
|
|
56
|
+
},
|
|
57
|
+
body: JSON.stringify(body),
|
|
58
|
+
});
|
|
59
|
+
if (!response.ok) {
|
|
60
|
+
const errorText = await response.text().catch(() => "unknown error");
|
|
61
|
+
throw new Error(`mdshare API error: ${response.status} ${response.statusText} — ${errorText}`);
|
|
62
|
+
}
|
|
63
|
+
const data = (await response.json());
|
|
64
|
+
if (!data.url) {
|
|
65
|
+
throw new Error("mdshare API returned no URL");
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
type: "text",
|
|
71
|
+
text: data.url,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
async function main() {
|
|
77
|
+
const transport = new StdioServerTransport();
|
|
78
|
+
await server.connect(transport);
|
|
79
|
+
}
|
|
80
|
+
main().catch((err) => {
|
|
81
|
+
console.error("mdshare-mcp fatal error:", err);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
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AAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mdshare",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The output layer for AI agents — turn any markdown into a beautiful shareable link. MCP server for Claude Desktop & AI assistants.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mdshare": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"start": "node dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^25.6.0",
|
|
19
|
+
"typescript": "^6.0.3"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"mcp",
|
|
26
|
+
"markdown",
|
|
27
|
+
"share",
|
|
28
|
+
"model-context-protocol",
|
|
29
|
+
"claude",
|
|
30
|
+
"claude-code",
|
|
31
|
+
"ai-tools",
|
|
32
|
+
"agent",
|
|
33
|
+
"llm"
|
|
34
|
+
],
|
|
35
|
+
"author": "Riley Lin",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/RileyLin/mdshare"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/RileyLin/mdshare#mcp-server-for-claude-desktop--ai-assistants",
|
|
42
|
+
"files": [
|
|
43
|
+
"dist/",
|
|
44
|
+
"README.md"
|
|
45
|
+
]
|
|
46
|
+
}
|