strapi-plugin-components-usage-info
v0.0.6
Published
Find out the collections where a selected component is populated with data.
Downloads
446
Readme
Strapi plugin strapi-plugin-components-usage-info
A Strapi plugin to find out where in your Strapi setup a certain component is being used, this plugin can find this out for you.
Installation
via npm:
npm i strapi-plugin-components-usage-infovia yarn:
yarn add strapi-plugin-components-usage-infoPlugin Configuration
Within your Strapi v5 project's config/plugin.js, enable the plugin:
module.exports = {
// ...
"strapi-plugin-components-usage-info" : {
enabled: true,
config: {
// Optional. When set here, it is read-only in the plugin's Configure screen.
frontendBaseUrl: "http://localhost:3000/blog"
}
},
// ...
}Configuration to Enable Frontend URLs
The Configure button in the plugin lets administrators define a base frontend URL,
a default slug field, locale path segments, and optional collection-specific prefixes
or slug fields. Settings entered in this screen are stored by Strapi and persist across
restarts. A frontendBaseUrl set in config/plugins.js or config/plugins.ts takes
precedence over the stored base URL.
Once this screen is configured with the base url, locale specific base slug, site-wide Strapi field to use to get page-specific slugs, the plugin's home screen enlists the URLs instead of the record title.
Note: The frontend urls are not listed until the base URL and default slug field are configured.
MCP Server
This plugin's capabilities can now be used via the Strapi MCP server.
Steps to enable this plugin capabilities via Strapi MCP server
- Ensure you are using Strapi v5.47.0 or later (this is when Strapi introduced MCP server).
- Enable MCP server for your Strapi setup via following in your
config/server.tsfile:
mcp: {
enabled: true,
}- On your Strapi Admin -> Settings -> Admin Tokens screen, click "Create new Admin Token". For this Admin Token, go to "Plugins" -> "Strapi plugin components usage info" -> enable access for "Find entries using a component".
- Use the just created Admin Token on Claude Code, Cursor, Codex or any other AI IDE you are using.
Example Use Cases:
Following examples detail the kind of problems this plugin capabilities via MCP server can solve:
- To know on what URLs a certain frontend component is served (via Strapi Dynamic Zone).
- To know which components in the Strapi setup aren't used by any records
- To know if a certain component fields can safely be modified in Strapi without affecting existing data
FAQ
When identifying if a component is populated within a certain record:
- If the selected component is directly not part of a collection, but instead part of another component that belongs to the collection, such relationships (upto any depth level) are taken into consideration.
- Locales are also taken into consideration and displayed.
- This plugin works with Strapi v5.6.0 and higher. It does not support earlier Strapi versions.
Bugs
For any bugs, please create an issue here.
About
- This plugin is created by Punit Sethi.
- I'm an independent developer working on Strapi migrations, customizations, configuration projects (see here).
- For any Strapi implementation requirement, please write to me at
[email protected].
