@superdoc-dev/mcp 1.0.0-next.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 +168 -0
- package/dist/index.js +256863 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# @superdoc-dev/mcp
|
|
2
|
+
|
|
3
|
+
MCP server for SuperDoc. Lets AI agents open, read, edit, and save `.docx` files through the [Model Context Protocol](https://modelcontextprotocol.io).
|
|
4
|
+
|
|
5
|
+
Works with Claude Code, Claude Desktop, Cursor, Windsurf, OpenAI Codex, and any MCP-compatible client.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @superdoc-dev/mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The server communicates over stdio. You don't run it directly — your MCP client spawns it as a subprocess.
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
### Claude Code
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
claude mcp add superdoc -- npx @superdoc-dev/mcp
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Claude Desktop
|
|
24
|
+
|
|
25
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"mcpServers": {
|
|
30
|
+
"superdoc": {
|
|
31
|
+
"command": "npx",
|
|
32
|
+
"args": ["@superdoc-dev/mcp"]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Cursor
|
|
39
|
+
|
|
40
|
+
Add to `~/.cursor/mcp.json`:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"mcpServers": {
|
|
45
|
+
"superdoc": {
|
|
46
|
+
"command": "npx",
|
|
47
|
+
"args": ["@superdoc-dev/mcp"]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Windsurf
|
|
54
|
+
|
|
55
|
+
Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"mcpServers": {
|
|
60
|
+
"superdoc": {
|
|
61
|
+
"command": "npx",
|
|
62
|
+
"args": ["@superdoc-dev/mcp"]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Tools
|
|
69
|
+
|
|
70
|
+
23 tools in eight groups. All tools take a `session_id` from `superdoc_open`.
|
|
71
|
+
|
|
72
|
+
### Lifecycle
|
|
73
|
+
|
|
74
|
+
| Tool | Description |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| `superdoc_open` | Open a `.docx` file and get a `session_id` |
|
|
77
|
+
| `superdoc_save` | Save the document to disk (original path or custom `out` path) |
|
|
78
|
+
| `superdoc_close` | Close the session and release memory |
|
|
79
|
+
|
|
80
|
+
### Query
|
|
81
|
+
|
|
82
|
+
| Tool | Description |
|
|
83
|
+
| --- | --- |
|
|
84
|
+
| `superdoc_find` | Search by text pattern, node type, or both. Returns addresses for mutations |
|
|
85
|
+
| `superdoc_get_node` | Get details about a specific node |
|
|
86
|
+
| `superdoc_info` | Document metadata and structure |
|
|
87
|
+
| `superdoc_get_text` | Full plain text of the document |
|
|
88
|
+
|
|
89
|
+
### Mutation
|
|
90
|
+
|
|
91
|
+
| Tool | Description |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| `superdoc_insert` | Insert text at a position. Set `suggest=true` for tracked changes |
|
|
94
|
+
| `superdoc_replace` | Replace content at a range. Set `suggest=true` for tracked changes |
|
|
95
|
+
| `superdoc_delete` | Delete content at a range. Set `suggest=true` for tracked changes |
|
|
96
|
+
|
|
97
|
+
### Format
|
|
98
|
+
|
|
99
|
+
| Tool | Description |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| `superdoc_format` | Toggle formatting (`bold`, `italic`, `underline`, `strikethrough`). Set `suggest=true` for tracked changes |
|
|
102
|
+
|
|
103
|
+
### Create
|
|
104
|
+
|
|
105
|
+
| Tool | Description |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| `superdoc_create` | Create a block element (`paragraph`, `heading`). Set `suggest=true` for tracked changes |
|
|
108
|
+
|
|
109
|
+
### Track changes
|
|
110
|
+
|
|
111
|
+
| Tool | Description |
|
|
112
|
+
| --- | --- |
|
|
113
|
+
| `superdoc_list_changes` | List all tracked changes with type, author, and excerpt |
|
|
114
|
+
| `superdoc_accept_change` | Accept a single tracked change |
|
|
115
|
+
| `superdoc_reject_change` | Reject a single tracked change |
|
|
116
|
+
| `superdoc_accept_all_changes` | Accept all tracked changes |
|
|
117
|
+
| `superdoc_reject_all_changes` | Reject all tracked changes |
|
|
118
|
+
|
|
119
|
+
### Comments
|
|
120
|
+
|
|
121
|
+
| Tool | Description |
|
|
122
|
+
| --- | --- |
|
|
123
|
+
| `superdoc_add_comment` | Add a comment anchored to a text range |
|
|
124
|
+
| `superdoc_list_comments` | List all comments with author, status, and anchored text |
|
|
125
|
+
| `superdoc_reply_comment` | Reply to an existing comment thread |
|
|
126
|
+
| `superdoc_resolve_comment` | Mark a comment as resolved |
|
|
127
|
+
|
|
128
|
+
### Lists
|
|
129
|
+
|
|
130
|
+
| Tool | Description |
|
|
131
|
+
| --- | --- |
|
|
132
|
+
| `superdoc_insert_list` | Insert a list item before or after an existing one |
|
|
133
|
+
| `superdoc_list_set_type` | Change a list between ordered and bullet |
|
|
134
|
+
|
|
135
|
+
## Workflow
|
|
136
|
+
|
|
137
|
+
Every interaction follows the same pattern:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
open → read/edit → save → close
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
1. `superdoc_open` loads a document and returns a `session_id`
|
|
144
|
+
2. `superdoc_find` locates content and returns addresses
|
|
145
|
+
3. Edit tools use those addresses to modify content
|
|
146
|
+
4. `superdoc_save` writes changes to disk
|
|
147
|
+
5. `superdoc_close` releases the session
|
|
148
|
+
|
|
149
|
+
### Suggesting mode
|
|
150
|
+
|
|
151
|
+
Set `suggest=true` on any mutation, format, or create tool to make edits appear as tracked changes (suggestions) instead of direct edits. Use `superdoc_list_changes` to review them, and `superdoc_accept_change` / `superdoc_reject_change` to resolve them.
|
|
152
|
+
|
|
153
|
+
## Development
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Run locally
|
|
157
|
+
bun run src/index.ts
|
|
158
|
+
|
|
159
|
+
# Run tests
|
|
160
|
+
bun test
|
|
161
|
+
|
|
162
|
+
# Test with MCP Inspector
|
|
163
|
+
npx @modelcontextprotocol/inspector -- bun run src/index.ts
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
See the [SuperDoc license](../../LICENSE).
|