Skip to content

Add the Strapi 5 read-only adapter (#982) - #1307

Merged
helpcodeai merged 2 commits into
HelpCode-ai:mainfrom
YYDW-1211:adapter/strapi
Oct 28, 2026
Merged

helpcodeai merged 2 commits into
HelpCode-ai:mainfrom
YYDW-1211:adapter/strapi

Conversation

@YYDW-1211

@YYDW-1211 YYDW-1211 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a read-only adapter for the Strapi 5 REST Content API (claimed in #982). The catalog had no Strapi connector, so this also bumps the quoted adapter counts to 561.

What the adapter does

Tool Endpoint Notes
strapi_health GET /_health Reachability only; it does not claim the token is valid.
strapi_list_documents GET /api/{contentType} fields, filters, sort, pagination (page / pageSize / withCount), populate, locale, status; keeps data and meta so pagination survives the response transform.
strapi_get_document GET /api/{contentType}/{documentId} One document by its Strapi 5 documentId, with fields, populate, locale.

Design decisions:

  • STRAPI_URL is the root URL (https://cms.example.com), never with an /api suffix; the tool paths add /api themselves.
  • Collection types are addressed by their plural API ID (articles), and documentId is the Strapi 5 identifier, not the legacy numeric id. Strapi has no public endpoint to enumerate collection types, so the adapter asks for a known ID instead of pretending to discover them.
  • Read-only by construction: every endpoint is a GET, there are no request bodies, no write tools, and no Admin / Content-Manager / Content-Type-Builder paths. The static tests assert all of that.
  • STRAPI_API_TOKEN is sent only in Authorization: Bearer. It never enters a query string, a tool argument, or a log; the live test sanitises failures for the same reason.
  • contentType and documentId are percent-encoded before they reach the path, so values with /, ?, # or spaces cannot change the route.

Deployment behaviour

  • Cloud: a publicly reachable Strapi 5 instance, including Strapi Cloud, works with no extra setup.
  • Self-hosted: a Strapi on a private network, localhost or a private IP is reachable only from a self-hosted AnythingMCP and must be allowed through SSRF_ALLOWED_HOSTS, because the outbound guard blocks private address space by default. The adapter instructions say this explicitly.

Files

  • packages/backend/src/adapters/intl/strapi.json (new)
  • packages/backend/src/adapters/intl/strapi.live.spec.ts (new)
  • packages/frontend/public/logos/connectors/strapi.svg (new)
  • packages/backend/src/adapters/catalog.ts, CITATION.cff, README.md, README.de.md, README.ja.md, README.zh-CN.md, glama.json, llms.txt, llms-full.txt, package.json, server.json (generated / count updates)

catalog.ts, llms.txt and llms-full.txt come from the repo scripts; nothing generated was edited by hand. The English README banner said "25 of them with no API key" while the checker counts 27, so it now says 27 like the other languages. The release version is unchanged at 0.51.2.

Testing

Run on Windows with Node 24.18.0 / npm 11.16.0, against this branch (output copied, not paraphrased).

  1. node scripts/validate-adapters.mjs --warn -> Validated 575 adapters: 575 passed, 0 failed, 1442 total warnings. The 1442 warnings are pre-existing repo-wide; none belong to intl/strapi.json.
  2. node scripts/regenerate-catalog.mjs -> Regenerated ... 575 adapters across 15 regions. with no further git diff on catalog.ts, so the committed file is exactly the generator output.
  3. node scripts/adapter-count.mjs --check -> OK: every quoted count equals 561 adapters (27 keyless, 8674 tools).
  4. node scripts/generate-llms-txt.mjs --check -> exit 0, generated AI docs up to date.
  5. npx jest src/adapters/intl/strapi (in packages/backend) -> 1 suite passed, 14 passed / 7 skipped (the 7 skipped are the live block).
  6. npm run lint:check (in packages/backend) -> 0 errors, 11 warnings, all in files this PR does not touch.
  7. npx tsc --noEmit -p tsconfig.json (in packages/backend) -> clean.
  8. Targeted metadata tests -> 9 suites, 10828 tests passed:
    npx jest src/adapters/catalog.spec.ts src/adapters/catalog-summary.spec.ts src/adapters/catalog-search.spec.ts src/adapters/catalog-url-match.spec.ts src/adapters/env-var-meta.spec.ts src/adapters/setup-guide.spec.ts src/adapters/adapters.service.spec.ts src/mcp-server/tool-annotations.spec.ts src/mcp-server/error-hints.spec.ts

Known failures in the full backend suite

npm test in packages/backend finished with Test Suites: 2 failed, 4 skipped, 795 passed, 797 of 801 total and Tests: 3 failed, 1622 skipped, 23611 passed, 25236 total (1722 s). I am not claiming a fully green suite.

  1. src/common/ssrf.util.spec.ts - known baseline failure, unrelated to this PR, deliberately not modified. On this machine no-such-host.invalid resolves instead of failing with ENOTFOUND, so the expected Host not found: ... rejection never happens. It reproduces when that file runs alone (1 failed, 28 passed).
  2. src/adapters/intl/figma.live.spec.ts - 2 tests exceeded the 5 s Jest timeout under the load of ~800 suites; one timed-out call then leaked into the next assertion. The same file passes on its own (npx jest src/adapters/intl/figma.live.spec.ts -> 14 passed, 8 skipped), and this PR does not touch Figma.

Live tests

Live calls require RUN_STRAPI_LIVE=1 and a STRAPI_URL / STRAPI_API_TOKEN pair, and the suite asserts the target is http://localhost:1337 (a local Strapi 5 fixture with an articles collection) before the first request. They are skipped by default, were not pointed at any production instance, and no token is stored in the repo, the logs or this PR.

Notes

  • The adapter is read-only on purpose; write tools can follow in a second PR if wanted.

cc @keysersoft

Add a Strapi 5 REST Content API adapter with three read-only tools:
health, list documents (fields, filters, sort, pagination, populate,
locale, status), and get one document by its documentId. Include the
static and gated live test suite, the connector logo, and the
regenerated catalog and quoted adapter counts (561 adapters, 27 keyless).
@github-actions

Copy link
Copy Markdown

👋 Welcome, @YYDW-1211, and thanks for opening your first PR on AnythingMCP!

A few quick pointers:

  • Make sure CI is green before requesting review (Backend, Frontend, Playwright, CodeQL, Trivy).
  • If this is a new adapter, the parametrised catalog.spec.ts test will validate it automatically.
  • Sign off your commits if you can — it's not blocking, just nice to have.

Someone from the core team will look at this within ~48h. If you don't hear back, please ping us in Discussions / Q&A.

⭐ While you wait — if you find AnythingMCP useful, a star helps others discover it.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@YYDW-1211

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Oct 28, 2026
@helpcodeai
helpcodeai enabled auto-merge (squash) October 28, 2026 08:13
@helpcodeai
helpcodeai merged commit 30b5e32 into HelpCode-ai:main Oct 28, 2026
14 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 28, 2026
@helpcodeai

Copy link
Copy Markdown
Contributor

Thanks @YYDW-1211, merged. The adapter is clean and the testing notes were very useful, including the two baseline failures you reported honestly. It will go out with the next release.

@YYDW-1211
YYDW-1211 deleted the adapter/strapi branch October 28, 2026 08:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants