@cesteral/meta-mcp 1.0.0
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/LICENSE.md +201 -0
- package/README.md +337 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +3 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/meta-auth-adapter.d.ts +37 -0
- package/dist/auth/meta-auth-adapter.d.ts.map +1 -0
- package/dist/auth/meta-auth-adapter.js +109 -0
- package/dist/auth/meta-auth-adapter.js.map +1 -0
- package/dist/auth/meta-auth-strategy.d.ts +13 -0
- package/dist/auth/meta-auth-strategy.d.ts.map +1 -0
- package/dist/auth/meta-auth-strategy.js +47 -0
- package/dist/auth/meta-auth-strategy.js.map +1 -0
- package/dist/config/index.d.ts +108 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +51 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/insights-catalog.json +95 -0
- package/dist/container/index.d.ts +5 -0
- package/dist/container/index.d.ts.map +1 -0
- package/dist/container/index.js +14 -0
- package/dist/container/index.js.map +1 -0
- package/dist/container/registrations/core.d.ts +3 -0
- package/dist/container/registrations/core.d.ts.map +1 -0
- package/dist/container/registrations/core.js +16 -0
- package/dist/container/registrations/core.js.map +1 -0
- package/dist/container/registrations/mcp.d.ts +2 -0
- package/dist/container/registrations/mcp.d.ts.map +1 -0
- package/dist/container/registrations/mcp.js +3 -0
- package/dist/container/registrations/mcp.js.map +1 -0
- package/dist/container/tokens.d.ts +6 -0
- package/dist/container/tokens.d.ts.map +1 -0
- package/dist/container/tokens.js +6 -0
- package/dist/container/tokens.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/bulk-operations-workflow.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/bulk-operations-workflow.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/bulk-operations-workflow.prompt.js +244 -0
- package/dist/mcp-server/prompts/definitions/bulk-operations-workflow.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/campaign-setup-workflow.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/campaign-setup-workflow.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/campaign-setup-workflow.prompt.js +111 -0
- package/dist/mcp-server/prompts/definitions/campaign-setup-workflow.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/creative-upload-workflow.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/creative-upload-workflow.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/creative-upload-workflow.prompt.js +160 -0
- package/dist/mcp-server/prompts/definitions/creative-upload-workflow.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.js +299 -0
- package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.js +170 -0
- package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/entity-duplication-workflow.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/entity-duplication-workflow.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/entity-duplication-workflow.prompt.js +234 -0
- package/dist/mcp-server/prompts/definitions/entity-duplication-workflow.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/entity-update-workflow.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/entity-update-workflow.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/entity-update-workflow.prompt.js +159 -0
- package/dist/mcp-server/prompts/definitions/entity-update-workflow.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/insights-reporting-workflow.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/insights-reporting-workflow.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/insights-reporting-workflow.prompt.js +79 -0
- package/dist/mcp-server/prompts/definitions/insights-reporting-workflow.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/targeting-discovery-workflow.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/targeting-discovery-workflow.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/targeting-discovery-workflow.prompt.js +289 -0
- package/dist/mcp-server/prompts/definitions/targeting-discovery-workflow.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.js +109 -0
- package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/troubleshoot-entity.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/troubleshoot-entity.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/troubleshoot-entity.prompt.js +77 -0
- package/dist/mcp-server/prompts/definitions/troubleshoot-entity.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/index.d.ts +9 -0
- package/dist/mcp-server/prompts/index.d.ts.map +1 -0
- package/dist/mcp-server/prompts/index.js +97 -0
- package/dist/mcp-server/prompts/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/entity-examples.resource.d.ts +4 -0
- package/dist/mcp-server/resources/definitions/entity-examples.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/entity-examples.resource.js +140 -0
- package/dist/mcp-server/resources/definitions/entity-examples.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/entity-hierarchy.resource.d.ts +3 -0
- package/dist/mcp-server/resources/definitions/entity-hierarchy.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/entity-hierarchy.resource.js +117 -0
- package/dist/mcp-server/resources/definitions/entity-hierarchy.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/entity-schemas.resource.d.ts +4 -0
- package/dist/mcp-server/resources/definitions/entity-schemas.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/entity-schemas.resource.js +125 -0
- package/dist/mcp-server/resources/definitions/entity-schemas.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/field-rules.resource.d.ts +3 -0
- package/dist/mcp-server/resources/definitions/field-rules.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/field-rules.resource.js +28 -0
- package/dist/mcp-server/resources/definitions/field-rules.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/findings.resource.d.ts +8 -0
- package/dist/mcp-server/resources/definitions/findings.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/findings.resource.js +33 -0
- package/dist/mcp-server/resources/definitions/findings.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/index.d.ts +8 -0
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/index.js +81 -0
- package/dist/mcp-server/resources/definitions/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/insights-reference.resource.d.ts +3 -0
- package/dist/mcp-server/resources/definitions/insights-reference.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/insights-reference.resource.js +113 -0
- package/dist/mcp-server/resources/definitions/insights-reference.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/targeting-reference.resource.d.ts +3 -0
- package/dist/mcp-server/resources/definitions/targeting-reference.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/targeting-reference.resource.js +98 -0
- package/dist/mcp-server/resources/definitions/targeting-reference.resource.js.map +1 -0
- package/dist/mcp-server/resources/index.d.ts +3 -0
- package/dist/mcp-server/resources/index.d.ts.map +1 -0
- package/dist/mcp-server/resources/index.js +2 -0
- package/dist/mcp-server/resources/index.js.map +1 -0
- package/dist/mcp-server/resources/types.d.ts +8 -0
- package/dist/mcp-server/resources/types.d.ts.map +1 -0
- package/dist/mcp-server/resources/types.js +2 -0
- package/dist/mcp-server/resources/types.js.map +1 -0
- package/dist/mcp-server/resources/utils/field-rules.d.ts +18 -0
- package/dist/mcp-server/resources/utils/field-rules.d.ts.map +1 -0
- package/dist/mcp-server/resources/utils/field-rules.js +103 -0
- package/dist/mcp-server/resources/utils/field-rules.js.map +1 -0
- package/dist/mcp-server/server.d.ts +5 -0
- package/dist/mcp-server/server.d.ts.map +1 -0
- package/dist/mcp-server/server.js +133 -0
- package/dist/mcp-server/server.js.map +1 -0
- package/dist/mcp-server/tools/definitions/adjust-bids.tool.d.ts +221 -0
- package/dist/mcp-server/tools/definitions/adjust-bids.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/adjust-bids.tool.js +178 -0
- package/dist/mcp-server/tools/definitions/adjust-bids.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/bulk-create-entities.tool.d.ts +143 -0
- package/dist/mcp-server/tools/definitions/bulk-create-entities.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/bulk-create-entities.tool.js +108 -0
- package/dist/mcp-server/tools/definitions/bulk-create-entities.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/bulk-update-entities.tool.d.ts +180 -0
- package/dist/mcp-server/tools/definitions/bulk-update-entities.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/bulk-update-entities.tool.js +125 -0
- package/dist/mcp-server/tools/definitions/bulk-update-entities.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/bulk-update-status.tool.d.ts +140 -0
- package/dist/mcp-server/tools/definitions/bulk-update-status.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/bulk-update-status.tool.js +112 -0
- package/dist/mcp-server/tools/definitions/bulk-update-status.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/check-report-status.tool.d.ts +148 -0
- package/dist/mcp-server/tools/definitions/check-report-status.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/check-report-status.tool.js +107 -0
- package/dist/mcp-server/tools/definitions/check-report-status.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/create-entity.tool.d.ts +115 -0
- package/dist/mcp-server/tools/definitions/create-entity.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/create-entity.tool.js +104 -0
- package/dist/mcp-server/tools/definitions/create-entity.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/delete-entity.tool.d.ts +93 -0
- package/dist/mcp-server/tools/definitions/delete-entity.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/delete-entity.tool.js +102 -0
- package/dist/mcp-server/tools/definitions/delete-entity.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/download-report.tool.d.ts +183 -0
- package/dist/mcp-server/tools/definitions/download-report.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/download-report.tool.js +109 -0
- package/dist/mcp-server/tools/definitions/download-report.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/duplicate-entity.tool.d.ts +115 -0
- package/dist/mcp-server/tools/definitions/duplicate-entity.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/duplicate-entity.tool.js +98 -0
- package/dist/mcp-server/tools/definitions/duplicate-entity.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-ad-preview.tool.d.ts +69 -0
- package/dist/mcp-server/tools/definitions/get-ad-preview.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-ad-preview.tool.js +63 -0
- package/dist/mcp-server/tools/definitions/get-ad-preview.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-ad-previews.tool.d.ts +69 -0
- package/dist/mcp-server/tools/definitions/get-ad-previews.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-ad-previews.tool.js +68 -0
- package/dist/mcp-server/tools/definitions/get-ad-previews.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-available-metrics.tool.d.ts +91 -0
- package/dist/mcp-server/tools/definitions/get-available-metrics.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-available-metrics.tool.js +85 -0
- package/dist/mcp-server/tools/definitions/get-available-metrics.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-delivery-estimate.tool.d.ts +82 -0
- package/dist/mcp-server/tools/definitions/get-delivery-estimate.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-delivery-estimate.tool.js +72 -0
- package/dist/mcp-server/tools/definitions/get-delivery-estimate.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-entity.tool.d.ts +90 -0
- package/dist/mcp-server/tools/definitions/get-entity.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-entity.tool.js +83 -0
- package/dist/mcp-server/tools/definitions/get-entity.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-insights-breakdowns.tool.d.ts +277 -0
- package/dist/mcp-server/tools/definitions/get-insights-breakdowns.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-insights-breakdowns.tool.js +175 -0
- package/dist/mcp-server/tools/definitions/get-insights-breakdowns.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-insights.tool.d.ts +274 -0
- package/dist/mcp-server/tools/definitions/get-insights.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-insights.tool.js +188 -0
- package/dist/mcp-server/tools/definitions/get-insights.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-pacing-status.tool.d.ts +141 -0
- package/dist/mcp-server/tools/definitions/get-pacing-status.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-pacing-status.tool.js +157 -0
- package/dist/mcp-server/tools/definitions/get-pacing-status.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-targeting-options.tool.d.ts +81 -0
- package/dist/mcp-server/tools/definitions/get-targeting-options.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-targeting-options.tool.js +73 -0
- package/dist/mcp-server/tools/definitions/get-targeting-options.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/index.d.ts +29 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/index.js +87 -0
- package/dist/mcp-server/tools/definitions/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/list-ad-accounts.tool.d.ts +147 -0
- package/dist/mcp-server/tools/definitions/list-ad-accounts.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/list-ad-accounts.tool.js +83 -0
- package/dist/mcp-server/tools/definitions/list-ad-accounts.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/list-entities.tool.d.ts +184 -0
- package/dist/mcp-server/tools/definitions/list-entities.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/list-entities.tool.js +105 -0
- package/dist/mcp-server/tools/definitions/list-entities.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/manage-budget-schedule.tool.d.ts +128 -0
- package/dist/mcp-server/tools/definitions/manage-budget-schedule.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/manage-budget-schedule.tool.js +145 -0
- package/dist/mcp-server/tools/definitions/manage-budget-schedule.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-targeting.tool.d.ts +89 -0
- package/dist/mcp-server/tools/definitions/search-targeting.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-targeting.tool.js +87 -0
- package/dist/mcp-server/tools/definitions/search-targeting.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/submit-report.tool.d.ts +192 -0
- package/dist/mcp-server/tools/definitions/submit-report.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/submit-report.tool.js +131 -0
- package/dist/mcp-server/tools/definitions/submit-report.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/update-entity.tool.d.ts +1714 -0
- package/dist/mcp-server/tools/definitions/update-entity.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/update-entity.tool.js +146 -0
- package/dist/mcp-server/tools/definitions/update-entity.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/upload-image.tool.d.ts +88 -0
- package/dist/mcp-server/tools/definitions/upload-image.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/upload-image.tool.js +89 -0
- package/dist/mcp-server/tools/definitions/upload-image.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/upload-video.tool.d.ts +94 -0
- package/dist/mcp-server/tools/definitions/upload-video.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/upload-video.tool.js +151 -0
- package/dist/mcp-server/tools/definitions/upload-video.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/validate-entity.tool.d.ts +169 -0
- package/dist/mcp-server/tools/definitions/validate-entity.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/validate-entity.tool.js +103 -0
- package/dist/mcp-server/tools/definitions/validate-entity.tool.js.map +1 -0
- package/dist/mcp-server/tools/index.d.ts +2 -0
- package/dist/mcp-server/tools/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/index.js +2 -0
- package/dist/mcp-server/tools/index.js.map +1 -0
- package/dist/mcp-server/tools/utils/capture-snapshot.d.ts +8 -0
- package/dist/mcp-server/tools/utils/capture-snapshot.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/capture-snapshot.js +70 -0
- package/dist/mcp-server/tools/utils/capture-snapshot.js.map +1 -0
- package/dist/mcp-server/tools/utils/dry-run.d.ts +11 -0
- package/dist/mcp-server/tools/utils/dry-run.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/dry-run.js +60 -0
- package/dist/mcp-server/tools/utils/dry-run.js.map +1 -0
- package/dist/mcp-server/tools/utils/entity-mapping.d.ts +14 -0
- package/dist/mcp-server/tools/utils/entity-mapping.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/entity-mapping.js +138 -0
- package/dist/mcp-server/tools/utils/entity-mapping.js.map +1 -0
- package/dist/mcp-server/tools/utils/resolve-session.d.ts +4 -0
- package/dist/mcp-server/tools/utils/resolve-session.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/resolve-session.js +6 -0
- package/dist/mcp-server/tools/utils/resolve-session.js.map +1 -0
- package/dist/mcp-server/transports/streamable-http-transport.d.ts +53 -0
- package/dist/mcp-server/transports/streamable-http-transport.d.ts.map +1 -0
- package/dist/mcp-server/transports/streamable-http-transport.js +80 -0
- package/dist/mcp-server/transports/streamable-http-transport.js.map +1 -0
- package/dist/services/meta/meta-graph-api-client.d.ts +19 -0
- package/dist/services/meta/meta-graph-api-client.d.ts.map +1 -0
- package/dist/services/meta/meta-graph-api-client.js +226 -0
- package/dist/services/meta/meta-graph-api-client.js.map +1 -0
- package/dist/services/meta/meta-insights-service.d.ts +76 -0
- package/dist/services/meta/meta-insights-service.d.ts.map +1 -0
- package/dist/services/meta/meta-insights-service.js +209 -0
- package/dist/services/meta/meta-insights-service.js.map +1 -0
- package/dist/services/meta/meta-service.d.ts +64 -0
- package/dist/services/meta/meta-service.d.ts.map +1 -0
- package/dist/services/meta/meta-service.js +177 -0
- package/dist/services/meta/meta-service.js.map +1 -0
- package/dist/services/meta/meta-targeting-service.d.ts +13 -0
- package/dist/services/meta/meta-targeting-service.d.ts.map +1 -0
- package/dist/services/meta/meta-targeting-service.js +38 -0
- package/dist/services/meta/meta-targeting-service.js.map +1 -0
- package/dist/services/meta/types.d.ts +227 -0
- package/dist/services/meta/types.d.ts.map +1 -0
- package/dist/services/meta/types.js +55 -0
- package/dist/services/meta/types.js.map +1 -0
- package/dist/services/session-services.d.ts +19 -0
- package/dist/services/session-services.d.ts.map +1 -0
- package/dist/services/session-services.js +19 -0
- package/dist/services/session-services.js.map +1 -0
- package/dist/testkit/fixtures/index.d.ts +9 -0
- package/dist/testkit/fixtures/index.d.ts.map +1 -0
- package/dist/testkit/fixtures/index.js +201 -0
- package/dist/testkit/fixtures/index.js.map +1 -0
- package/dist/testkit/index.d.ts +6 -0
- package/dist/testkit/index.d.ts.map +1 -0
- package/dist/testkit/index.js +26 -0
- package/dist/testkit/index.js.map +1 -0
- package/dist/testkit/types.d.ts +17 -0
- package/dist/testkit/types.d.ts.map +1 -0
- package/dist/testkit/types.js +2 -0
- package/dist/testkit/types.js.map +1 -0
- package/dist/types-global/mcp.d.ts +2 -0
- package/dist/types-global/mcp.d.ts.map +1 -0
- package/dist/types-global/mcp.js +2 -0
- package/dist/types-global/mcp.js.map +1 -0
- package/dist/utils/errors/index.d.ts +2 -0
- package/dist/utils/errors/index.d.ts.map +1 -0
- package/dist/utils/errors/index.js +2 -0
- package/dist/utils/errors/index.js.map +1 -0
- package/dist/utils/internal/request-context.d.ts +20 -0
- package/dist/utils/internal/request-context.d.ts.map +1 -0
- package/dist/utils/internal/request-context.js +19 -0
- package/dist/utils/internal/request-context.js.map +1 -0
- package/dist/utils/platform.d.ts +3 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +5 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/utils/security/rate-limiter.d.ts +3 -0
- package/dist/utils/security/rate-limiter.d.ts.map +1 -0
- package/dist/utils/security/rate-limiter.js +5 -0
- package/dist/utils/security/rate-limiter.js.map +1 -0
- package/dist/utils/telemetry/index.d.ts +2 -0
- package/dist/utils/telemetry/index.d.ts.map +1 -0
- package/dist/utils/telemetry/index.js +2 -0
- package/dist/utils/telemetry/index.js.map +1 -0
- package/dist/utils/telemetry/tracing.d.ts +3 -0
- package/dist/utils/telemetry/tracing.d.ts.map +1 -0
- package/dist/utils/telemetry/tracing.js +4 -0
- package/dist/utils/telemetry/tracing.js.map +1 -0
- package/package.json +66 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
# @cesteral/meta-mcp
|
|
2
|
+
|
|
3
|
+
Meta Ads MCP Server - Campaign management via the configured Meta Graph API (default: v25.0).
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Management server for Meta Ads. Provides full CRUD operations, performance
|
|
8
|
+
insights, targeting discovery, bulk operations, and specialized features like
|
|
9
|
+
entity duplication and delivery estimates. Designed for AI agents to manage Meta
|
|
10
|
+
Ads campaigns programmatically through the Model Context Protocol with
|
|
11
|
+
per-session Bearer token authentication.
|
|
12
|
+
|
|
13
|
+
## Choose Your Path
|
|
14
|
+
|
|
15
|
+
- **Self-host this connector** when you want direct control of credentials,
|
|
16
|
+
infrastructure, and Meta Ads API access.
|
|
17
|
+
- **Use Cesteral Intelligence** when the workflow needs approvals before spend
|
|
18
|
+
commits, credential brokering, auditability, and cross-platform execution.
|
|
19
|
+
|
|
20
|
+
[Self-host quickstart](../../docs/guides/quickstart.md) | [Compare OSS vs Cesteral Intelligence](https://cesteral.com/compare?utm_source=github&utm_medium=package-readme&utm_campaign=meta-mcp) | [Book a workflow demo](mailto:sales@cesteral.com?subject=Workflow%20demo%20-%20Meta%20Ads%20MCP)
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- **Per-session Bearer token auth** via `MetaBearerAuthStrategy` (validates tokens against `GET /me`)
|
|
25
|
+
- **Streamable HTTP + stdio transports** via Hono + `@hono/mcp`
|
|
26
|
+
- **OpenTelemetry** instrumentation for traces and metrics
|
|
27
|
+
- **Rate limiting** via shared `RateLimiter` class (200/min default, writes cost 3x)
|
|
28
|
+
- **Structured logging** via Pino
|
|
29
|
+
- **MCP Resources** for entity schemas, examples, insights reference, and targeting reference
|
|
30
|
+
- **MCP Prompts** for campaign setup, insights reporting, troubleshooting, and schema exploration
|
|
31
|
+
|
|
32
|
+
## MCP Tools
|
|
33
|
+
|
|
34
|
+
### Core CRUD
|
|
35
|
+
|
|
36
|
+
#### 1. `meta_list_entities`
|
|
37
|
+
|
|
38
|
+
List Meta Ads entities with optional filtering and cursor-based pagination.
|
|
39
|
+
|
|
40
|
+
**Parameters:**
|
|
41
|
+
|
|
42
|
+
- `entityType` (string, required): Type of entity to list
|
|
43
|
+
- `adAccountId` (string, required): Ad Account ID (with or without `act_` prefix)
|
|
44
|
+
- `fields` (string[], optional): Field names to return
|
|
45
|
+
- `filtering` (array, optional): Filter objects in Meta filtering format
|
|
46
|
+
- `limit` (number, optional): Results per page (1-100, default 25)
|
|
47
|
+
- `after` (string, optional): Cursor for next page
|
|
48
|
+
|
|
49
|
+
#### 2. `meta_get_entity`
|
|
50
|
+
|
|
51
|
+
Get a single Meta Ads entity by ID.
|
|
52
|
+
|
|
53
|
+
**Parameters:**
|
|
54
|
+
|
|
55
|
+
- `entityType` (string, required): Type of entity to retrieve
|
|
56
|
+
- `entityId` (string, required): The entity ID
|
|
57
|
+
- `fields` (string[], optional): Field names to return
|
|
58
|
+
|
|
59
|
+
#### 3. `meta_create_entity`
|
|
60
|
+
|
|
61
|
+
Create a new Meta Ads entity.
|
|
62
|
+
|
|
63
|
+
**Parameters:**
|
|
64
|
+
|
|
65
|
+
- `entityType` (string, required): Type of entity to create
|
|
66
|
+
- `adAccountId` (string, required): Ad Account ID
|
|
67
|
+
- `data` (object, required): Entity fields as key-value pairs
|
|
68
|
+
|
|
69
|
+
#### 4. `meta_update_entity`
|
|
70
|
+
|
|
71
|
+
Update an existing Meta Ads entity (POST with PATCH semantics).
|
|
72
|
+
|
|
73
|
+
**Parameters:**
|
|
74
|
+
|
|
75
|
+
- `entityType` (string, optional): Type of entity to update (informational only, not used in API call)
|
|
76
|
+
- `entityId` (string, required): The entity ID to update
|
|
77
|
+
- `data` (object, required): Fields to update as key-value pairs
|
|
78
|
+
|
|
79
|
+
#### 5. `meta_delete_entity`
|
|
80
|
+
|
|
81
|
+
Delete a Meta Ads entity.
|
|
82
|
+
|
|
83
|
+
**Parameters:**
|
|
84
|
+
|
|
85
|
+
- `entityType` (string, required): Type of entity to delete
|
|
86
|
+
- `entityId` (string, required): The entity ID to delete
|
|
87
|
+
|
|
88
|
+
### Account
|
|
89
|
+
|
|
90
|
+
#### 6. `meta_list_ad_accounts`
|
|
91
|
+
|
|
92
|
+
List ad accounts accessible to the authenticated user.
|
|
93
|
+
|
|
94
|
+
**Parameters:**
|
|
95
|
+
|
|
96
|
+
- `fields` (string[], optional): Field names to return (defaults to id, name, account_status, currency, timezone_name, amount_spent, balance)
|
|
97
|
+
- `limit` (number, optional): Number of accounts to return (1-100)
|
|
98
|
+
- `after` (string, optional): Pagination cursor from previous response
|
|
99
|
+
|
|
100
|
+
### Insights
|
|
101
|
+
|
|
102
|
+
> All Meta reporting tools (`meta_get_insights`, `meta_get_insights_breakdowns`, and the `meta_download_report` tool used in async report flows) return data using the shared bounded report-view contract: `mode` (`"summary"` default — headers + counts + 10-row preview, or `"rows"` for a paginated rows page), `columns` (project to selected columns), `offset` (zero-based pagination), and `maxRows` (page size; default 10 for summary, 50 for rows; hard cap 200). `limit` and `after` remain available for cursoring across upstream Meta pages.
|
|
103
|
+
|
|
104
|
+
#### 7. `meta_get_insights`
|
|
105
|
+
|
|
106
|
+
Get performance insights for a Meta Ads entity (account, campaign, ad set, or ad).
|
|
107
|
+
|
|
108
|
+
**Parameters:**
|
|
109
|
+
|
|
110
|
+
- `entityId` (string, required): Entity ID to get insights for
|
|
111
|
+
- `fields` (string[], optional): Metrics/fields to return
|
|
112
|
+
- `datePreset` (string, optional): Date preset (`today`, `yesterday`, `last_7d`, `last_30d`, etc.)
|
|
113
|
+
- `timeRange` (object, optional): Object with `since` and `until` (YYYY-MM-DD)
|
|
114
|
+
- `timeIncrement` (string, optional): Granularity (`1` for daily, `7` for weekly, `monthly`, `all_days`)
|
|
115
|
+
- `level` (string, optional): Aggregation level (`account`, `campaign`, `adset`, `ad`)
|
|
116
|
+
- `limit` (number, optional): Upstream Meta page size (1-500). Use `maxRows` to control the bounded view's returned-row count.
|
|
117
|
+
- `after` (string, optional): Cursor for next upstream page
|
|
118
|
+
- `mode`, `columns`, `offset`, `maxRows` (optional): Bounded report-view params (see note above)
|
|
119
|
+
|
|
120
|
+
#### 8. `meta_get_insights_breakdowns`
|
|
121
|
+
|
|
122
|
+
Get performance insights broken down by dimension (age, gender, country, device, etc.).
|
|
123
|
+
|
|
124
|
+
**Parameters:**
|
|
125
|
+
|
|
126
|
+
- `entityId` (string, required): Entity ID to get insights for
|
|
127
|
+
- `breakdowns` (string[], required): Breakdown dimensions (e.g., `['age', 'gender']`)
|
|
128
|
+
- `fields` (string[], optional): Metrics to return
|
|
129
|
+
- `datePreset` (string, optional): Date preset
|
|
130
|
+
- `timeRange` (object, optional): Object with `since` and `until`
|
|
131
|
+
- `timeIncrement` (string, optional): Time granularity
|
|
132
|
+
- `level` (string, optional): Aggregation level
|
|
133
|
+
- `actionAttributionWindows` (string[], optional): Attribution windows (e.g., `['1d_click', '7d_click']`)
|
|
134
|
+
- `limit` (number, optional): Upstream Meta page size (1-500). Use `maxRows` for bounded-view row count.
|
|
135
|
+
- `after` (string, optional): Cursor for next upstream page
|
|
136
|
+
- `mode`, `columns`, `offset`, `maxRows` (optional): Bounded report-view params (see note above)
|
|
137
|
+
|
|
138
|
+
### Bulk Operations
|
|
139
|
+
|
|
140
|
+
#### 9. `meta_bulk_update_status`
|
|
141
|
+
|
|
142
|
+
Batch update status for multiple Meta Ads entities.
|
|
143
|
+
|
|
144
|
+
**Parameters:**
|
|
145
|
+
|
|
146
|
+
- `entityType` (string, optional): Type of entities to update (informational only, not used in API call)
|
|
147
|
+
- `entityIds` (string[], required): Entity IDs to update (max 50)
|
|
148
|
+
- `status` (string, required): `ACTIVE`, `PAUSED`, or `ARCHIVED`
|
|
149
|
+
|
|
150
|
+
#### 10. `meta_bulk_create_entities`
|
|
151
|
+
|
|
152
|
+
Batch create multiple entities of the same type.
|
|
153
|
+
|
|
154
|
+
**Parameters:**
|
|
155
|
+
|
|
156
|
+
- `entityType` (string, required): Type of entities to create
|
|
157
|
+
- `adAccountId` (string, required): Ad Account ID
|
|
158
|
+
- `items` (array, required): Array of entity data objects (max 50)
|
|
159
|
+
|
|
160
|
+
#### 11. `meta_bulk_update_entities`
|
|
161
|
+
|
|
162
|
+
Batch update multiple entities with individual data payloads.
|
|
163
|
+
|
|
164
|
+
**Parameters:**
|
|
165
|
+
|
|
166
|
+
- `entityType` (string, optional): Type of entities being updated (informational only, not used in API call)
|
|
167
|
+
- `items` (array, required): Array of update items (max 50), each with `entityId` and `data`
|
|
168
|
+
|
|
169
|
+
### Targeting
|
|
170
|
+
|
|
171
|
+
#### 12. `meta_search_targeting`
|
|
172
|
+
|
|
173
|
+
Search for targeting options (interests, behaviors, demographics) by keyword.
|
|
174
|
+
|
|
175
|
+
**Parameters:**
|
|
176
|
+
|
|
177
|
+
- `type` (string, required): Search type (`adinterest`, `adinterestsuggestion`, `adgeolocation`, `adlocale`, etc.)
|
|
178
|
+
- `query` (string, required): Search keyword
|
|
179
|
+
- `limit` (number, optional): Max results (1-100, default 25)
|
|
180
|
+
|
|
181
|
+
#### 13. `meta_get_targeting_options`
|
|
182
|
+
|
|
183
|
+
Browse available targeting categories for an ad account.
|
|
184
|
+
|
|
185
|
+
**Parameters:**
|
|
186
|
+
|
|
187
|
+
- `adAccountId` (string, required): Ad Account ID
|
|
188
|
+
- `type` (string, optional): Filter by targeting type (e.g., `interests`, `behaviors`)
|
|
189
|
+
|
|
190
|
+
### Specialized
|
|
191
|
+
|
|
192
|
+
#### 14. `meta_duplicate_entity`
|
|
193
|
+
|
|
194
|
+
Duplicate a campaign, ad set, or ad via `POST /{id}/copies`.
|
|
195
|
+
|
|
196
|
+
**Parameters:**
|
|
197
|
+
|
|
198
|
+
- `entityType` (string, required): Type of entity to duplicate (`campaign`, `adSet`, `ad`)
|
|
199
|
+
- `entityId` (string, required): ID of the entity to duplicate
|
|
200
|
+
- `renameOptions` (object, optional): Object with `prefix` and/or `suffix` for naming
|
|
201
|
+
- `statusOption` (string, optional): Status for copy (`ACTIVE`, `PAUSED`, `INHERITED`)
|
|
202
|
+
|
|
203
|
+
#### 15. `meta_get_delivery_estimate`
|
|
204
|
+
|
|
205
|
+
Get estimated audience size and delivery estimates for a targeting spec.
|
|
206
|
+
|
|
207
|
+
**Parameters:**
|
|
208
|
+
|
|
209
|
+
- `adAccountId` (string, required): Ad Account ID
|
|
210
|
+
- `targetingSpec` (object, required): Targeting specification (must include `geo_locations` or `custom_audiences`)
|
|
211
|
+
- `optimizationGoal` (string, optional): Optimization goal (e.g., `LINK_CLICKS`, `REACH`, `CONVERSIONS`)
|
|
212
|
+
|
|
213
|
+
#### 16. `meta_get_ad_preview`
|
|
214
|
+
|
|
215
|
+
Get preview HTML for an ad in a specific format.
|
|
216
|
+
|
|
217
|
+
**Parameters:**
|
|
218
|
+
|
|
219
|
+
- `adId` (string, required): Ad ID to preview
|
|
220
|
+
- `adFormat` (string, required): Ad format (e.g., `DESKTOP_FEED_STANDARD`, `MOBILE_FEED_STANDARD`, `INSTAGRAM_STANDARD`)
|
|
221
|
+
|
|
222
|
+
#### 17. `meta_adjust_bids`
|
|
223
|
+
|
|
224
|
+
Batch adjust ad set bid amounts with percentage or absolute changes.
|
|
225
|
+
|
|
226
|
+
**Parameters:**
|
|
227
|
+
|
|
228
|
+
- `adAccountId` (string, required): Ad Account ID
|
|
229
|
+
- `adjustments` (array, required): Array of bid adjustments (max 50), each with `adSetId`, `adjustmentType` (percentage/absolute), and `value`
|
|
230
|
+
|
|
231
|
+
#### 18. `meta_validate_entity`
|
|
232
|
+
|
|
233
|
+
Client-side validation of entity payloads without making API calls.
|
|
234
|
+
|
|
235
|
+
**Parameters:**
|
|
236
|
+
|
|
237
|
+
- `entityType` (string, required): Type of entity to validate
|
|
238
|
+
- `mode` (string, required): Validation mode (`create` or `update`)
|
|
239
|
+
- `data` (object, required): Entity data to validate
|
|
240
|
+
- `adAccountId` (string, optional): Required for create mode
|
|
241
|
+
- `entityId` (string, optional): Required for update mode
|
|
242
|
+
|
|
243
|
+
## Supported Entity Types
|
|
244
|
+
|
|
245
|
+
| Entity Type | API Object | Notes |
|
|
246
|
+
| ---------------- | --------------- | ------------------------------------------- |
|
|
247
|
+
| `campaign` | Campaign | Top-level entity under ad account |
|
|
248
|
+
| `adSet` | Ad Set | Targeting, budget, schedule, bidding |
|
|
249
|
+
| `ad` | Ad | Links ad creative to ad set |
|
|
250
|
+
| `adCreative` | Ad Creative | Creative content (images, videos, copy) |
|
|
251
|
+
| `customAudience` | Custom Audience | Lookalike, website, customer list audiences |
|
|
252
|
+
|
|
253
|
+
**Entity Hierarchy:** Ad Account > Campaign > Ad Set > Ad (+ Ad Creatives, Custom Audiences)
|
|
254
|
+
|
|
255
|
+
## Current Status
|
|
256
|
+
|
|
257
|
+
**Phase: Production-Ready**
|
|
258
|
+
|
|
259
|
+
All listed tools are fully implemented using the configured Meta Graph API with
|
|
260
|
+
Bearer token authentication, insights reporting, and targeting discovery.
|
|
261
|
+
|
|
262
|
+
## Development
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
# Install dependencies
|
|
266
|
+
pnpm install
|
|
267
|
+
|
|
268
|
+
# Run in development mode
|
|
269
|
+
pnpm run dev:http
|
|
270
|
+
|
|
271
|
+
# Build
|
|
272
|
+
pnpm run build
|
|
273
|
+
|
|
274
|
+
# Start production server
|
|
275
|
+
pnpm run start
|
|
276
|
+
|
|
277
|
+
# Type check
|
|
278
|
+
pnpm run typecheck
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Environment Variables
|
|
282
|
+
|
|
283
|
+
- `META_MCP_PORT`: Server port (default: 3005)
|
|
284
|
+
- `META_MCP_HOST`: Server host (default: 127.0.0.1)
|
|
285
|
+
- `MCP_AUTH_MODE`: Authentication mode - `meta-bearer` (default), `jwt`, or `none`
|
|
286
|
+
- `MCP_AUTH_SECRET_KEY`: Required when `MCP_AUTH_MODE=jwt`
|
|
287
|
+
- `META_API_BASE_URL`: Graph API base URL (default: `https://graph.facebook.com/v25.0`)
|
|
288
|
+
- `META_API_VERSION`: API version (default: `v25.0`)
|
|
289
|
+
- `META_RATE_LIMIT_PER_MINUTE`: Rate limit ceiling (default: 200)
|
|
290
|
+
- `META_ACCESS_TOKEN`: Access token for stdio mode
|
|
291
|
+
- `META_VIDEO_UPLOAD_MAX_BUFFERED_BYTES`: Max buffered video upload size in bytes (default: `268435456`)
|
|
292
|
+
|
|
293
|
+
## Architecture
|
|
294
|
+
|
|
295
|
+
### Key Components
|
|
296
|
+
|
|
297
|
+
- **`MetaGraphApiClient`** - HTTP client for the configured Graph API version with form-encoded POST for writes
|
|
298
|
+
- **`MetaService`** - CRUD, bulk ops, duplication, delivery estimates, ad previews
|
|
299
|
+
- **`MetaInsightsService`** - Insights queries with breakdowns, attribution windows, and time series
|
|
300
|
+
- **`MetaTargetingService`** - Targeting search and category browsing
|
|
301
|
+
- **`MetaBearerAuthStrategy`** - Bearer token auth via `GET /me` validation
|
|
302
|
+
- **`MetaAuthAdapter`** - Token management for per-session API calls
|
|
303
|
+
- **`SessionServiceStore`** - Per-session service instances keyed by session ID
|
|
304
|
+
|
|
305
|
+
### Key Gotchas
|
|
306
|
+
|
|
307
|
+
- Budget values are in **cents** (e.g., `1000` = $10.00)
|
|
308
|
+
- `special_ad_categories` is required on campaign creation even if empty (`[]`)
|
|
309
|
+
- `meta_update_entity` returns `{success: true}` — fetch the entity after to confirm changes
|
|
310
|
+
- `targeting` on ad sets replaces entirely on update (no merge semantics)
|
|
311
|
+
- `ARCHIVED` status is permanent and cannot be reversed
|
|
312
|
+
- Insights data may lag up to 48 hours for recent activity
|
|
313
|
+
- Video uploads use a buffered proxy path and are intentionally capped below Meta's largest native upload limits
|
|
314
|
+
|
|
315
|
+
### Transport
|
|
316
|
+
|
|
317
|
+
Streamable HTTP via Hono + `@hono/mcp`. Health check at `/health`.
|
|
318
|
+
|
|
319
|
+
## Contributing
|
|
320
|
+
|
|
321
|
+
See root [CLAUDE.md](../../CLAUDE.md) for development guidelines, build system details, and monorepo conventions. See the [root README](../../README.md) for full architecture context.
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Get Started
|
|
326
|
+
|
|
327
|
+
**Self-host**: Follow the [deployment guide](../../docs/guides/deployment-instructions.md) to run this server on your own infrastructure.
|
|
328
|
+
|
|
329
|
+
**Cesteral Intelligence**: [Request access](https://cesteral.com/integrations/meta-ads?utm_source=github&utm_medium=package-readme&utm_campaign=meta-mcp) -- governed execution with credential brokering, approvals, audit, and multi-tenant access.
|
|
330
|
+
|
|
331
|
+
**Book a workflow demo**: [See it in action](mailto:sales@cesteral.com?subject=Workflow%20demo%20-%20Meta%20Ads%20MCP) with your own ad accounts.
|
|
332
|
+
|
|
333
|
+
**Compare options**: [OSS connectors vs Cesteral Intelligence](https://cesteral.com/compare?utm_source=github&utm_medium=package-readme&utm_campaign=meta-mcp)
|
|
334
|
+
|
|
335
|
+
## License
|
|
336
|
+
|
|
337
|
+
Apache License 2.0 — see [LICENSE](../../LICENSE.md) for details. This package is part of Cesteral's open-source connector layer; managed hosting and higher-level governance features live outside this repository.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAGA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAGA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { OAuth2RefreshAdapterBase } from "@cesteral/shared";
|
|
2
|
+
export interface MetaAuthAdapter {
|
|
3
|
+
getAccessToken(): Promise<string>;
|
|
4
|
+
validate(): Promise<void>;
|
|
5
|
+
readonly userId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class MetaAccessTokenAdapter implements MetaAuthAdapter {
|
|
8
|
+
private readonly accessToken;
|
|
9
|
+
private readonly baseUrl;
|
|
10
|
+
private validated;
|
|
11
|
+
private _userId;
|
|
12
|
+
constructor(accessToken: string, baseUrl?: string);
|
|
13
|
+
get userId(): string;
|
|
14
|
+
getAccessToken(): Promise<string>;
|
|
15
|
+
validate(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export interface MetaAppCredentials {
|
|
18
|
+
appId: string;
|
|
19
|
+
appSecret: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class MetaRefreshTokenAdapter extends OAuth2RefreshAdapterBase<{
|
|
22
|
+
appId: string;
|
|
23
|
+
appSecret: string;
|
|
24
|
+
refreshToken: string;
|
|
25
|
+
}> implements MetaAuthAdapter {
|
|
26
|
+
private readonly baseUrl;
|
|
27
|
+
private _userId;
|
|
28
|
+
private static readonly EXPIRY_BUFFER_MS;
|
|
29
|
+
private static readonly INDEFINITE_EXPIRES_IN_SECONDS;
|
|
30
|
+
constructor(initialToken: string, appCredentials: MetaAppCredentials, baseUrl?: string);
|
|
31
|
+
get userId(): string;
|
|
32
|
+
validate(): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export declare function parseMetaTokenFromHeaders(headers: Record<string, string | string[] | undefined>): string;
|
|
35
|
+
export declare function parseMetaAppCredentialsFromHeaders(headers: Record<string, string | string[] | undefined>): MetaAppCredentials | undefined;
|
|
36
|
+
export declare function getMetaCredentialFingerprint(accessToken: string): string;
|
|
37
|
+
//# sourceMappingURL=meta-auth-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-auth-adapter.d.ts","sourceRoot":"","sources":["../../src/auth/meta-auth-adapter.ts"],"names":[],"mappings":"AAgBA,OAAO,EAML,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAO1B,MAAM,WAAW,eAAe;IAC9B,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AA2BD,qBAAa,sBAAuB,YAAW,eAAe;IAK1D,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL1B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAM;gBAGF,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,MAAwC;IAGpE,IAAI,MAAM,IAAI,MAAM,CAEnB;IAEK,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAIjC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAKhC;AAKD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAgBD,qBAAa,uBACX,SAAQ,wBAAwB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAC3F,YAAW,eAAe;IAiBxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAf1B,OAAO,CAAC,OAAO,CAAM;IAOrB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAuB;IAG/D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,6BAA6B,CAA4B;gBAG/E,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,kBAAkB,EACjB,OAAO,GAAE,MAAwC;IAkEpE,IAAI,MAAM,IAAI,MAAM,CAEnB;IAEK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAIhC;AAMD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GACrD,MAAM,CAaR;AAMD,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GACrD,kBAAkB,GAAG,SAAS,CAShC;AAKD,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAExE"}
|