posthive-mcp 0.1.0 → 0.1.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 +5 -7
- package/dist/index.js +5 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,8 +21,7 @@ Add this to your `claude_desktop_config.json`:
|
|
|
21
21
|
"command": "npx",
|
|
22
22
|
"args": ["posthive-mcp"],
|
|
23
23
|
"env": {
|
|
24
|
-
"POSTHIVE_API_KEY": "ph_your_key_here"
|
|
25
|
-
"POSTHIVE_API_URL": "https://api.posthive.co"
|
|
24
|
+
"POSTHIVE_API_KEY": "ph_your_key_here"
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -32,7 +31,7 @@ Add this to your `claude_desktop_config.json`:
|
|
|
32
31
|
### Claude Code (CLI)
|
|
33
32
|
|
|
34
33
|
```bash
|
|
35
|
-
claude mcp add posthive -e POSTHIVE_API_KEY=ph_xxx
|
|
34
|
+
claude mcp add posthive -e POSTHIVE_API_KEY=ph_xxx -- npx posthive-mcp
|
|
36
35
|
```
|
|
37
36
|
|
|
38
37
|
### Cursor / Windsurf
|
|
@@ -46,8 +45,7 @@ Add to your MCP config (`.cursor/mcp.json` or `.windsurf/mcp.json`):
|
|
|
46
45
|
"command": "npx",
|
|
47
46
|
"args": ["posthive-mcp"],
|
|
48
47
|
"env": {
|
|
49
|
-
"POSTHIVE_API_KEY": "ph_your_key_here"
|
|
50
|
-
"POSTHIVE_API_URL": "https://api.posthive.co"
|
|
48
|
+
"POSTHIVE_API_KEY": "ph_your_key_here"
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
}
|
|
@@ -56,7 +54,7 @@ Add to your MCP config (`.cursor/mcp.json` or `.windsurf/mcp.json`):
|
|
|
56
54
|
|
|
57
55
|
### Self-hosted Posthive
|
|
58
56
|
|
|
59
|
-
|
|
57
|
+
Set `POSTHIVE_API_URL` to your own API URL (e.g. `http://localhost:3001`). Omit it to use the hosted Posthive API at `https://api.posthive.co`.
|
|
60
58
|
|
|
61
59
|
---
|
|
62
60
|
|
|
@@ -65,7 +63,7 @@ Replace `https://api.posthive.co` with your own API URL (e.g. `http://localhost:
|
|
|
65
63
|
| Variable | Required | Description |
|
|
66
64
|
|----------|----------|-------------|
|
|
67
65
|
| `POSTHIVE_API_KEY` | Yes | API key from Posthive Settings → API Keys |
|
|
68
|
-
| `POSTHIVE_API_URL` |
|
|
66
|
+
| `POSTHIVE_API_URL` | No | Base URL of your Posthive API. Defaults to `https://api.posthive.co`. Set this only for self-hosted deployments. |
|
|
69
67
|
|
|
70
68
|
---
|
|
71
69
|
|
package/dist/index.js
CHANGED
|
@@ -5,23 +5,20 @@
|
|
|
5
5
|
* Exposes Posthive's scheduling API as MCP tools for use with Claude Code,
|
|
6
6
|
* Cursor, or any MCP-compatible agent.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* POSTHIVE_API_KEY — API key from Posthive Settings → API Keys
|
|
10
|
-
* POSTHIVE_API_URL — Base URL of your Posthive API (
|
|
8
|
+
* Env vars:
|
|
9
|
+
* POSTHIVE_API_KEY — required. API key from Posthive Settings → API Keys
|
|
10
|
+
* POSTHIVE_API_URL — optional. Base URL of your Posthive API (default: https://api.posthive.co).
|
|
11
|
+
* Set this for self-hosted deployments.
|
|
11
12
|
*/
|
|
12
13
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
13
14
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
14
15
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
15
16
|
const API_KEY = process.env.POSTHIVE_API_KEY;
|
|
16
|
-
const API_URL = (process.env.POSTHIVE_API_URL ?? "").replace(/\/$/, "");
|
|
17
|
+
const API_URL = (process.env.POSTHIVE_API_URL ?? "https://api.posthive.co").replace(/\/$/, "");
|
|
17
18
|
if (!API_KEY) {
|
|
18
19
|
process.stderr.write("Error: POSTHIVE_API_KEY environment variable is required\n");
|
|
19
20
|
process.exit(1);
|
|
20
21
|
}
|
|
21
|
-
if (!API_URL) {
|
|
22
|
-
process.stderr.write("Error: POSTHIVE_API_URL environment variable is required\n");
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
22
|
// ─── HTTP helper ─────────────────────────────────────────────────────────────
|
|
26
23
|
async function apiCall(method, path, body) {
|
|
27
24
|
const res = await fetch(`${API_URL}${path}`, {
|
package/package.json
CHANGED