@socialneuron/mcp-server 1.6.1 → 1.7.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.
Files changed (5) hide show
  1. package/CHANGELOG.md +18 -84
  2. package/README.md +19 -77
  3. package/dist/http.js +4515 -3564
  4. package/dist/index.js +4151 -2527
  5. package/package.json +16 -15
package/CHANGELOG.md CHANGED
@@ -2,100 +2,34 @@
2
2
 
3
3
  All notable changes to `@socialneuron/mcp-server` will be documented in this file.
4
4
 
5
- ## [1.6.1] - 2026-03-22
6
-
7
- ### Security
8
- - **Explicit body size limit**: `express.json({ limit: '50kb' })` prevents DoS via oversized payloads.
9
- - **Error message sanitization**: MCP POST catch block now uses `sanitizeError()` — no more internal paths or table names in error responses.
10
- - **PII removal**: Removed `email` from API key validation chain (7 files). Key validation no longer exposes user email addresses.
11
- - **Generation rate limiting**: Added explicit `generation` category at 20 req/min (previously fell back to `read` at 60/min).
12
- - **npm provenance**: Added `--provenance` flag and `id-token: write` permission to release workflow for supply chain verification.
13
- - **Security comment**: Documented that Edge Functions must not trust `x-internal-worker-call` header without Bearer token verification.
14
-
15
- ### Fixed
16
- - **hono prototype pollution**: Updated transitive dependency to fix GHSA-v8w9-8mx6-g223.
17
- - `npm audit` now reports 0 vulnerabilities.
5
+ ## [1.7.0] - 2026-04-03
18
6
 
19
7
  ### Added
20
- - 18 examples (8 REST curl, 5 TypeScript SDK, 4 CLI, 1 MCP prompts).
21
- - TypeScript SDK package (`packages/sdk/`) with 9 resource classes.
22
- - CLI tab completion and content generation commands.
23
- - SDK documentation and release workflow.
24
-
25
- ## [1.6.0] - 2026-03-21
26
8
 
27
- ### Added
28
- - **REST API layer**: Universal tool proxy at `POST /v1/tools/:name` call any of the 52 MCP tools via standard HTTP REST. No MCP client required.
29
- - **OpenAPI 3.1 spec**: Auto-generated from TOOL_CATALOG at `/openapi.json` — always in sync with tools.
30
- - **15 convenience endpoints**: Resource-oriented routes for common operations (`/v1/credits`, `/v1/content/generate`, `/v1/posts`, etc.).
31
- - **Express HTTP transport**: New `dist/http.js` entry point for running as a standalone REST API server.
32
- - **MCP Registry metadata**: `server.json` with mcpName, endpoints, env, and auth configuration for registry discovery.
33
- - **Cursor Directory manifest**: Plugin manifest for Cursor IDE integration.
9
+ - **`/config` endpoint**: Returns server configuration (tools count, version, capabilities) without authentication
10
+ - **Rate limit exemptions**: `/config`, `/health`, and `/.well-known/` paths bypass rate limiting
11
+ - **All tools migrated to gateway**: 13 tool files moved from `getSupabaseClient()` to `callEdgeFunction('mcp-data', ...)` tools now work in cloud mode (API key users)
12
+ - **REST API layer**: Universal tool proxy (`POST /v1/tools/:name`), 15 convenience endpoints, OpenAPI 3.1 spec
13
+ - **64 tools** (was 52): distribution, media, and configuration tools added
14
+ - **mcp-data gateway**: 17 new actions added for cloud-mode tool execution
34
15
 
35
16
  ### Fixed
36
- - **TS2345**: Cast Express route param to string for strict TypeScript compatibility.
37
- - **npm publish 404**: Removed `--provenance` flag from release workflow (incompatible with scoped packages on granular tokens).
38
-
39
- ### Changed
40
- - Dual transport support: MCP (stdio) and HTTP (Express) from a single codebase.
41
- - SECURITY.md updated with v1.6.x in supported versions.
42
- - `docs/auth.md` domain reference corrected (`www.socialneuron.com` → `socialneuron.com`).
43
-
44
- ## [1.5.2] - 2026-03-20
45
-
46
- ### Added
47
- - **Error recovery hints**: All 47 error paths now include actionable recovery guidance — agents know what to call next when something fails (e.g., "Call get_credit_balance to check remaining credits" or "Verify platform OAuth with list_connected_accounts").
48
- - Central `formatToolError()` helper with 9 error categories: rate limits, credits, OAuth, generation, not-found, access, SSRF, scheduling, and plan validation.
49
- - 18 new tests for error recovery formatting.
50
-
51
- ## [1.5.1] - 2026-03-20
52
17
 
53
- ### Added
54
- - **MCP tool annotations**: All 52 tools now declare `readOnlyHint`, `destructiveHint`, `idempotentHint`, and `openWorldHint` per MCP spec. Agents can now determine which tools are safe to call without confirmation.
55
- - **Complete parameter descriptions**: Added `.describe()` to all remaining parameters (248 total). Every parameter now has format examples, constraints, and usage guidance.
56
-
57
- ### Changed
58
- - Updated test setup to support 5-argument `server.tool()` signature with annotations.
59
-
60
- ## [1.5.0] - 2026-03-19
61
-
62
- ### Changed
63
- - **LLM-optimized tool descriptions**: Rewrote 27 tool descriptions and enriched 15 parameters for agent comprehension. Every tool now answers "when to call", "what to pass", and "what comes next" — following Arcade ToolBench patterns (Tool Description, Constrained Input, Dependency Hint, Performance Hint).
64
- - **API key cache TTL**: Reduced from 60s to 10s to limit revocation exposure window.
65
- - **OAuth issuer URL**: Production metadata now derives from `MCP_SERVER_URL` instead of defaulting to localhost.
66
- - **SECURITY.md**: Updated supported versions, added scanner false-positive documentation.
67
- - **CLI setup URL**: Fixed `app.socialneuron.com` → `www.socialneuron.com`.
68
-
69
- ### Dependencies
70
- - `@supabase/supabase-js` 2.98.0 → 2.99.2
71
- - `open` 10.0.0 → 11.0.0 (requires Node.js 20+)
72
- - `posthog-node` 5.28.1 → 5.28.3
73
- - `vitest` 3.2.4 → 4.1.0
74
- - `esbuild` 0.27.3 → 0.27.4
75
- - `@types/node` 25.4.0 → 25.5.0
76
-
77
- ## [1.4.0] - 2026-03-13
18
+ - **Smithery OAuth**: `/register` now allows all HTTPS redirect URIs per MCP spec (was Claude-only)
19
+ - **Zod 4 compatibility**: Upgraded zod 3→4 for SDK v1.27 compatibility
20
+ - **Express middleware**: Added express-rate-limit + cors as direct dependencies
78
21
 
79
- ### Changed
80
- - **Telemetry is now opt-IN**: No data is sent unless `SOCIALNEURON_TELEMETRY=1` is explicitly set. Previously telemetry was opt-out.
81
- - **PostHog moved to optionalDependencies**: `posthog-node` is no longer a required runtime dependency. The package works fully without it installed. This reduces supply chain surface and resolves socket.dev security flags.
82
- - **Dynamic import**: PostHog is loaded via `import()` at runtime, silently skipped if unavailable.
83
- - `DO_NOT_TRACK=1` continues to override and disable telemetry in all cases.
84
-
85
- ## [1.3.2] - 2026-03-13
22
+ ### Security
86
23
 
87
- ### Fixed
88
- - **TypeScript strict mode**: Added `@types/express`, fixed `AuthenticatedRequest` type to extend express `Request`, corrected `StreamableHTTPServerTransport` constructor usage
89
- - **Optional dependency stubs**: Added ambient declarations for `playwright`, `@remotion/bundler`, `@remotion/renderer` (dynamically imported, not required at runtime)
90
- - **Removed unused directive**: Cleaned up stale `@ts-expect-error` in REPL module
91
- - **Release CI**: Typecheck now passes in GitHub Actions release workflow
24
+ - 50kb body limit on all endpoints
25
+ - `sanitizeError` on /mcp catch path
26
+ - Email removed from auth chain
27
+ - Generation rate limit 20/min
92
28
 
93
- ## [1.3.1] - 2026-03-13
29
+ ### Internal
94
30
 
95
- ### Fixed
96
- - **zod v4 compatibility**: Updated `zod` dependency from v3 to v4 to match `@modelcontextprotocol/sdk` peer requirement, fixing `ERR_PACKAGE_PATH_NOT_EXPORTED` crash on `npx` install
97
- - **Test domain**: Fixed test fixtures using deprecated `socialneuron.ai` domain (now `socialneuron.com`)
98
- - **CLI E2E timeout**: Increased envelope test timeout to avoid false failures
31
+ - 64 tools, 900+ tests, ~375KB build
32
+ - OpenAPI 3.1 spec auto-generated from tool schemas
99
33
 
100
34
  ## [1.3.0] - 2026-03-13
101
35
 
package/README.md CHANGED
@@ -1,26 +1,13 @@
1
1
  # @socialneuron/mcp-server
2
2
 
3
- > 52 tools for AI-powered social media management. MCP, REST API, CLI — create content, schedule posts, track analytics, and optimize performance.
3
+ > 63 MCP tools for AI-powered social media management. Create content, schedule posts, track analytics, and optimize performance — all from Claude Code or any MCP client.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@socialneuron/mcp-server)](https://www.npmjs.com/package/@socialneuron/mcp-server)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
- ## Integration Methods
9
-
10
- | Method | Best For | Docs |
11
- |--------|----------|------|
12
- | **MCP** | AI agents (Claude, Cursor, VS Code) | [Setup](#quick-start) |
13
- | **REST API** | Any HTTP client, webhooks, Zapier | [Guide](docs/rest-api.md) |
14
- | **CLI** | Terminal, CI/CD pipelines | [Guide](docs/cli-guide.md) |
15
- | **SDK** | TypeScript/Node.js apps | Coming Q2 2026 |
16
-
17
- All methods share the same 52 tools, auth, scopes, and credit system. [Compare methods](docs/integration-methods.md).
18
-
19
8
  ## Quick Start
20
9
 
21
- ### MCP (AI Agents)
22
-
23
- #### 1. Authenticate
10
+ ### 1. Authenticate
24
11
 
25
12
  ```bash
26
13
  npx -y @socialneuron/mcp-server login --device
@@ -28,7 +15,7 @@ npx -y @socialneuron/mcp-server login --device
28
15
 
29
16
  This opens your browser to authorize access. Requires a paid Social Neuron plan (Starter or above). See [pricing](https://socialneuron.com/pricing).
30
17
 
31
- #### 2. Add to Claude Code
18
+ ### 2. Add to Claude Code
32
19
 
33
20
  ```bash
34
21
  claude mcp add socialneuron -- npx -y @socialneuron/mcp-server
@@ -89,42 +76,10 @@ Add to `.cursor/mcp.json` in your workspace:
89
76
  ```
90
77
  </details>
91
78
 
92
- #### 3. Start using
79
+ ### 3. Start using
93
80
 
94
81
  Ask Claude: "What content should I post this week?" or "Schedule my latest video to YouTube and TikTok"
95
82
 
96
- ### REST API (Any Language)
97
-
98
- ```bash
99
- # Check credits
100
- curl -H "Authorization: Bearer snk_live_..." \
101
- https://mcp.socialneuron.com/v1/credits
102
-
103
- # Generate content
104
- curl -X POST -H "Authorization: Bearer snk_live_..." \
105
- -H "Content-Type: application/json" \
106
- -d '{"topic": "AI trends", "platforms": ["linkedin"]}' \
107
- https://mcp.socialneuron.com/v1/content/generate
108
-
109
- # Execute any tool via proxy
110
- curl -X POST -H "Authorization: Bearer snk_live_..." \
111
- -H "Content-Type: application/json" \
112
- -d '{"response_format": "json"}' \
113
- https://mcp.socialneuron.com/v1/tools/get_brand_profile
114
- ```
115
-
116
- See [REST API docs](docs/rest-api.md) | [OpenAPI spec](https://mcp.socialneuron.com/v1/openapi.json) | [Examples](examples/rest/)
117
-
118
- ### CLI (Terminal & CI/CD)
119
-
120
- ```bash
121
- npx @socialneuron/mcp-server sn system credits --json
122
- npx @socialneuron/mcp-server sn analytics loop --json
123
- npx @socialneuron/mcp-server sn discovery tools --module content
124
- ```
125
-
126
- See [CLI guide](docs/cli-guide.md) | [Examples](examples/cli/)
127
-
128
83
  ## What You Can Do
129
84
 
130
85
  Ask Claude things like:
@@ -137,9 +92,9 @@ Ask Claude things like:
137
92
  - "Check my analytics and suggest improvements"
138
93
  - "Set up autopilot to post 3 times per week"
139
94
 
140
- ## Tool Categories (52 tools)
95
+ ## Tool Categories (63 tools)
141
96
 
142
- All tools are accessible via MCP, REST API (`POST /v1/tools/{name}`), and CLI.
97
+ These tools are available to AI agents (Claude, Cursor, etc.) via the MCP protocol.
143
98
 
144
99
  ### Content Lifecycle
145
100
 
@@ -261,7 +216,7 @@ socialneuron-mcp sn loop
261
216
  socialneuron-mcp sn credits
262
217
 
263
218
  # Agent-native CLI v2
264
- socialneuron-mcp sn tools [--module ideation] [--scope mcp:write] # List/filter all 52 tools
219
+ socialneuron-mcp sn tools [--module ideation] [--scope mcp:write] # List/filter all 63 tools
265
220
  socialneuron-mcp sn info # Version, auth, credits, tool count
266
221
  socialneuron-mcp sn plan list|view|approve # Content plan management
267
222
  socialneuron-mcp sn preset list|show|save|delete # Platform presets (6 built-in)
@@ -295,50 +250,37 @@ Each iteration produces smarter content as performance data feeds back into the
295
250
  - SSRF protection on all URL parameters with DNS rebinding prevention
296
251
  - Rate limiting per user with per-tool limits for expensive operations
297
252
  - Agent loop detection prevents runaway automation
298
- - Telemetry is off by default opt in with `SOCIALNEURON_TELEMETRY=1`
253
+ - Set `DO_NOT_TRACK=1` to disable anonymous usage telemetry
299
254
 
300
255
  See [SECURITY.md](./SECURITY.md) for our vulnerability disclosure policy and credential safety details.
301
256
 
302
257
  ## Telemetry
303
258
 
304
- Telemetry is **off by default**. No data is collected unless you explicitly opt in.
305
-
306
- **To enable**: Set `SOCIALNEURON_TELEMETRY=1` in your environment.
259
+ This package collects anonymous usage metrics (tool name, duration, success/failure) to improve the product. Your user ID is hashed before transmission.
307
260
 
308
- **To disable**: `DO_NOT_TRACK=1` or `SOCIALNEURON_NO_TELEMETRY=1` always disables telemetry, even if `SOCIALNEURON_TELEMETRY=1` is set.
261
+ **To disable**: Set `DO_NOT_TRACK=1` or `SOCIALNEURON_NO_TELEMETRY=1` in your environment.
309
262
 
310
- When enabled, the following anonymous metrics are collected via PostHog:
311
- - Tool name invoked
312
- - Success or failure status
313
- - Invocation duration (ms)
314
-
315
- No personal content, API keys, or request payloads are ever collected. Your user ID is hashed (SHA-256) before transmission.
316
-
317
- `posthog-node` is an optional dependency — if it is not installed, telemetry is a silent no-op regardless of environment variables.
263
+ No personal content, API keys, or request payloads are ever collected.
318
264
 
319
265
  ## Examples
320
266
 
321
- See the [`examples/`](examples/) directory:
267
+ See the [examples repo](https://github.com/socialneuron/examples) for prompt-driven workflow templates:
322
268
 
323
- - [REST API examples](examples/rest/) — curl scripts for every endpoint
324
- - [CLI examples](examples/cli/) — automation workflows
325
- - [MCP prompts](examples/mcp/claude-prompts.md) — natural language examples
326
- - [External examples repo](https://github.com/socialneuron/examples) — prompt-driven workflow templates
269
+ - Weekly content batch planning
270
+ - Cross-platform content repurposing
327
271
  - Performance review and optimization loops
328
272
  - Brand-aligned content generation
329
273
  - Comment engagement automation
330
274
 
331
275
  ## Links
332
276
 
333
- - [For Developers](https://socialneuron.com/for-developers) — Integration methods, tools, pricing
334
- - [REST API Docs](docs/rest-api.md) — Endpoint reference
335
- - [CLI Guide](docs/cli-guide.md) — Terminal commands
336
- - [Integration Methods](docs/integration-methods.md) — Compare MCP vs REST vs CLI
337
- - [OpenAPI Spec](https://mcp.socialneuron.com/v1/openapi.json) — Machine-readable API spec
338
- - [Developer Settings](https://socialneuron.com/settings/developer) — Generate API keys
277
+ - [Social Neuron](https://socialneuron.com)
278
+ - [For Developers](https://socialneuron.com/for-developers)
339
279
  - [Documentation](https://socialneuron.com/docs)
340
- - [Pricing](https://socialneuron.com/pricing)
280
+ - [Examples](https://github.com/socialneuron/examples)
341
281
  - [Agent Protocol](https://socialneuron.com/system-prompt.txt)
282
+ - [Developer Settings](https://socialneuron.com/settings/developer)
283
+ - [Pricing](https://socialneuron.com/pricing)
342
284
 
343
285
  ## License
344
286