@cashtokenai/meta-mcp-server 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 +21 -0
- package/README.md +294 -0
- package/dist/config.d.ts +39 -0
- package/dist/config.js +60 -0
- package/dist/constants.d.ts +21 -0
- package/dist/constants.js +28 -0
- package/dist/context.d.ts +9 -0
- package/dist/context.js +8 -0
- package/dist/errors.d.ts +41 -0
- package/dist/errors.js +120 -0
- package/dist/helpers/cache.d.ts +6 -0
- package/dist/helpers/cache.js +28 -0
- package/dist/helpers/format.d.ts +17 -0
- package/dist/helpers/format.js +28 -0
- package/dist/helpers/graph-client.d.ts +90 -0
- package/dist/helpers/graph-client.js +219 -0
- package/dist/helpers/schema.d.ts +30 -0
- package/dist/helpers/schema.js +69 -0
- package/dist/helpers/validate.d.ts +26 -0
- package/dist/helpers/validate.js +125 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +36 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.js +18 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.js +34 -0
- package/dist/tools/ads/get-account.d.ts +29 -0
- package/dist/tools/ads/get-account.js +45 -0
- package/dist/tools/ads/get-creative.d.ts +29 -0
- package/dist/tools/ads/get-creative.js +37 -0
- package/dist/tools/ads/get-insights.d.ts +129 -0
- package/dist/tools/ads/get-insights.js +153 -0
- package/dist/tools/ads/list-accounts.d.ts +54 -0
- package/dist/tools/ads/list-accounts.js +59 -0
- package/dist/tools/ads/list-ads.d.ts +53 -0
- package/dist/tools/ads/list-ads.js +59 -0
- package/dist/tools/ads/list-adsets.d.ts +49 -0
- package/dist/tools/ads/list-adsets.js +54 -0
- package/dist/tools/ads/list-campaigns.d.ts +45 -0
- package/dist/tools/ads/list-campaigns.js +64 -0
- package/dist/tools/ads/list-custom-audiences.d.ts +41 -0
- package/dist/tools/ads/list-custom-audiences.js +41 -0
- package/dist/tools/business/list-assets.d.ts +37 -0
- package/dist/tools/business/list-assets.js +136 -0
- package/dist/tools/business/list-businesses.d.ts +37 -0
- package/dist/tools/business/list-businesses.js +81 -0
- package/dist/tools/business/list-system-users.d.ts +41 -0
- package/dist/tools/business/list-system-users.js +73 -0
- package/dist/tools/catalog/get-diagnostics.d.ts +29 -0
- package/dist/tools/catalog/get-diagnostics.js +26 -0
- package/dist/tools/catalog/list-products.d.ts +45 -0
- package/dist/tools/catalog/list-products.js +49 -0
- package/dist/tools/catalog/list.d.ts +54 -0
- package/dist/tools/catalog/list.js +48 -0
- package/dist/tools/instagram/get-account.d.ts +29 -0
- package/dist/tools/instagram/get-account.js +34 -0
- package/dist/tools/instagram/get-audience-demographics.d.ts +45 -0
- package/dist/tools/instagram/get-audience-demographics.js +58 -0
- package/dist/tools/instagram/get-media-insights.d.ts +29 -0
- package/dist/tools/instagram/get-media-insights.js +49 -0
- package/dist/tools/instagram/list-accounts.d.ts +33 -0
- package/dist/tools/instagram/list-accounts.js +63 -0
- package/dist/tools/instagram/list-media.d.ts +41 -0
- package/dist/tools/instagram/list-media.js +42 -0
- package/dist/tools/meta/graph-read.d.ts +33 -0
- package/dist/tools/meta/graph-read.js +71 -0
- package/dist/tools/overview/business-overview.d.ts +49 -0
- package/dist/tools/overview/business-overview.js +235 -0
- package/dist/tools/overview/content-report.d.ts +57 -0
- package/dist/tools/overview/content-report.js +344 -0
- package/dist/tools/overview/latest-posts-summary.d.ts +41 -0
- package/dist/tools/overview/latest-posts-summary.js +189 -0
- package/dist/tools/pages/get-insights.d.ts +41 -0
- package/dist/tools/pages/get-insights.js +49 -0
- package/dist/tools/pages/get-post-insights.d.ts +33 -0
- package/dist/tools/pages/get-post-insights.js +47 -0
- package/dist/tools/pages/get.d.ts +29 -0
- package/dist/tools/pages/get.js +50 -0
- package/dist/tools/pages/list-posts.d.ts +53 -0
- package/dist/tools/pages/list-posts.js +62 -0
- package/dist/tools/pages/list-reviews.d.ts +41 -0
- package/dist/tools/pages/list-reviews.js +37 -0
- package/dist/tools/pages/list-videos.d.ts +41 -0
- package/dist/tools/pages/list-videos.js +40 -0
- package/dist/tools/pages/list.d.ts +41 -0
- package/dist/tools/pages/list.js +39 -0
- package/dist/tools/pixels/get-stats.d.ts +41 -0
- package/dist/tools/pixels/get-stats.js +34 -0
- package/dist/tools/pixels/list.d.ts +41 -0
- package/dist/tools/pixels/list.js +41 -0
- package/dist/tools/register.d.ts +3 -0
- package/dist/tools/register.js +95 -0
- package/dist/tools/shared.d.ts +45 -0
- package/dist/tools/shared.js +137 -0
- package/dist/tools/token/health.d.ts +17 -0
- package/dist/tools/token/health.js +65 -0
- package/dist/tools/token/inspect.d.ts +26 -0
- package/dist/tools/token/inspect.js +88 -0
- package/dist/tools/whatsapp/get-analytics.d.ts +57 -0
- package/dist/tools/whatsapp/get-analytics.js +66 -0
- package/dist/tools/whatsapp/list-phone-numbers.d.ts +41 -0
- package/dist/tools/whatsapp/list-phone-numbers.js +35 -0
- package/dist/tools/whatsapp/list-templates.d.ts +45 -0
- package/dist/tools/whatsapp/list-templates.js +44 -0
- package/dist/tools/whatsapp/list-wabas.d.ts +54 -0
- package/dist/tools/whatsapp/list-wabas.js +48 -0
- package/dist/types/meta.d.ts +46 -0
- package/dist/types/meta.js +1 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CashToken Rewards
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# meta-mcp-server
|
|
2
|
+
|
|
3
|
+
> **Read-only Model Context Protocol server for Meta Business Manager.** Plug-in for AI assistants ("ChatGPT for marketing insights") that surfaces Pages, Instagram Business, Marketing API ad insights, Pixels, Commerce catalogs, and WhatsApp Business data — all read-only by construction.
|
|
4
|
+
|
|
5
|
+
[](#read-only-by-construction)
|
|
6
|
+
[](./governance/standards/sdgp-main.md)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Why this exists
|
|
12
|
+
|
|
13
|
+
CashToken Marketing operates several Pages, Instagram Business accounts, Meta ad accounts, Pixels and (in future) Catalogs / WhatsApp Business assets across the `Hodusoft` Business Manager. Insight retrieval today is fragmented across Business Suite UIs, Ads Manager exports, and ad-hoc Graph API calls. This MCP server consolidates **read-only** access into a single tool surface that any MCP-aware AI assistant can plug into — turning fragmented UIs into one conversational interface for the marketing team.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Read-only by construction
|
|
18
|
+
|
|
19
|
+
This server cannot write to Meta. Period. Four layers of defence:
|
|
20
|
+
|
|
21
|
+
1. **HTTP interceptor** — every axios request passes through a guard that throws `ReadOnlyViolationError` if the method isn't `GET`, before the request leaves the process. ([`src/helpers/graph-client.ts`](./src/helpers/graph-client.ts))
|
|
22
|
+
2. **No write API surface** — the `GraphClient` class exposes only `get()` and `getAllPages()`. No `post()`, `put()`, `patch()`, or `delete()` exist anywhere in `src/`.
|
|
23
|
+
3. **All tools annotated** `readOnlyHint: true, destructiveHint: false` — MCP clients surface this to end users.
|
|
24
|
+
4. **Belt-and-braces token scopes** (operator responsibility) — issue the system-user token with read-only scopes (`ads_read`, `pages_read_engagement`, `read_insights`, `instagram_basic`, `instagram_manage_insights`). Even if the server were compromised, the token itself cannot write. See [`ADR-20260421-Read-Only-HTTP-Enforcement.md`](./governance/project-docs/adr/ADR-20260421-Read-Only-HTTP-Enforcement.md).
|
|
25
|
+
|
|
26
|
+
Verify any time:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm run test:readonly
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Tools (36)
|
|
35
|
+
|
|
36
|
+
| Domain | Tools |
|
|
37
|
+
|---|---|
|
|
38
|
+
| **Discovery** (6) | `meta_token_inspect`, `meta_health_check`, `meta_graph_read`, `meta_business_list`, `meta_business_list_assets`, `meta_business_list_system_users` |
|
|
39
|
+
| **Ads / Marketing API** (8) | `meta_ads_list_accounts`, `meta_ads_get_account`, `meta_ads_list_campaigns`, `meta_ads_list_adsets`, `meta_ads_list_ads`, `meta_ads_get_insights` ⭐, `meta_ads_get_creative`, `meta_ads_list_custom_audiences` |
|
|
40
|
+
| **Pages** (7) | `meta_page_list`, `meta_page_get`, `meta_page_list_posts`, `meta_page_get_post_insights`, `meta_page_get_insights`, `meta_page_list_reviews`, `meta_page_list_videos` |
|
|
41
|
+
| **Instagram** (5) | `meta_ig_list_accounts`, `meta_ig_get_account`, `meta_ig_list_media`, `meta_ig_get_media_insights`, `meta_ig_get_audience_demographics` |
|
|
42
|
+
| **Pixels** (2) | `meta_pixel_list`, `meta_pixel_get_stats` |
|
|
43
|
+
| **Catalog** (3) | `meta_catalog_list`, `meta_catalog_list_products`, `meta_catalog_get_diagnostics` |
|
|
44
|
+
| **WhatsApp** (4) | `meta_whatsapp_list_wabas`, `meta_whatsapp_list_phone_numbers`, `meta_whatsapp_list_templates`, `meta_whatsapp_get_analytics` |
|
|
45
|
+
| **Eagle's-eye** (1) | `meta_business_overview` ⭐⭐⭐ — single-call consolidated snapshot across the whole business |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Quickstart
|
|
50
|
+
|
|
51
|
+
### 1. Install
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git clone git@github.com:feladeveloper/meta-mcp-server.git
|
|
55
|
+
cd meta-mcp-server
|
|
56
|
+
npm install
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 2. Configure environment
|
|
60
|
+
|
|
61
|
+
Copy `.env.example` → `.env` and fill in:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
META_ACCESS_TOKEN=... # System-user token (see Token Provisioning below)
|
|
65
|
+
META_APP_SECRET=... # App secret of the app that issued the token (Hodusoft app: 193481170220592)
|
|
66
|
+
META_API_VERSION=v23.0
|
|
67
|
+
META_CACHE_TTL_SECONDS=120
|
|
68
|
+
META_MAX_AUTO_PAGES=5
|
|
69
|
+
LOG_LEVEL=info
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Optional allowlists (if set, the server refuses to operate on IDs outside the allowlist):
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
META_ALLOWED_BUSINESS_IDS=133767790806312
|
|
76
|
+
META_ALLOWED_AD_ACCOUNT_IDS=act_146517954996436,...
|
|
77
|
+
META_ALLOWED_PAGE_IDS=138368686823692,...
|
|
78
|
+
META_ALLOWED_IG_USER_IDS=17841406467396631,...
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 3. Build and run
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm run build
|
|
85
|
+
node dist/index.js # stdio MCP server
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Or in development:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm run dev
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
For an MCP Inspector session against the built server:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npm run inspect
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 4. Wire into a client
|
|
101
|
+
|
|
102
|
+
Example (Claude Desktop or any MCP client) — fetches the published package on demand via `npx`:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"mcpServers": {
|
|
107
|
+
"meta": {
|
|
108
|
+
"command": "npx",
|
|
109
|
+
"args": ["-y", "@cashtokenai/meta-mcp-server"],
|
|
110
|
+
"env": {
|
|
111
|
+
"META_ACCESS_TOKEN": "...",
|
|
112
|
+
"META_APP_SECRET": "..."
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
For a global install (`npm install -g @cashtokenai/meta-mcp-server`), use the bin directly:
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"mcpServers": {
|
|
124
|
+
"meta": {
|
|
125
|
+
"command": "meta-business-manager-mcp-server",
|
|
126
|
+
"env": {
|
|
127
|
+
"META_ACCESS_TOKEN": "...",
|
|
128
|
+
"META_APP_SECRET": "..."
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
For local development against a clone of this repo:
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"mcpServers": {
|
|
140
|
+
"meta": {
|
|
141
|
+
"command": "node",
|
|
142
|
+
"args": ["/absolute/path/to/meta-mcp-server/dist/index.js"],
|
|
143
|
+
"env": {
|
|
144
|
+
"META_ACCESS_TOKEN": "...",
|
|
145
|
+
"META_APP_SECRET": "..."
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Token Provisioning (Cashtoken-specific)
|
|
155
|
+
|
|
156
|
+
The system user `AI_Insights_Reader` (id `122093391782492654`) under the `Hodusoft` business (id `133767790806312`) is the canonical identity for this server. Procedure to issue / rotate its token:
|
|
157
|
+
|
|
158
|
+
1. Business Settings → System Users → `AI_Insights_Reader` → **Generate New Token**
|
|
159
|
+
2. Pick the **Hodusoft** app (id `193481170220592`)
|
|
160
|
+
3. In the scope picker, untick everything, then tick:
|
|
161
|
+
- `business_management`, `ads_management` (Meta only exposes management here; server still blocks writes), `pages_read_engagement`, `pages_read_user_content`, `read_insights`, `instagram_basic`, `instagram_manage_insights`, `whatsapp_business_management`, `catalog_management`
|
|
162
|
+
4. Copy the token (Meta only shows it once)
|
|
163
|
+
5. Paste over `META_ACCESS_TOKEN` in `.env`
|
|
164
|
+
6. Verify with `meta_health_check` and `meta_token_inspect`
|
|
165
|
+
|
|
166
|
+
Token TTL is ~60 days. Set a calendar reminder; rotation procedure documented in [`/governance/project-docs/runbook.md`](./governance/project-docs/runbook.md).
|
|
167
|
+
|
|
168
|
+
See also: [`ADR-20260421-System-User-Token-Pattern.md`](./governance/project-docs/adr/ADR-20260421-System-User-Token-Pattern.md).
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Repository layout
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
meta-mcp-server/
|
|
176
|
+
├── CLAUDE.md # AI agent rules (governance)
|
|
177
|
+
├── .cursorrules # Cursor agent rules
|
|
178
|
+
├── .github/
|
|
179
|
+
│ ├── copilot-instructions.md # Copilot agent rules
|
|
180
|
+
│ ├── ISSUE_TEMPLATE/
|
|
181
|
+
│ └── workflows/ # CI/CD (GitHub Actions, Sentinel status check)
|
|
182
|
+
├── .claude/skills/ # 23 governance skills (scaffolding, review, git-ops, …)
|
|
183
|
+
├── .sentinelrc # Sentinel governance plugin config
|
|
184
|
+
├── CHANGELOG.md # SemVer release history
|
|
185
|
+
├── README.md
|
|
186
|
+
├── governance/ # Governance assets — see /governance/standards/
|
|
187
|
+
│ ├── standards/ # SDGP policies, coding standards
|
|
188
|
+
│ ├── templates/ # Doc templates (specs, ADRs, deviations, project docs)
|
|
189
|
+
│ └── project-docs/ # Project documents
|
|
190
|
+
│ ├── 1-vision-doc.md
|
|
191
|
+
│ ├── 2-brd.md
|
|
192
|
+
│ ├── 3-prd.md
|
|
193
|
+
│ ├── 5-tad.md
|
|
194
|
+
│ ├── runbook.md
|
|
195
|
+
│ ├── solution-doc-architecture.md
|
|
196
|
+
│ ├── specs/ # Feature specs
|
|
197
|
+
│ ├── adr/ # Architecture Decision Records
|
|
198
|
+
│ └── deviations/ # Governance deviation logs
|
|
199
|
+
├── src/ # Implementation (see TAD)
|
|
200
|
+
│ ├── index.ts # stdio entrypoint
|
|
201
|
+
│ ├── server.ts # MCP server wiring
|
|
202
|
+
│ ├── config.ts # env + allowlists
|
|
203
|
+
│ ├── errors.ts # MetaError, ReadOnlyViolationError
|
|
204
|
+
│ ├── logger.ts # pino, stderr only, redacts secrets
|
|
205
|
+
│ ├── constants.ts
|
|
206
|
+
│ ├── context.ts
|
|
207
|
+
│ ├── helpers/
|
|
208
|
+
│ │ ├── graph-client.ts # GET-only axios client + retry + cache + appsecret_proof
|
|
209
|
+
│ │ ├── cache.ts # LRU TTL cache
|
|
210
|
+
│ │ ├── format.ts # JSON / Markdown response formatting
|
|
211
|
+
│ │ └── schema.ts # Shared Zod shapes (pagination, date presets, IDs)
|
|
212
|
+
│ ├── tools/ # 36 tool implementations grouped by domain
|
|
213
|
+
│ │ ├── token/ meta/ business/ ads/ pages/ instagram/ pixels/ catalog/ whatsapp/ overview/
|
|
214
|
+
│ │ ├── shared.ts # runList / runGet / errorResult helpers
|
|
215
|
+
│ │ └── register.ts # Centralized tool registration
|
|
216
|
+
│ └── types/
|
|
217
|
+
└── tests/
|
|
218
|
+
└── read-only-guard.mjs # Runtime proof that POST/PUT/PATCH/DELETE are blocked
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Governance
|
|
224
|
+
|
|
225
|
+
This project is initialized from the [`cashtokenrewards/project-governance-template`](https://github.com/cashtokenrewards/project-governance-template) and follows the **Software Development Governance Policy (SDGP)** in [`/governance/standards/sdgp-main.md`](./governance/standards/sdgp-main.md).
|
|
226
|
+
|
|
227
|
+
**Three absolute rules:**
|
|
228
|
+
1. No feature is built without an approved spec. ([`/governance/project-docs/specs/`](./governance/project-docs/specs/))
|
|
229
|
+
2. No ADR is written without a parent feature spec. ([`/governance/project-docs/adr/`](./governance/project-docs/adr/))
|
|
230
|
+
3. No implementation begins without the spec and all required ADRs approved.
|
|
231
|
+
|
|
232
|
+
The current implementation (commit zero) was bootstrapped against an initial pass of governance docs:
|
|
233
|
+
|
|
234
|
+
| Doc | Path |
|
|
235
|
+
|---|---|
|
|
236
|
+
| Vision | [`governance/project-docs/1-vision-doc.md`](./governance/project-docs/1-vision-doc.md) |
|
|
237
|
+
| BRD | [`governance/project-docs/2-brd.md`](./governance/project-docs/2-brd.md) |
|
|
238
|
+
| PRD | [`governance/project-docs/3-prd.md`](./governance/project-docs/3-prd.md) |
|
|
239
|
+
| TAD | [`governance/project-docs/5-tad.md`](./governance/project-docs/5-tad.md) |
|
|
240
|
+
| Runbook | [`governance/project-docs/runbook.md`](./governance/project-docs/runbook.md) |
|
|
241
|
+
| Meta setup runbook | [`governance/project-docs/runbook-meta-setup.md`](./governance/project-docs/runbook-meta-setup.md) |
|
|
242
|
+
| Add-a-business runbook | [`governance/project-docs/runbook-add-business.md`](./governance/project-docs/runbook-add-business.md) |
|
|
243
|
+
| Specs | [`governance/project-docs/specs/`](./governance/project-docs/specs/) |
|
|
244
|
+
| ADRs | [`governance/project-docs/adr/`](./governance/project-docs/adr/) |
|
|
245
|
+
| Deviations | [`governance/project-docs/deviations/`](./governance/project-docs/deviations/) |
|
|
246
|
+
|
|
247
|
+
**Branch model:** Gitflow. `main` (production), `dev` (integration). Short-lived branches: `feature-`, `fix-`, `release-`, `hotfix-`, `docs-`. All merges `--no-ff`. See [`/governance/standards/sdgp-main.md`](./governance/standards/sdgp-main.md) §7.4.
|
|
248
|
+
|
|
249
|
+
**AI agent rules:** [`CLAUDE.md`](./CLAUDE.md), [`.cursorrules`](./.cursorrules), [`.github/copilot-instructions.md`](./.github/copilot-instructions.md). Sentinel keeps these in sync with the central governance config.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Sentinel
|
|
254
|
+
|
|
255
|
+
This repository is tracked by the [Sentinel governance plugin](https://github.com/feladeveloper/sentinel-claude-plugin). Configuration lives at [`.sentinelrc`](./.sentinelrc). On any clone:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
export SENTINEL_GITHUB_TOKEN="ghp_..." # Personal access token with repo:read
|
|
259
|
+
sentinel sync # Pull latest org-level governance into CLAUDE.md
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
`/sentinel-sync` and `/sentinel-status` slash commands are also available inside Claude Code once the plugin is installed.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Scripts
|
|
267
|
+
|
|
268
|
+
| Script | What it does |
|
|
269
|
+
|---|---|
|
|
270
|
+
| `npm run build` | Clean + compile TypeScript → `dist/` |
|
|
271
|
+
| `npm run dev` | Run with `tsx` (no build step) |
|
|
272
|
+
| `npm run start` | Run built `dist/index.js` |
|
|
273
|
+
| `npm run inspect` | Build + open MCP Inspector |
|
|
274
|
+
| `npm run check:types` | `tsc --noEmit` |
|
|
275
|
+
| `npm run test:readonly` | Build + runtime proof that POST/PUT/PATCH/DELETE are blocked by the Graph client |
|
|
276
|
+
| `npm test` | (placeholder for jest suite — see [`SPEC-07-eval-suite.md`](./governance/project-docs/specs/) when added) |
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Status
|
|
281
|
+
|
|
282
|
+
| Aspect | State |
|
|
283
|
+
|---|---|
|
|
284
|
+
| Implementation | **v0.1.0 — bootstrapped, 36 tools, build clean, read-only guard verified** |
|
|
285
|
+
| Governance docs | Initial pass — Vision / BRD / PRD / TAD / Runbook / 3 ADRs / 1 deviation drafted |
|
|
286
|
+
| App-level (Meta) | Hodusoft app in **development tier** for Marketing API. Standard Access via App Review pending. |
|
|
287
|
+
| Asset coverage | All 3 Pages discoverable; 1 Page (CashToken) currently assigned to AI_Insights_Reader; 5 ad accounts visible; 3 Pixels visible; 1 IG (cashtokenhq) discovered via Page link |
|
|
288
|
+
| Open scopes | `read_insights`, `instagram_manage_insights`, `whatsapp_business_management`, `catalog_management` may need to be added to the Hodusoft app before they appear in the token picker |
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## License
|
|
293
|
+
|
|
294
|
+
MIT — see [LICENSE](./LICENSE).
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface Config {
|
|
2
|
+
accessToken: string;
|
|
3
|
+
appSecret: string | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Optional secondary "insights app" credentials. Meta's app-type rules
|
|
6
|
+
* forbid combining the Marketing-API use case with the Instagram-content /
|
|
7
|
+
* Pages-everything use cases on a single app. When insights endpoints
|
|
8
|
+
* (IG media/audience insights, Page/post insights) live on a *different*
|
|
9
|
+
* Meta app than the primary (ads) app, set these so those specific calls
|
|
10
|
+
* route through the second app's token + secret. Leave unset to use the
|
|
11
|
+
* primary token for everything (single-app deployments).
|
|
12
|
+
*/
|
|
13
|
+
insightsAccessToken: string | undefined;
|
|
14
|
+
insightsAppSecret: string | undefined;
|
|
15
|
+
apiVersion: string;
|
|
16
|
+
httpTimeoutMs: number;
|
|
17
|
+
cacheTtlSeconds: number;
|
|
18
|
+
maxAutoPages: number;
|
|
19
|
+
allowedBusinessIds: Set<string> | null;
|
|
20
|
+
allowedAdAccountIds: Set<string> | null;
|
|
21
|
+
allowedPageIds: Set<string> | null;
|
|
22
|
+
allowedIgUserIds: Set<string> | null;
|
|
23
|
+
logLevel: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Credentials for a single Meta app: an access token plus the app secret used
|
|
27
|
+
* to compute the request's `appsecret_proof`. Returned by `insightsCreds()`.
|
|
28
|
+
*/
|
|
29
|
+
export interface AppCreds {
|
|
30
|
+
token: string;
|
|
31
|
+
appSecret: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns the secondary insights-app credentials when configured, otherwise
|
|
35
|
+
* null. Insight tools call this; null means "fall back to the primary token".
|
|
36
|
+
*/
|
|
37
|
+
export declare function insightsCreds(config: Config): AppCreds | null;
|
|
38
|
+
export declare function loadConfig(): Config;
|
|
39
|
+
export declare function assertAllowed(kind: "business" | "ad_account" | "page" | "ig_user", id: string, config: Config): void;
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { DEFAULT_API_VERSION } from "./constants.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the secondary insights-app credentials when configured, otherwise
|
|
4
|
+
* null. Insight tools call this; null means "fall back to the primary token".
|
|
5
|
+
*/
|
|
6
|
+
export function insightsCreds(config) {
|
|
7
|
+
if (!config.insightsAccessToken)
|
|
8
|
+
return null;
|
|
9
|
+
return {
|
|
10
|
+
token: config.insightsAccessToken,
|
|
11
|
+
appSecret: config.insightsAppSecret,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function parseAllowlist(raw) {
|
|
15
|
+
if (!raw || !raw.trim())
|
|
16
|
+
return null;
|
|
17
|
+
const items = raw
|
|
18
|
+
.split(",")
|
|
19
|
+
.map((s) => s.trim())
|
|
20
|
+
.filter(Boolean);
|
|
21
|
+
return items.length ? new Set(items) : null;
|
|
22
|
+
}
|
|
23
|
+
function parseNumber(raw, fallback) {
|
|
24
|
+
if (raw == null || raw === "")
|
|
25
|
+
return fallback;
|
|
26
|
+
const parsed = Number(raw);
|
|
27
|
+
return Number.isFinite(parsed) ? parsed : fallback;
|
|
28
|
+
}
|
|
29
|
+
export function loadConfig() {
|
|
30
|
+
const accessToken = process.env.META_ACCESS_TOKEN?.trim();
|
|
31
|
+
if (!accessToken) {
|
|
32
|
+
throw new Error("META_ACCESS_TOKEN is required. Set it in the environment or .env file.");
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
accessToken,
|
|
36
|
+
appSecret: process.env.META_APP_SECRET?.trim() || undefined,
|
|
37
|
+
insightsAccessToken: process.env.META_INSIGHTS_ACCESS_TOKEN?.trim() || undefined,
|
|
38
|
+
insightsAppSecret: process.env.META_INSIGHTS_APP_SECRET?.trim() || undefined,
|
|
39
|
+
apiVersion: process.env.META_API_VERSION?.trim() || DEFAULT_API_VERSION,
|
|
40
|
+
httpTimeoutMs: parseNumber(process.env.META_HTTP_TIMEOUT_MS, 30_000),
|
|
41
|
+
cacheTtlSeconds: parseNumber(process.env.META_CACHE_TTL_SECONDS, 120),
|
|
42
|
+
maxAutoPages: parseNumber(process.env.META_MAX_AUTO_PAGES, 5),
|
|
43
|
+
allowedBusinessIds: parseAllowlist(process.env.META_ALLOWED_BUSINESS_IDS),
|
|
44
|
+
allowedAdAccountIds: parseAllowlist(process.env.META_ALLOWED_AD_ACCOUNT_IDS),
|
|
45
|
+
allowedPageIds: parseAllowlist(process.env.META_ALLOWED_PAGE_IDS),
|
|
46
|
+
allowedIgUserIds: parseAllowlist(process.env.META_ALLOWED_IG_USER_IDS),
|
|
47
|
+
logLevel: process.env.LOG_LEVEL?.trim() || "info",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export function assertAllowed(kind, id, config) {
|
|
51
|
+
const allowlist = {
|
|
52
|
+
business: config.allowedBusinessIds,
|
|
53
|
+
ad_account: config.allowedAdAccountIds,
|
|
54
|
+
page: config.allowedPageIds,
|
|
55
|
+
ig_user: config.allowedIgUserIds,
|
|
56
|
+
}[kind];
|
|
57
|
+
if (allowlist && !allowlist.has(id)) {
|
|
58
|
+
throw new Error(`${kind} '${id}' is not in the configured META_ALLOWED_${kind.toUpperCase()}_IDS allowlist.`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const GRAPH_BASE_URL = "https://graph.facebook.com";
|
|
2
|
+
export declare const DEFAULT_API_VERSION = "v23.0";
|
|
3
|
+
export declare const CHARACTER_LIMIT = 25000;
|
|
4
|
+
export declare const DEFAULT_PAGE_LIMIT = 25;
|
|
5
|
+
export declare const MAX_PAGE_LIMIT = 500;
|
|
6
|
+
export declare const SERVER_NAME = "meta-business-manager-mcp-server";
|
|
7
|
+
export declare const SERVER_VERSION = "0.1.12";
|
|
8
|
+
export declare const META_ERROR_CODES: {
|
|
9
|
+
readonly UNKNOWN: 1;
|
|
10
|
+
readonly SERVICE_TEMPORARILY_UNAVAILABLE: 2;
|
|
11
|
+
readonly APPLICATION_LIMIT_REACHED: 4;
|
|
12
|
+
readonly USER_REQUEST_LIMIT_REACHED: 17;
|
|
13
|
+
readonly PAGE_LIMIT_REACHED: 32;
|
|
14
|
+
readonly AD_ACCOUNT_THROTTLED: 613;
|
|
15
|
+
readonly INVALID_ACCESS_TOKEN: 190;
|
|
16
|
+
readonly PERMISSION_DENIED: 10;
|
|
17
|
+
readonly REQUIRES_REVIEW_PERMISSION: 200;
|
|
18
|
+
};
|
|
19
|
+
export declare const RETRYABLE_META_CODES: Set<number>;
|
|
20
|
+
export declare const MAX_RETRIES = 3;
|
|
21
|
+
export declare const BASE_RETRY_DELAY_MS = 1000;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const GRAPH_BASE_URL = "https://graph.facebook.com";
|
|
2
|
+
export const DEFAULT_API_VERSION = "v23.0";
|
|
3
|
+
export const CHARACTER_LIMIT = 25_000;
|
|
4
|
+
export const DEFAULT_PAGE_LIMIT = 25;
|
|
5
|
+
export const MAX_PAGE_LIMIT = 500;
|
|
6
|
+
export const SERVER_NAME = "meta-business-manager-mcp-server";
|
|
7
|
+
export const SERVER_VERSION = "0.1.12";
|
|
8
|
+
export const META_ERROR_CODES = {
|
|
9
|
+
UNKNOWN: 1,
|
|
10
|
+
SERVICE_TEMPORARILY_UNAVAILABLE: 2,
|
|
11
|
+
APPLICATION_LIMIT_REACHED: 4,
|
|
12
|
+
USER_REQUEST_LIMIT_REACHED: 17,
|
|
13
|
+
PAGE_LIMIT_REACHED: 32,
|
|
14
|
+
AD_ACCOUNT_THROTTLED: 613,
|
|
15
|
+
INVALID_ACCESS_TOKEN: 190,
|
|
16
|
+
PERMISSION_DENIED: 10,
|
|
17
|
+
REQUIRES_REVIEW_PERMISSION: 200,
|
|
18
|
+
};
|
|
19
|
+
export const RETRYABLE_META_CODES = new Set([
|
|
20
|
+
META_ERROR_CODES.UNKNOWN,
|
|
21
|
+
META_ERROR_CODES.SERVICE_TEMPORARILY_UNAVAILABLE,
|
|
22
|
+
META_ERROR_CODES.APPLICATION_LIMIT_REACHED,
|
|
23
|
+
META_ERROR_CODES.USER_REQUEST_LIMIT_REACHED,
|
|
24
|
+
META_ERROR_CODES.PAGE_LIMIT_REACHED,
|
|
25
|
+
META_ERROR_CODES.AD_ACCOUNT_THROTTLED,
|
|
26
|
+
]);
|
|
27
|
+
export const MAX_RETRIES = 3;
|
|
28
|
+
export const BASE_RETRY_DELAY_MS = 1000;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Config } from "./config.js";
|
|
2
|
+
import { GraphClient } from "./helpers/graph-client.js";
|
|
3
|
+
import type { Logger } from "./logger.js";
|
|
4
|
+
export interface ToolContext {
|
|
5
|
+
config: Config;
|
|
6
|
+
graph: GraphClient;
|
|
7
|
+
logger: Logger;
|
|
8
|
+
}
|
|
9
|
+
export declare function createContext(config: Config, logger: Logger): ToolContext;
|
package/dist/context.js
ADDED
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface MetaApiError {
|
|
2
|
+
message: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
code?: number;
|
|
5
|
+
error_subcode?: number;
|
|
6
|
+
fbtrace_id?: string;
|
|
7
|
+
error_user_title?: string;
|
|
8
|
+
error_user_msg?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class MetaError extends Error {
|
|
11
|
+
readonly code: number | undefined;
|
|
12
|
+
readonly subcode: number | undefined;
|
|
13
|
+
readonly fbtraceId: string | undefined;
|
|
14
|
+
readonly type: string | undefined;
|
|
15
|
+
readonly httpStatus: number | undefined;
|
|
16
|
+
readonly retryable: boolean;
|
|
17
|
+
readonly hint: string;
|
|
18
|
+
constructor(message: string, opts?: {
|
|
19
|
+
code?: number;
|
|
20
|
+
subcode?: number;
|
|
21
|
+
fbtraceId?: string;
|
|
22
|
+
type?: string;
|
|
23
|
+
httpStatus?: number;
|
|
24
|
+
hint?: string;
|
|
25
|
+
});
|
|
26
|
+
toJSON(): {
|
|
27
|
+
error: string;
|
|
28
|
+
message: string;
|
|
29
|
+
code: number | undefined;
|
|
30
|
+
subcode: number | undefined;
|
|
31
|
+
type: string | undefined;
|
|
32
|
+
fbtrace_id: string | undefined;
|
|
33
|
+
http_status: number | undefined;
|
|
34
|
+
retryable: boolean;
|
|
35
|
+
hint: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export declare function normalizeAxiosError(err: unknown): MetaError;
|
|
39
|
+
export declare class ReadOnlyViolationError extends Error {
|
|
40
|
+
constructor(method: string, url: string);
|
|
41
|
+
}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { RETRYABLE_META_CODES } from "./constants.js";
|
|
2
|
+
export class MetaError extends Error {
|
|
3
|
+
code;
|
|
4
|
+
subcode;
|
|
5
|
+
fbtraceId;
|
|
6
|
+
type;
|
|
7
|
+
httpStatus;
|
|
8
|
+
retryable;
|
|
9
|
+
hint;
|
|
10
|
+
constructor(message, opts = {}) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = "MetaError";
|
|
13
|
+
this.code = opts.code;
|
|
14
|
+
this.subcode = opts.subcode;
|
|
15
|
+
this.fbtraceId = opts.fbtraceId;
|
|
16
|
+
this.type = opts.type;
|
|
17
|
+
this.httpStatus = opts.httpStatus;
|
|
18
|
+
this.retryable = opts.code != null && RETRYABLE_META_CODES.has(opts.code);
|
|
19
|
+
this.hint = opts.hint ?? deriveHint(opts.code, opts.subcode, opts.httpStatus, message);
|
|
20
|
+
}
|
|
21
|
+
toJSON() {
|
|
22
|
+
return {
|
|
23
|
+
error: "MetaError",
|
|
24
|
+
message: this.message,
|
|
25
|
+
code: this.code,
|
|
26
|
+
subcode: this.subcode,
|
|
27
|
+
type: this.type,
|
|
28
|
+
fbtrace_id: this.fbtraceId,
|
|
29
|
+
http_status: this.httpStatus,
|
|
30
|
+
retryable: this.retryable,
|
|
31
|
+
hint: this.hint,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function deriveHint(code, subcode, httpStatus, message) {
|
|
36
|
+
if (code === 190) {
|
|
37
|
+
if (subcode === 463)
|
|
38
|
+
return "Access token has expired. Generate a new system-user token.";
|
|
39
|
+
if (subcode === 467)
|
|
40
|
+
return "Access token is invalid. Re-issue from Business Settings → System Users.";
|
|
41
|
+
return "Access token error. Check META_ACCESS_TOKEN is valid and tied to the correct app.";
|
|
42
|
+
}
|
|
43
|
+
if (code === 10) {
|
|
44
|
+
// Code 10 splits into two distinct operator actions, distinguishable by the
|
|
45
|
+
// exact Meta error message — surface the right one so AI consumers can
|
|
46
|
+
// direct the user accurately.
|
|
47
|
+
if (message && /Application does not have permission/i.test(message)) {
|
|
48
|
+
return "App-level permission missing. The configured app needs Standard Access via Meta App Review for the relevant permission (e.g. instagram_manage_insights, ads_management). Request via App Review → Permissions and Features in the app dashboard. While in development tier, only developer/admin users on the app can read this data.";
|
|
49
|
+
}
|
|
50
|
+
if (message && /Page Public Content Access/i.test(message)) {
|
|
51
|
+
return "App needs the 'Page Public Content Access' feature, granted via Meta App Review. Until approved, pages_read_engagement on Pages outside the app's developer/test set will fail. Path: App Dashboard → App Review → Features.";
|
|
52
|
+
}
|
|
53
|
+
return "App-level permission denied (code 10). Either the configured app lacks the required permission/feature in App Review, or the system user is not assigned to the target asset with the right task in Business Settings.";
|
|
54
|
+
}
|
|
55
|
+
if (code === 200) {
|
|
56
|
+
if (message && /pages_read_user_content/i.test(message)) {
|
|
57
|
+
return "Token lacks 'pages_read_user_content'. Regenerate the system-user token in Business Settings → System Users → Generate New Token, ticking that scope.";
|
|
58
|
+
}
|
|
59
|
+
if (message && /This application has not been approved/i.test(message)) {
|
|
60
|
+
return "App not approved for this product. Add the relevant Product (e.g. WhatsApp Business Platform, Commerce / Catalog Management) to the app in https://developers.facebook.com/apps and complete its onboarding.";
|
|
61
|
+
}
|
|
62
|
+
return "Permission denied. Verify the system user is assigned to the target asset (Business Settings → System Users → Add Assets) with the right task, and the token has the matching scope.";
|
|
63
|
+
}
|
|
64
|
+
if (code === 283) {
|
|
65
|
+
return "Token lacks the scope needed for this Page action (typically pages_read_user_content for reviews, or pages_read_engagement for posts). Regenerate the token with the required scope ticked.";
|
|
66
|
+
}
|
|
67
|
+
if (code === 4 || code === 17 || code === 32) {
|
|
68
|
+
return "Rate-limited by Meta. Retry with backoff or narrow the query (shorter date range, fewer breakdowns).";
|
|
69
|
+
}
|
|
70
|
+
if (code === 613) {
|
|
71
|
+
return "Ad account throttled. Reduce insight query complexity or wait before retrying.";
|
|
72
|
+
}
|
|
73
|
+
if (code === 210) {
|
|
74
|
+
return "This endpoint requires a Page access token, not the system-user token. The Page tools resolve this automatically — if you see this from meta_graph_read, fetch the token via GET /{page_id}?fields=access_token first.";
|
|
75
|
+
}
|
|
76
|
+
if (code === 12) {
|
|
77
|
+
return "Field deprecated by Meta. Remove the deprecated field from the `fields` array. Common offender: 'subattachments' inside attachments expansion (deprecated in v3.3+).";
|
|
78
|
+
}
|
|
79
|
+
if (code === 100) {
|
|
80
|
+
if (message && /must be a valid insights metric/i.test(message)) {
|
|
81
|
+
return "Either one of the supplied metrics is invalid for this Page/period combination, OR the token lacks 'read_insights' (Meta returns this misleading error in both cases). Check the token has read_insights via meta_token_inspect, then narrow your metrics list to a known-valid subset.";
|
|
82
|
+
}
|
|
83
|
+
return "Invalid parameter. Check field names, ID format (ad accounts need 'act_' prefix), and date presets.";
|
|
84
|
+
}
|
|
85
|
+
if (httpStatus === 404) {
|
|
86
|
+
return "Resource not found. Check the ID and that it is assigned to the configured system user.";
|
|
87
|
+
}
|
|
88
|
+
if (httpStatus === 403) {
|
|
89
|
+
return "Forbidden. The token lacks access to this asset — assign it via Business Settings.";
|
|
90
|
+
}
|
|
91
|
+
return "See https://developers.facebook.com/docs/graph-api/guides/error-handling/ for troubleshooting.";
|
|
92
|
+
}
|
|
93
|
+
export function normalizeAxiosError(err) {
|
|
94
|
+
const axiosErr = err;
|
|
95
|
+
if (axiosErr?.isAxiosError) {
|
|
96
|
+
const apiErr = axiosErr.response?.data?.error;
|
|
97
|
+
if (apiErr) {
|
|
98
|
+
return new MetaError(apiErr.message, {
|
|
99
|
+
code: apiErr.code,
|
|
100
|
+
subcode: apiErr.error_subcode,
|
|
101
|
+
fbtraceId: apiErr.fbtrace_id,
|
|
102
|
+
type: apiErr.type,
|
|
103
|
+
httpStatus: axiosErr.response?.status,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const status = axiosErr.response?.status;
|
|
107
|
+
return new MetaError(axiosErr.message || "HTTP request failed", {
|
|
108
|
+
httpStatus: status,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (err instanceof Error)
|
|
112
|
+
return new MetaError(err.message);
|
|
113
|
+
return new MetaError(String(err));
|
|
114
|
+
}
|
|
115
|
+
export class ReadOnlyViolationError extends Error {
|
|
116
|
+
constructor(method, url) {
|
|
117
|
+
super(`Refusing ${method} ${url}: this MCP server is read-only. Only GET requests are permitted by the Graph client.`);
|
|
118
|
+
this.name = "ReadOnlyViolationError";
|
|
119
|
+
}
|
|
120
|
+
}
|