headlesshost-mcp-server 1.2.0 → 1.3.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 +177 -111
- package/build/index.js +613 -149
- package/build/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,85 +1,13 @@
|
|
|
1
1
|
# Headlesshost MCP Server
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A Model Context Protocol (MCP) server that provides complete communication with the Headlesshost platform API. This server enables AI assistants to manage content sites, staging sites, pages, sections, audiences, users, and file uploads through the Headlesshost platform.
|
|
4
|
+
|
|
5
|
+
Built with `@modelcontextprotocol/sdk` v1.26 and includes tool annotations, structured logging, and Zod input validation.
|
|
4
6
|
|
|
5
7
|
## Demo
|
|
6
8
|
|
|
7
9
|
https://www.youtube.com/watch?v=xGGwcrI7gSo&feature=youtu.be
|
|
8
10
|
|
|
9
|
-
## Features
|
|
10
|
-
|
|
11
|
-
### 🔧 General System Tools (4 tools)
|
|
12
|
-
|
|
13
|
-
- **Ping**: Test authentication and connection to the Headlesshost API
|
|
14
|
-
- **Health**: Check API health status and connectivity
|
|
15
|
-
- **Reference Data**: Access system reference data and lookups
|
|
16
|
-
|
|
17
|
-
### 📁 File Management (2 tools)
|
|
18
|
-
|
|
19
|
-
- **Upload Profile Image**: Upload user profile images
|
|
20
|
-
- **Upload Staging Site File**: Upload files to staging sites
|
|
21
|
-
|
|
22
|
-
### 👥 Membership Management (8 tools)
|
|
23
|
-
|
|
24
|
-
- **User Registration**: Register new users with account creation
|
|
25
|
-
- **User Management**: Full CRUD operations for users with claims/roles support
|
|
26
|
-
- **Account Management**: View and update account information
|
|
27
|
-
|
|
28
|
-
### 🏢 Content Site Management (6 tools)
|
|
29
|
-
|
|
30
|
-
- **Content Site Creation**: Create new content site entities
|
|
31
|
-
- **Content Site Listing**: View all content sites with optional filters
|
|
32
|
-
- **Content Site Details**: Get comprehensive content site information
|
|
33
|
-
- **Content Site Updates**: Modify content site settings and configuration
|
|
34
|
-
- **Content Site Deletion**: Remove content sites from the platform
|
|
35
|
-
|
|
36
|
-
### 🌐 Staging Site Management (67 tools)
|
|
37
|
-
|
|
38
|
-
Comprehensive staging site functionality including:
|
|
39
|
-
|
|
40
|
-
#### Core Operations (4 tools)
|
|
41
|
-
|
|
42
|
-
- **Site Operations**: Update, delete, publish staging sites
|
|
43
|
-
- **Site Information**: Get staging site details and metadata
|
|
44
|
-
- **Site Management**: Clone, promote, and revert staging sites
|
|
45
|
-
- **Published Sites**: Access published site versions
|
|
46
|
-
|
|
47
|
-
#### Page Management (4 tools)
|
|
48
|
-
|
|
49
|
-
- **Page CRUD**: Create, read, update, delete staging site pages
|
|
50
|
-
- **Page Content**: Handle page content and structure
|
|
51
|
-
- **Page Analytics**: Track page-level performance
|
|
52
|
-
- **Page Logs**: Monitor page activity and changes
|
|
53
|
-
|
|
54
|
-
#### Section Management (6 tools)
|
|
55
|
-
|
|
56
|
-
- **Section CRUD**: Create, read, update, delete page sections
|
|
57
|
-
- **Section Content**: Manage section-specific content
|
|
58
|
-
- **Section Logs**: Track section-level modifications
|
|
59
|
-
|
|
60
|
-
#### User Management (5 tools)
|
|
61
|
-
|
|
62
|
-
- **User Access Control**: Grant and manage user access to staging sites
|
|
63
|
-
- **Role Management**: Assign and update user roles per site
|
|
64
|
-
- **Permissions**: Configure granular user permissions
|
|
65
|
-
- **User Listing**: View all site users and their roles
|
|
66
|
-
|
|
67
|
-
#### Business Operations (7 tools)
|
|
68
|
-
|
|
69
|
-
- **Business Logs**: Access business activity and audit trails
|
|
70
|
-
- **Business Analytics**: Business-level performance metrics
|
|
71
|
-
- **User Management**: Business user access and permissions
|
|
72
|
-
- **Role Management**: Business role definitions and assignments
|
|
73
|
-
|
|
74
|
-
#### System Resources (8 tools)
|
|
75
|
-
|
|
76
|
-
- **Hit Tracking**: Raw analytics data and visitor metrics
|
|
77
|
-
- **System Health**: Monitor platform connectivity and status
|
|
78
|
-
|
|
79
|
-
## 📈 Total Coverage
|
|
80
|
-
|
|
81
|
-
**87 Tools** providing complete API coverage across all Headlesshost platform functionality!
|
|
82
|
-
|
|
83
11
|
## Installation
|
|
84
12
|
|
|
85
13
|
1. Clone this repository
|
|
@@ -96,36 +24,61 @@ Comprehensive staging site functionality including:
|
|
|
96
24
|
|
|
97
25
|
## Configuration
|
|
98
26
|
|
|
99
|
-
|
|
27
|
+
The server requires a Headlesshost API key set via the `HEADLESSHOST_API_KEY` environment variable.
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
### With Claude Desktop
|
|
32
|
+
|
|
33
|
+
Add this configuration to your Claude Desktop config file:
|
|
100
34
|
|
|
101
35
|
```bash
|
|
102
|
-
|
|
36
|
+
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
|
|
37
|
+
Windows: %APPDATA%\Claude\claude_desktop_config.json
|
|
103
38
|
```
|
|
104
39
|
|
|
105
|
-
|
|
40
|
+
#### Local development
|
|
106
41
|
|
|
107
|
-
```
|
|
108
|
-
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"mcpServers": {
|
|
45
|
+
"headlesshost-cms": {
|
|
46
|
+
"command": "node",
|
|
47
|
+
"args": ["/path/to/kapiti.mcp/build/index.js"],
|
|
48
|
+
"env": {
|
|
49
|
+
"HEADLESSHOST_API_KEY": "your-auth-token"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
109
54
|
```
|
|
110
55
|
|
|
111
|
-
|
|
56
|
+
#### Via npx
|
|
112
57
|
|
|
113
|
-
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"headlesshost-cms": {
|
|
62
|
+
"command": "npx",
|
|
63
|
+
"args": ["headlesshost-mcp-server"],
|
|
64
|
+
"env": {
|
|
65
|
+
"HEADLESSHOST_API_KEY": "your-auth-token"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
114
71
|
|
|
115
|
-
|
|
72
|
+
### With Claude Code
|
|
116
73
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
/Users/warren/Library/Application Support/Claude/claude_desktop_config.json
|
|
121
|
-
```
|
|
74
|
+
Add to your `.claude/settings.json`:
|
|
122
75
|
|
|
123
76
|
```json
|
|
124
77
|
{
|
|
125
78
|
"mcpServers": {
|
|
126
|
-
"
|
|
79
|
+
"headlesshost-cms": {
|
|
127
80
|
"command": "node",
|
|
128
|
-
"args": ["/path/to/
|
|
81
|
+
"args": ["/path/to/kapiti.mcp/build/index.js"],
|
|
129
82
|
"env": {
|
|
130
83
|
"HEADLESSHOST_API_KEY": "your-auth-token"
|
|
131
84
|
}
|
|
@@ -136,20 +89,134 @@ On a Mac (edit or create this file).
|
|
|
136
89
|
|
|
137
90
|
### With Other MCP Clients
|
|
138
91
|
|
|
139
|
-
This server is compatible with any MCP client including
|
|
140
|
-
|
|
141
|
-
- VS Code with MCP extensions
|
|
142
|
-
- Zed Editor
|
|
143
|
-
- Continue.dev
|
|
144
|
-
- Custom MCP implementations
|
|
92
|
+
This server is compatible with any MCP client including VS Code, Zed Editor, Continue.dev, and custom MCP implementations.
|
|
145
93
|
|
|
146
94
|
Configure your client to use:
|
|
147
95
|
|
|
148
96
|
- **Command**: `node`
|
|
149
|
-
- **Args**: `["/path/to/
|
|
97
|
+
- **Args**: `["/path/to/kapiti.mcp/build/index.js"]`
|
|
150
98
|
- **Environment**: Set `HEADLESSHOST_API_KEY`
|
|
151
99
|
|
|
152
|
-
|
|
100
|
+
## Tools (53)
|
|
101
|
+
|
|
102
|
+
All tools include MCP annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) to help clients present appropriate UI and confirmation prompts.
|
|
103
|
+
|
|
104
|
+
### General (3)
|
|
105
|
+
|
|
106
|
+
| Tool | Description |
|
|
107
|
+
|------|-------------|
|
|
108
|
+
| `ping` | Test authentication and connection |
|
|
109
|
+
| `health` | Check API health status |
|
|
110
|
+
| `get_ref_data` | Get system reference data and lookups |
|
|
111
|
+
|
|
112
|
+
### User Management (4)
|
|
113
|
+
|
|
114
|
+
| Tool | Description |
|
|
115
|
+
|------|-------------|
|
|
116
|
+
| `create_user` | Create a new user in the current account |
|
|
117
|
+
| `get_user` | Get user details by ID |
|
|
118
|
+
| `update_user` | Update user information and claims |
|
|
119
|
+
| `delete_user` | Delete a user from the system |
|
|
120
|
+
|
|
121
|
+
### Account Management (3)
|
|
122
|
+
|
|
123
|
+
| Tool | Description |
|
|
124
|
+
|------|-------------|
|
|
125
|
+
| `create_account` | Create a new user account |
|
|
126
|
+
| `get_account` | Get current account information |
|
|
127
|
+
| `update_account` | Update account information |
|
|
128
|
+
|
|
129
|
+
### File Uploads (3)
|
|
130
|
+
|
|
131
|
+
| Tool | Description |
|
|
132
|
+
|------|-------------|
|
|
133
|
+
| `upload_user_profile_image` | Upload a profile image for a user |
|
|
134
|
+
| `upload_staging_site_file` | Upload a file to a staging site |
|
|
135
|
+
| `upload_staging_site_image` | Upload an image to a staging site |
|
|
136
|
+
|
|
137
|
+
### Content Sites (5)
|
|
138
|
+
|
|
139
|
+
| Tool | Description |
|
|
140
|
+
|------|-------------|
|
|
141
|
+
| `create_content_site` | Create a new content site |
|
|
142
|
+
| `get_content_sites` | Get all content sites in the account |
|
|
143
|
+
| `get_content_site` | Get content site details by ID |
|
|
144
|
+
| `update_content_site` | Update content site information |
|
|
145
|
+
| `delete_content_site` | Delete a content site |
|
|
146
|
+
|
|
147
|
+
### Staging Sites (9)
|
|
148
|
+
|
|
149
|
+
| Tool | Description |
|
|
150
|
+
|------|-------------|
|
|
151
|
+
| `update_staging_site` | Update staging site information |
|
|
152
|
+
| `delete_staging_site` | Delete a staging site |
|
|
153
|
+
| `publish_staging_site` | Publish a staging site to make it live |
|
|
154
|
+
| `get_staging_site` | Get staging site details |
|
|
155
|
+
| `get_staging_site_pages` | Get staging site pages |
|
|
156
|
+
| `get_staging_site_configuration` | Get staging site configuration including section types |
|
|
157
|
+
| `get_staging_site_logs` | Get change logs since last publish |
|
|
158
|
+
| `get_published_sites` | Get published sites for a content site |
|
|
159
|
+
| `revert_staging_site` | Revert a staging site to a previous state |
|
|
160
|
+
| `clone_staging_site` | Clone a staging site |
|
|
161
|
+
|
|
162
|
+
### Pages (6)
|
|
163
|
+
|
|
164
|
+
| Tool | Description |
|
|
165
|
+
|------|-------------|
|
|
166
|
+
| `create_staging_site_page` | Create a new page |
|
|
167
|
+
| `get_staging_site_page` | Get page details (with optional sections) |
|
|
168
|
+
| `update_staging_site_page` | Update a page |
|
|
169
|
+
| `delete_staging_site_page` | Delete a page |
|
|
170
|
+
| `revert_staging_site_page` | Revert a page to a previous state |
|
|
171
|
+
| `get_staging_site_page_logs` | Get page change logs since last publish |
|
|
172
|
+
|
|
173
|
+
### Sections (7)
|
|
174
|
+
|
|
175
|
+
| Tool | Description |
|
|
176
|
+
|------|-------------|
|
|
177
|
+
| `create_staging_site_section` | Create a new section in a page |
|
|
178
|
+
| `get_staging_site_section` | Get section details |
|
|
179
|
+
| `update_staging_site_section` | Update a section |
|
|
180
|
+
| `delete_staging_site_section` | Delete a section |
|
|
181
|
+
| `publish_staging_site_section` | Publish a single section |
|
|
182
|
+
| `revert_staging_site_section` | Revert a section to a previous state |
|
|
183
|
+
| `get_staging_site_section_logs` | Get section change logs since last publish |
|
|
184
|
+
|
|
185
|
+
### Site Audiences (4)
|
|
186
|
+
|
|
187
|
+
| Tool | Description |
|
|
188
|
+
|------|-------------|
|
|
189
|
+
| `create_staging_site_audience` | Create an audience (locale/segment combination) for a site |
|
|
190
|
+
| `get_staging_site_audience` | Get audience details |
|
|
191
|
+
| `update_staging_site_audience` | Update an audience |
|
|
192
|
+
| `delete_staging_site_audience` | Delete an audience (base audience cannot be deleted) |
|
|
193
|
+
|
|
194
|
+
### Section Audiences (4)
|
|
195
|
+
|
|
196
|
+
| Tool | Description |
|
|
197
|
+
|------|-------------|
|
|
198
|
+
| `create_staging_site_section_audience` | Create an audience override for a section |
|
|
199
|
+
| `get_staging_site_section_audience` | Get section audience details |
|
|
200
|
+
| `update_staging_site_section_audience` | Update a section audience override |
|
|
201
|
+
| `delete_staging_site_section_audience` | Delete a section audience override |
|
|
202
|
+
|
|
203
|
+
### Analytics (4)
|
|
204
|
+
|
|
205
|
+
| Tool | Description |
|
|
206
|
+
|------|-------------|
|
|
207
|
+
| `get_content_site_logs` | Get the last 15 activity logs |
|
|
208
|
+
| `get_content_site_hits` | Get daily hit analytics |
|
|
209
|
+
| `get_content_site_accounts` | Get associated accounts |
|
|
210
|
+
| `get_content_site_claims` | Get current user claims |
|
|
211
|
+
|
|
212
|
+
## Resources
|
|
213
|
+
|
|
214
|
+
The server provides 2 resources for configuration and monitoring:
|
|
215
|
+
|
|
216
|
+
- **API Configuration** (`config://api`) — Available endpoints and current settings
|
|
217
|
+
- **API Health Status** (`health://api`) — Real-time connectivity and response time
|
|
218
|
+
|
|
219
|
+
## Development
|
|
153
220
|
|
|
154
221
|
Build the server:
|
|
155
222
|
|
|
@@ -157,37 +224,36 @@ Build the server:
|
|
|
157
224
|
npm run build
|
|
158
225
|
```
|
|
159
226
|
|
|
160
|
-
Run
|
|
227
|
+
Run in development mode:
|
|
161
228
|
|
|
162
229
|
```bash
|
|
163
|
-
npm
|
|
230
|
+
npm run dev
|
|
164
231
|
```
|
|
165
232
|
|
|
166
|
-
|
|
233
|
+
Watch for changes:
|
|
167
234
|
|
|
168
235
|
```bash
|
|
169
|
-
npm run
|
|
236
|
+
npm run watch
|
|
170
237
|
```
|
|
171
238
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
The server provides 2 resources for configuration and monitoring:
|
|
239
|
+
Run the MCP inspector for debugging:
|
|
175
240
|
|
|
176
|
-
|
|
177
|
-
|
|
241
|
+
```bash
|
|
242
|
+
npm run inspector
|
|
243
|
+
```
|
|
178
244
|
|
|
179
245
|
## Error Handling
|
|
180
246
|
|
|
181
|
-
The server includes
|
|
247
|
+
The server includes structured error handling:
|
|
182
248
|
|
|
183
249
|
- API authentication validation
|
|
184
250
|
- Network connectivity checks
|
|
185
|
-
-
|
|
251
|
+
- Structured logging via MCP logging capability (errors are sent to the client)
|
|
186
252
|
- Graceful fallbacks for API timeouts
|
|
187
253
|
|
|
188
254
|
## Security
|
|
189
255
|
|
|
190
256
|
- API key authentication required for all operations
|
|
191
257
|
- Secure environment variable handling
|
|
192
|
-
-
|
|
193
|
-
-
|
|
258
|
+
- Input validation via Zod schemas on all tool inputs
|
|
259
|
+
- Tool annotations signal destructive operations to clients
|