@cesteral/pinterest-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 +348 -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/pinterest-auth-adapter.d.ts +38 -0
- package/dist/auth/pinterest-auth-adapter.d.ts.map +1 -0
- package/dist/auth/pinterest-auth-adapter.js +117 -0
- package/dist/auth/pinterest-auth-adapter.js.map +1 -0
- package/dist/auth/pinterest-auth-strategy.d.ts +13 -0
- package/dist/auth/pinterest-auth-strategy.d.ts.map +1 -0
- package/dist/auth/pinterest-auth-strategy.js +52 -0
- package/dist/auth/pinterest-auth-strategy.js.map +1 -0
- package/dist/config/index.d.ts +120 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +55 -0
- package/dist/config/index.js.map +1 -0
- package/dist/generated/types.d.ts +18119 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +2 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -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 +125 -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 +105 -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 +95 -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 +301 -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 +198 -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 +188 -0
- package/dist/mcp-server/prompts/definitions/entity-update-workflow.prompt.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/reporting-workflow.prompt.d.ts +4 -0
- package/dist/mcp-server/prompts/definitions/reporting-workflow.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/reporting-workflow.prompt.js +126 -0
- package/dist/mcp-server/prompts/definitions/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 +197 -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 +93 -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 +111 -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 +180 -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 +140 -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/index.d.ts +7 -0
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/index.js +58 -0
- package/dist/mcp-server/resources/definitions/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/reporting-reference.resource.d.ts +3 -0
- package/dist/mcp-server/resources/definitions/reporting-reference.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/reporting-reference.resource.js +148 -0
- package/dist/mcp-server/resources/definitions/reporting-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/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 +209 -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 +141 -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 +151 -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 +109 -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 +193 -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 +127 -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 +153 -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 +134 -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 +119 -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 +91 -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 +113 -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 +99 -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 +100 -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 +110 -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 +297 -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 +110 -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 +105 -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 +85 -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 +89 -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 +74 -0
- package/dist/mcp-server/tools/definitions/get-ad-preview.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-audience-estimate.tool.d.ts +85 -0
- package/dist/mcp-server/tools/definitions/get-audience-estimate.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-audience-estimate.tool.js +88 -0
- package/dist/mcp-server/tools/definitions/get-audience-estimate.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-entity.tool.d.ts +76 -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 +71 -0
- package/dist/mcp-server/tools/definitions/get-entity.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-report-breakdowns.tool.d.ts +319 -0
- package/dist/mcp-server/tools/definitions/get-report-breakdowns.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-report-breakdowns.tool.js +183 -0
- package/dist/mcp-server/tools/definitions/get-report-breakdowns.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-report.tool.d.ts +301 -0
- package/dist/mcp-server/tools/definitions/get-report.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-report.tool.js +176 -0
- package/dist/mcp-server/tools/definitions/get-report.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-targeting-options.tool.d.ts +75 -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 +72 -0
- package/dist/mcp-server/tools/definitions/get-targeting-options.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/index.d.ts +25 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/index.js +75 -0
- package/dist/mcp-server/tools/definitions/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/list-advertisers.tool.d.ts +54 -0
- package/dist/mcp-server/tools/definitions/list-advertisers.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/list-advertisers.tool.js +58 -0
- package/dist/mcp-server/tools/definitions/list-advertisers.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/list-entities.tool.d.ts +180 -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 +116 -0
- package/dist/mcp-server/tools/definitions/list-entities.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-targeting.tool.d.ts +103 -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 +98 -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 +164 -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 +118 -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 +111 -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 +89 -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 +81 -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 +73 -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 +82 -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 +100 -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 +154 -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/entity-mapping.d.ts +22 -0
- package/dist/mcp-server/tools/utils/entity-mapping.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/entity-mapping.js +105 -0
- package/dist/mcp-server/tools/utils/entity-mapping.js.map +1 -0
- package/dist/mcp-server/tools/utils/media-types.d.ts +14 -0
- package/dist/mcp-server/tools/utils/media-types.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/media-types.js +2 -0
- package/dist/mcp-server/tools/utils/media-types.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 +59 -0
- package/dist/mcp-server/transports/streamable-http-transport.d.ts.map +1 -0
- package/dist/mcp-server/transports/streamable-http-transport.js +107 -0
- package/dist/mcp-server/transports/streamable-http-transport.js.map +1 -0
- package/dist/services/pinterest/pinterest-http-client.d.ts +22 -0
- package/dist/services/pinterest/pinterest-http-client.d.ts.map +1 -0
- package/dist/services/pinterest/pinterest-http-client.js +149 -0
- package/dist/services/pinterest/pinterest-http-client.js.map +1 -0
- package/dist/services/pinterest/pinterest-reporting-service.d.ts +60 -0
- package/dist/services/pinterest/pinterest-reporting-service.d.ts.map +1 -0
- package/dist/services/pinterest/pinterest-reporting-service.js +132 -0
- package/dist/services/pinterest/pinterest-reporting-service.js.map +1 -0
- package/dist/services/pinterest/pinterest-service.d.ts +110 -0
- package/dist/services/pinterest/pinterest-service.d.ts.map +1 -0
- package/dist/services/pinterest/pinterest-service.js +238 -0
- package/dist/services/pinterest/pinterest-service.js.map +1 -0
- package/dist/services/session-services.d.ts +21 -0
- package/dist/services/session-services.d.ts.map +1 -0
- package/dist/services/session-services.js +23 -0
- package/dist/services/session-services.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/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 +57 -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,348 @@
|
|
|
1
|
+
# @cesteral/pinterest-mcp
|
|
2
|
+
|
|
3
|
+
Pinterest Ads MCP Server - Campaign management and reporting via Pinterest Ads API v5.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Management server for Pinterest Ads. Provides full CRUD operations, async
|
|
8
|
+
reporting, targeting discovery, bulk operations, and specialized features like
|
|
9
|
+
entity duplication and audience estimation. Designed for AI agents to manage
|
|
10
|
+
Pinterest Ads campaigns programmatically through the Model Context Protocol with
|
|
11
|
+
per-session Bearer token authentication.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **Per-session Bearer token auth** via `PinterestBearerAuthStrategy` (validates tokens and extracts advertiser ID)
|
|
16
|
+
- **Streamable HTTP + stdio transports** via Hono + `@hono/mcp`
|
|
17
|
+
- **OpenTelemetry** instrumentation for traces and metrics
|
|
18
|
+
- **Rate limiting** via shared `RateLimiter` class (100/min default)
|
|
19
|
+
- **Structured logging** via Pino
|
|
20
|
+
- **Automatic `ad_account_id` injection** into GET query params and POST request bodies
|
|
21
|
+
|
|
22
|
+
## MCP Tools
|
|
23
|
+
|
|
24
|
+
### Core CRUD
|
|
25
|
+
|
|
26
|
+
#### 1. `pinterest_list_entities`
|
|
27
|
+
|
|
28
|
+
List Pinterest Ads entities with page-based pagination and optional filtering.
|
|
29
|
+
|
|
30
|
+
**Parameters:**
|
|
31
|
+
|
|
32
|
+
- `entityType` (string, required): Type of entity to list
|
|
33
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
34
|
+
- `filters` (object, optional): Filter criteria for the entity list
|
|
35
|
+
- `page` (number, optional): Page number for pagination
|
|
36
|
+
- `pageSize` (number, optional): Results per page
|
|
37
|
+
|
|
38
|
+
#### 2. `pinterest_get_entity`
|
|
39
|
+
|
|
40
|
+
Get a single Pinterest Ads entity by ID.
|
|
41
|
+
|
|
42
|
+
**Parameters:**
|
|
43
|
+
|
|
44
|
+
- `entityType` (string, required): Type of entity to retrieve
|
|
45
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
46
|
+
- `entityId` (string, required): The entity ID
|
|
47
|
+
|
|
48
|
+
#### 3. `pinterest_create_entity`
|
|
49
|
+
|
|
50
|
+
Create a new Pinterest Ads entity.
|
|
51
|
+
|
|
52
|
+
**Parameters:**
|
|
53
|
+
|
|
54
|
+
- `entityType` (string, required): Type of entity to create
|
|
55
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
56
|
+
- `data` (object, required): Entity fields as key-value pairs
|
|
57
|
+
|
|
58
|
+
#### 4. `pinterest_update_entity`
|
|
59
|
+
|
|
60
|
+
Update an existing Pinterest Ads entity.
|
|
61
|
+
|
|
62
|
+
**Parameters:**
|
|
63
|
+
|
|
64
|
+
- `entityType` (string, required): Type of entity to update
|
|
65
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
66
|
+
- `entityId` (string, required): The entity ID to update
|
|
67
|
+
- `data` (object, required): Fields to update as key-value pairs
|
|
68
|
+
|
|
69
|
+
#### 5. `pinterest_delete_entity`
|
|
70
|
+
|
|
71
|
+
Delete Pinterest Ads entities.
|
|
72
|
+
|
|
73
|
+
**Parameters:**
|
|
74
|
+
|
|
75
|
+
- `entityType` (string, required): Type of entities to delete
|
|
76
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
77
|
+
- `entityIds` (string[], required): Entity IDs to delete (max 20)
|
|
78
|
+
|
|
79
|
+
### Account
|
|
80
|
+
|
|
81
|
+
#### 6. `pinterest_list_ad_accounts`
|
|
82
|
+
|
|
83
|
+
List advertiser accounts accessible to the authenticated user.
|
|
84
|
+
|
|
85
|
+
**Parameters:** _(none)_
|
|
86
|
+
|
|
87
|
+
### Reporting
|
|
88
|
+
|
|
89
|
+
> All Pinterest reporting tools 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).
|
|
90
|
+
|
|
91
|
+
#### 7. `pinterest_get_report`
|
|
92
|
+
|
|
93
|
+
Submit an async report and download results once complete.
|
|
94
|
+
|
|
95
|
+
**Parameters:**
|
|
96
|
+
|
|
97
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
98
|
+
- `dimensions` (string[], required): Report dimensions (e.g., `campaign_id`, `adgroup_id`)
|
|
99
|
+
- `metrics` (string[], required): Metrics to include (e.g., `spend`, `impressions`, `clicks`)
|
|
100
|
+
- `startDate` (string, required): Start date (YYYY-MM-DD)
|
|
101
|
+
- `endDate` (string, required): End date (YYYY-MM-DD)
|
|
102
|
+
- `mode`, `columns`, `offset`, `maxRows` (optional): Bounded report-view params (see note above)
|
|
103
|
+
|
|
104
|
+
#### 8. `pinterest_get_report_breakdowns`
|
|
105
|
+
|
|
106
|
+
Submit a report with additional breakdown dimensions.
|
|
107
|
+
|
|
108
|
+
**Parameters:**
|
|
109
|
+
|
|
110
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
111
|
+
- `dimensions` (string[], required): Primary dimensions
|
|
112
|
+
- `breakdowns` (string[], required): Breakdown dimensions (e.g., `age`, `gender`, `country`)
|
|
113
|
+
- `metrics` (string[], required): Metrics to include
|
|
114
|
+
- `startDate` (string, required): Start date (YYYY-MM-DD)
|
|
115
|
+
- `endDate` (string, required): End date (YYYY-MM-DD)
|
|
116
|
+
- `mode`, `columns`, `offset`, `maxRows` (optional): Bounded report-view params (see note above)
|
|
117
|
+
|
|
118
|
+
#### 9. `pinterest_submit_report`
|
|
119
|
+
|
|
120
|
+
Submit an async report without waiting for completion (non-blocking).
|
|
121
|
+
|
|
122
|
+
**Parameters:**
|
|
123
|
+
|
|
124
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
125
|
+
- `dimensions` (string[], required): Report dimensions
|
|
126
|
+
- `metrics` (string[], required): Metrics to include
|
|
127
|
+
- `startDate` (string, required): Start date (YYYY-MM-DD)
|
|
128
|
+
- `endDate` (string, required): End date (YYYY-MM-DD)
|
|
129
|
+
|
|
130
|
+
#### 10. `pinterest_check_report_status`
|
|
131
|
+
|
|
132
|
+
Single status check for a submitted report.
|
|
133
|
+
|
|
134
|
+
**Parameters:**
|
|
135
|
+
|
|
136
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
137
|
+
- `taskId` (string, required): Report task ID from submit
|
|
138
|
+
|
|
139
|
+
#### 11. `pinterest_download_report`
|
|
140
|
+
|
|
141
|
+
Download and parse report CSV from URL.
|
|
142
|
+
|
|
143
|
+
**Parameters:**
|
|
144
|
+
|
|
145
|
+
- `downloadUrl` (string, required): Report download URL
|
|
146
|
+
- `mode`, `columns`, `offset`, `maxRows` (optional): Bounded report-view params (see note above the reporting tools)
|
|
147
|
+
- `storeRawCsv` (boolean, optional): When true, persist the full (redacted) CSV in the in-process report-csv store and return a `report-csv://{id}` resource URI alongside the bounded view. Useful when a downstream tool needs the entire CSV but the model only needs a preview. Entries expire after 30 minutes (default) or are evicted via LRU at 100 entries.
|
|
148
|
+
|
|
149
|
+
### Bulk Operations
|
|
150
|
+
|
|
151
|
+
#### 12. `pinterest_bulk_update_status`
|
|
152
|
+
|
|
153
|
+
Batch enable, disable, or delete multiple entities.
|
|
154
|
+
|
|
155
|
+
**Parameters:**
|
|
156
|
+
|
|
157
|
+
- `entityType` (string, required): Type of entities to update
|
|
158
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
159
|
+
- `entityIds` (string[], required): Entity IDs to update (max 50)
|
|
160
|
+
- `operationStatus` (string, required): `ENABLE`, `DISABLE`, or `DELETE`
|
|
161
|
+
|
|
162
|
+
#### 13. `pinterest_bulk_create_entities`
|
|
163
|
+
|
|
164
|
+
Batch create multiple entities of the same type.
|
|
165
|
+
|
|
166
|
+
**Parameters:**
|
|
167
|
+
|
|
168
|
+
- `entityType` (string, required): Type of entities to create
|
|
169
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
170
|
+
- `items` (array, required): Array of entity data objects (max 50)
|
|
171
|
+
|
|
172
|
+
#### 14. `pinterest_bulk_update_entities`
|
|
173
|
+
|
|
174
|
+
Batch update multiple entities with individual data payloads.
|
|
175
|
+
|
|
176
|
+
**Parameters:**
|
|
177
|
+
|
|
178
|
+
- `entityType` (string, required): Type of entities to update
|
|
179
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
180
|
+
- `items` (array, required): Array of update items (max 50), each with entity ID and data
|
|
181
|
+
|
|
182
|
+
### Bid Adjustment
|
|
183
|
+
|
|
184
|
+
#### 15. `pinterest_adjust_bids`
|
|
185
|
+
|
|
186
|
+
Batch adjust ad group bid prices with safe read-modify-write pattern.
|
|
187
|
+
|
|
188
|
+
**Parameters:**
|
|
189
|
+
|
|
190
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
191
|
+
- `adjustments` (array, required): Array of bid adjustments, each with ad group ID, adjustment type, and value
|
|
192
|
+
|
|
193
|
+
### Targeting
|
|
194
|
+
|
|
195
|
+
#### 16. `pinterest_search_targeting`
|
|
196
|
+
|
|
197
|
+
Search for targeting options (interest categories, behaviors, demographics) by keyword.
|
|
198
|
+
|
|
199
|
+
**Parameters:**
|
|
200
|
+
|
|
201
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
202
|
+
- `targetingType` (string, required): Type of targeting to search
|
|
203
|
+
- `query` (string, optional): Search keyword
|
|
204
|
+
|
|
205
|
+
#### 17. `pinterest_get_targeting_options`
|
|
206
|
+
|
|
207
|
+
Browse available targeting categories.
|
|
208
|
+
|
|
209
|
+
**Parameters:**
|
|
210
|
+
|
|
211
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
212
|
+
- `targetingType` (string, optional): Filter by targeting type
|
|
213
|
+
|
|
214
|
+
### Specialized
|
|
215
|
+
|
|
216
|
+
#### 18. `pinterest_duplicate_entity`
|
|
217
|
+
|
|
218
|
+
Duplicate a campaign, ad group, or ad.
|
|
219
|
+
|
|
220
|
+
**Parameters:**
|
|
221
|
+
|
|
222
|
+
- `entityType` (string, required): Type of entity to duplicate (`campaign`, `adGroup`, `ad`)
|
|
223
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
224
|
+
- `entityId` (string, required): ID of the entity to duplicate
|
|
225
|
+
- `options` (object, optional): Duplication options (e.g., rename prefix/suffix)
|
|
226
|
+
|
|
227
|
+
#### 19. `pinterest_get_audience_estimate`
|
|
228
|
+
|
|
229
|
+
Get estimated audience size for a targeting configuration.
|
|
230
|
+
|
|
231
|
+
**Parameters:**
|
|
232
|
+
|
|
233
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
234
|
+
- `targetingConfig` (object, required): Targeting specification for estimation
|
|
235
|
+
|
|
236
|
+
#### 20. `pinterest_get_ad_preview`
|
|
237
|
+
|
|
238
|
+
Get ad preview for video or image ads.
|
|
239
|
+
|
|
240
|
+
**Parameters:**
|
|
241
|
+
|
|
242
|
+
- `adAccountId` (string, required): Pinterest Advertiser ID
|
|
243
|
+
- `adId` (string, required): Ad ID to preview
|
|
244
|
+
- `adFormat` (string, optional): Ad format for preview rendering
|
|
245
|
+
|
|
246
|
+
### Validation
|
|
247
|
+
|
|
248
|
+
#### 21. `pinterest_validate_entity`
|
|
249
|
+
|
|
250
|
+
Client-side validation of entity payloads without making API calls.
|
|
251
|
+
|
|
252
|
+
**Parameters:**
|
|
253
|
+
|
|
254
|
+
- `entityType` (string, required): Type of entity to validate
|
|
255
|
+
- `mode` (string, required): Validation mode (`create` or `update`)
|
|
256
|
+
- `data` (object, required): Entity data to validate
|
|
257
|
+
|
|
258
|
+
## Supported Entity Types
|
|
259
|
+
|
|
260
|
+
| Entity Type | API Object | Notes |
|
|
261
|
+
| ----------- | ---------- | ----------------------------------------------- |
|
|
262
|
+
| `campaign` | Campaign | Top-level entity under advertiser account |
|
|
263
|
+
| `adGroup` | Ad Group | Targeting, budget, schedule, bidding, placement |
|
|
264
|
+
| `ad` | Ad | Links creative content to ad group |
|
|
265
|
+
| `creative` | Creative | Video/image creative assets |
|
|
266
|
+
|
|
267
|
+
**Entity Hierarchy:** Advertiser > Campaign > Ad Group > Ad (+ Creatives)
|
|
268
|
+
|
|
269
|
+
## Current Status
|
|
270
|
+
|
|
271
|
+
**Phase: Production-Ready**
|
|
272
|
+
|
|
273
|
+
All listed tools are fully implemented using Pinterest Ads API v5 with Bearer
|
|
274
|
+
token authentication, async reporting, and targeting discovery.
|
|
275
|
+
|
|
276
|
+
## Development
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
# Install dependencies
|
|
280
|
+
pnpm install
|
|
281
|
+
|
|
282
|
+
# Run in development mode
|
|
283
|
+
pnpm run dev:http
|
|
284
|
+
|
|
285
|
+
# Build
|
|
286
|
+
pnpm run build
|
|
287
|
+
|
|
288
|
+
# Start production server
|
|
289
|
+
pnpm run start
|
|
290
|
+
|
|
291
|
+
# Type check
|
|
292
|
+
pnpm run typecheck
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Environment Variables
|
|
296
|
+
|
|
297
|
+
- `PINTEREST_MCP_PORT`: Server port (default: 3011)
|
|
298
|
+
- `PINTEREST_MCP_HOST`: Server host (default: `127.0.0.1` in development, `0.0.0.0` in production)
|
|
299
|
+
- `MCP_AUTH_MODE`: Authentication mode - `pinterest-bearer` (default), `jwt`, or `none`
|
|
300
|
+
- `MCP_AUTH_SECRET_KEY`: Required when `MCP_AUTH_MODE=jwt`
|
|
301
|
+
- `PINTEREST_API_BASE_URL`: Pinterest Business API base URL (default: `https://business-api.pinterest.com`)
|
|
302
|
+
- `PINTEREST_API_VERSION`: API version (default: `v1.3`)
|
|
303
|
+
- `PINTEREST_RATE_LIMIT_PER_MINUTE`: Rate limit ceiling (default: 100)
|
|
304
|
+
- `PINTEREST_ACCESS_TOKEN`: Access token for stdio mode
|
|
305
|
+
- `PINTEREST_ADVERTISER_ID`: Advertiser ID for stdio mode
|
|
306
|
+
|
|
307
|
+
## Architecture
|
|
308
|
+
|
|
309
|
+
### Key Components
|
|
310
|
+
|
|
311
|
+
- **`PinterestHttpClient`** - HTTP client for Pinterest Ads API v5
|
|
312
|
+
- **`PinterestService`** - CRUD, bulk ops, duplication, targeting, audience estimates, ad previews
|
|
313
|
+
- **`PinterestReportingService`** - Async report submission, polling, and download
|
|
314
|
+
- **`PinterestBearerAuthStrategy`** - Bearer token + advertiser ID auth
|
|
315
|
+
- **`PinterestAuthAdapter`** - Token + advertiser ID management for per-session API calls
|
|
316
|
+
- **`SessionServiceStore`** - Per-session service instances keyed by session ID
|
|
317
|
+
|
|
318
|
+
### Key Gotchas
|
|
319
|
+
|
|
320
|
+
- `ad_account_id` is automatically injected into GET query params and POST request bodies
|
|
321
|
+
- Uses page-based pagination (`page`/`page_size`) not cursor-based
|
|
322
|
+
- Reporting is async: submit report -> poll for completion -> download results
|
|
323
|
+
- Delete operations accept max 20 entity IDs per call
|
|
324
|
+
- `DISABLE` status is used instead of `PAUSED` (Pinterest-specific terminology)
|
|
325
|
+
|
|
326
|
+
### Transport
|
|
327
|
+
|
|
328
|
+
Streamable HTTP via Hono + `@hono/mcp`. Health check at `/health`.
|
|
329
|
+
|
|
330
|
+
## Contributing
|
|
331
|
+
|
|
332
|
+
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.
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Get Started
|
|
337
|
+
|
|
338
|
+
**Self-host**: Follow the [deployment guide](../../docs/guides/deployment-instructions.md) to run this server on your own infrastructure.
|
|
339
|
+
|
|
340
|
+
**Cesteral Intelligence**: [Request access](https://cesteral.com/integrations/pinterest-ads?utm_source=github&utm_medium=package-readme&utm_campaign=pinterest-mcp) -- governed execution with credential brokering, approvals, audit, and multi-tenant access.
|
|
341
|
+
|
|
342
|
+
**Book a workflow demo**: [See it in action](mailto:sales@cesteral.com?subject=Workflow%20demo%20-%20Pinterest%20Ads%20MCP) with your own ad accounts.
|
|
343
|
+
|
|
344
|
+
**Compare options**: [OSS connectors vs Cesteral Intelligence](https://cesteral.com/compare?utm_source=github&utm_medium=package-readme&utm_campaign=pinterest-mcp)
|
|
345
|
+
|
|
346
|
+
## License
|
|
347
|
+
|
|
348
|
+
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,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAGA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { OAuth2RefreshAdapterBase } from "@cesteral/shared";
|
|
2
|
+
export interface PinterestAuthAdapter {
|
|
3
|
+
getAccessToken(): Promise<string>;
|
|
4
|
+
validate(): Promise<void>;
|
|
5
|
+
readonly userId: string;
|
|
6
|
+
readonly adAccountId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class PinterestAccessTokenAdapter implements PinterestAuthAdapter {
|
|
9
|
+
private readonly accessToken;
|
|
10
|
+
private readonly _adAccountId;
|
|
11
|
+
private readonly baseUrl;
|
|
12
|
+
private validated;
|
|
13
|
+
private _userId;
|
|
14
|
+
constructor(accessToken: string, _adAccountId: string, baseUrl?: string);
|
|
15
|
+
get userId(): string;
|
|
16
|
+
get adAccountId(): string;
|
|
17
|
+
getAccessToken(): Promise<string>;
|
|
18
|
+
validate(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export interface PinterestRefreshCredentials {
|
|
21
|
+
appId: string;
|
|
22
|
+
appSecret: string;
|
|
23
|
+
refreshToken: string;
|
|
24
|
+
}
|
|
25
|
+
export declare class PinterestRefreshTokenAdapter extends OAuth2RefreshAdapterBase<PinterestRefreshCredentials> implements PinterestAuthAdapter {
|
|
26
|
+
private readonly _adAccountId;
|
|
27
|
+
private readonly baseUrl;
|
|
28
|
+
private _userId;
|
|
29
|
+
constructor(credentials: PinterestRefreshCredentials, _adAccountId: string, baseUrl?: string);
|
|
30
|
+
get userId(): string;
|
|
31
|
+
get adAccountId(): string;
|
|
32
|
+
validate(): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export declare function parsePinterestRefreshCredentialsFromHeaders(headers: Record<string, string | string[] | undefined>): PinterestRefreshCredentials | undefined;
|
|
35
|
+
export declare function parsePinterestTokenFromHeaders(headers: Record<string, string | string[] | undefined>): string;
|
|
36
|
+
export declare function getPinterestAdvertiserIdFromHeaders(headers: Record<string, string | string[] | undefined>): string;
|
|
37
|
+
export declare function getPinterestCredentialFingerprint(accessToken: string, adAccountId: string): string;
|
|
38
|
+
//# sourceMappingURL=pinterest-auth-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pinterest-auth-adapter.d.ts","sourceRoot":"","sources":["../../src/auth/pinterest-auth-adapter.ts"],"names":[],"mappings":"AAgBA,OAAO,EAML,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAa1B,MAAM,WAAW,oBAAoB;IACnC,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AA+BD,qBAAa,2BAA4B,YAAW,oBAAoB;IAKpE,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAM;gBAGF,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,MAAoC;IAGhE,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAEK,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAIjC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAKhC;AAKD,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD,qBAAa,4BACX,SAAQ,wBAAwB,CAAC,2BAA2B,CAC5D,YAAW,oBAAoB;IAM7B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL1B,OAAO,CAAC,OAAO,CAAM;gBAGnB,WAAW,EAAE,2BAA2B,EACvB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,MAAoC;IAuChE,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAEK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAKhC;AAMD,wBAAgB,2CAA2C,CACzD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GACrD,2BAA2B,GAAG,SAAS,CAUzC;AAMD,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GACrD,MAAM,CAgBR;AAMD,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GACrD,MAAM,CAaR;AAKD,wBAAgB,iCAAiC,CAC/C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,MAAM,CAER"}
|