Skip to content

fix: v1.0.2 β€” drop /v1 prefix (live production bug) + add new tool params#2

Merged
OussemaFr merged 1 commit into
mainfrom
fix/v1-url-bug-tools-cleanup-v1.0.2
Jun 29, 2026
Merged

fix: v1.0.2 β€” drop /v1 prefix (live production bug) + add new tool params#2
OussemaFr merged 1 commit into
mainfrom
fix/v1-url-bug-tools-cleanup-v1.0.2

Conversation

@OussemaFr

Copy link
Copy Markdown
Member

TL;DR

  • v1.0.1 has a critical bug β€” server.js defaults to https://api.socialapis.io/v1 but the real API has no /v1 prefix. Every npm-installed MCP customer has been 404'ing since the 2025-12-18 publish.
  • This PR fixes the URL and adds tool-schema updates for the new params shipped on the main API (limit, exact_followers_count) so MCP clients surface them correctly.

The critical bug

server.js line 7:

```diff

Verified against production: `curl https://api.socialapis.io/facebook/pages/details?...\` returns 200; the same path with `/v1` prefix 404s.

Tool schemas updated

Tracking the recent additions to the main repo's `endpoints.json` (per Minima-Partners/Social-APIs PR #183 and follow-ups):

Tool Change
`facebook_get_page_details` + `exact_followers_count` (boolean, charges 5cr when true)
`facebook_get_page_posts` + `limit` (number, default 3, min 3, max 9, scaled pricing)
`facebook_get_group_posts` + same `limit`
`facebook_get_page_videos` + `limit` (default 6, min 6, max 12)
`facebook_get_post_comments` + `limit` (default 10, max 30)
`facebook_marketplace_search` + `limit` (default 24)
`facebook_get_post_attachments` description: 5 credits/call

Numeric limits use JSON Schema `minimum`/`maximum` so MCP clients can surface bounds at parameter-edit time.

Sanity check passed

  • 47 unique tools (was 47, still 47 β€” no duplicates added)
  • 0 tools with `required` references to properties not defined in `properties`
  • `package.json` version bumped 1.0.1 β†’ 1.0.2

```bash
node -e "import('./src/tools.js').then(({tools}) => {
const dups = tools.filter((t,i,a) => a.findIndex(x=>x.name===t.name)!==i);
const broken = tools.filter(t => (t.inputSchema?.required||[])
.some(r => !(r in (t.inputSchema?.properties||{}))));
console.log('dups:', dups.length, 'broken:', broken.length);
})"

β†’ dups: 0, broken: 0

```

Publish steps after merge

  1. `npm publish` β€” needs operator with npm publish access on `@socialapis/mcp` (no Trusted Publishing wired here yet; consider adding a release workflow next time).
  2. Tag the release: `git tag v1.0.2 && git push origin v1.0.2`.
  3. MCP Registry auto-syncs from npm via the `mcpName: io.github.SocialAPIsHub/social-media-api` field β€” should pick up v1.0.2 within ~24h.
  4. Update the main repo's `backend/mcp-server` submodule pointer to this commit (separate PR in Minima-Partners/Social-APIs).

Test plan post-publish

```bash

Install the new version

npm install @socialapis/mcp@1.0.2

Quick smoke test β€” should not 404

SOCIALAPIS_API_KEY=<your_key> npx @socialapis/mcp test-key
```

In Claude Desktop / Cursor with the MCP server configured, calling `facebook_get_page_details` with `exact_followers_count: true` should charge 5 credits (visible in the `X-SocialAPIs-Credits-Deducted` response header).

…lowers_count)

## The critical bug

v1.0.1 (published to npm 2025-12-18) defaults `API_BASE_URL` to
`https://api.socialapis.io/v1`. The real API has NO `/v1` prefix β€”
this was verified end-to-end against production. Every MCP customer
who installed `@socialapis/mcp@1.0.1` has been getting 404s on every
call since publication.

Fix: server.js now defaults to `https://api.socialapis.io` (matching
the actual public API surface).

## Tool-schema updates for recent endpoint additions

The main repo (Minima-Partners/Social-APIs) added several new query
params and pricing-changing flags via PRs #183 and follow-ups.
Surfacing them in MCP tool schemas:

- facebook_get_page_details: new `exact_followers_count` boolean.
  Charges 5 credits when true, 1 otherwise. Description updated.
- facebook_get_page_posts: new `limit` number (default 3, min 3, max
  9). Description now states ceil(posts_returned / 3) pricing.
- facebook_get_group_posts: same `limit` constraint + pricing.
- facebook_get_page_videos: new `limit` number (default 6, min 6,
  max 12).
- facebook_get_post_comments: new `limit` number (default 10, max
  30).
- facebook_marketplace_search: new `limit` number (default 24).
- facebook_get_post_attachments: description updated to flag 5
  credits/call.

JSON Schema `minimum` / `maximum` constraints on the numeric `limit`
fields so MCP clients (Claude Desktop, Cursor, etc.) can surface the
bounds at parameter-edit time instead of letting the user submit
invalid values that the upstream rejects.

## Sanity check

47 tools, no duplicates, no required-but-undefined property
references. Programmatic validation:

```
node -e "import('./src/tools.js').then(({tools}) => {
  const dups = tools.filter((t,i,a) => a.findIndex(x=>x.name===t.name)!==i);
  const broken = tools.filter(t => (t.inputSchema?.required||[])
    .some(r => !(r in (t.inputSchema?.properties||{}))));
  console.log('dups:', dups.length, 'broken:', broken.length);
})"
# β†’ dups: 0, broken: 0
```

## Publish steps after merge

1. `npm publish` (operator with publish access β€” Trusted Publishing
   not yet wired for this repo, so manual for now)
2. MCP Registry will auto-pull the new version on its next sync
   since the `mcpName` field already points at this package
3. Update Minima-Partners/Social-APIs `backend/mcp-server` submodule
   pointer to this commit and update the main repo
@OussemaFr OussemaFr merged commit b117ff3 into main Jun 29, 2026
@OussemaFr OussemaFr deleted the fix/v1-url-bug-tools-cleanup-v1.0.2 branch June 29, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant