@fload-ai/mcp 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -1,359 +1,80 @@
1
- # @fload/mcp
1
+ # @fload-ai/mcp
2
2
 
3
- **Fload MCP Server** - Model Context Protocol server for AI agents to access Fload's mobile app analytics, reviews, and growth insights.
3
+ MCP server for Fload — gives AI assistants access to your mobile app analytics, reviews, growth metrics, and more.
4
4
 
5
- ## What is MCP?
5
+ ## Quick Start
6
6
 
7
- [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open standard by Anthropic that enables AI applications to securely connect to data sources and tools. This package implements an MCP server that exposes Fload's mobile analytics capabilities to AI agents like Claude, ChatGPT, and custom AI tools.
7
+ ### 1. Get your API key
8
8
 
9
- ## Features
9
+ Go to [platform.fload.com](https://platform.fload.com/settings/api-keys) > Settings > API Keys > Create Key.
10
10
 
11
- - **🎯 Core Tools (Phase 1)**
12
- - `list_apps` - List all apps in your organization
13
- - `get_app_details` - Get detailed app information
14
- - `get_reviews` - Query reviews with flexible filters
15
- - `get_analytics_summary` - Get metric summaries with timeseries data
11
+ ### 2. Add to Claude Desktop
16
12
 
17
- - **🔒 Authentication**
18
- - API key-based authentication
19
- - Organization-scoped access
20
- - Secure credential management
21
-
22
- - **🚀 Fast & Reliable**
23
- - Direct database queries (Drizzle ORM)
24
- - TimescaleDB for analytics
25
- - Optimized for AI agent workflows
26
-
27
- ## Installation
28
-
29
- ### From Monorepo (Development)
30
-
31
- ```bash
32
- cd ~/www/fload
33
- pnpm install
34
- pnpm build
35
- ```
36
-
37
- ### From NPM (Production)
38
-
39
- ```bash
40
- npm install -g @fload/mcp
41
- # or
42
- npx @fload/mcp
43
- ```
44
-
45
- ## Setup
46
-
47
- ### 1. Generate API Key
48
-
49
- 🚧 **Coming Soon:** API key management UI in Fload web app.
50
-
51
- For now, contact your Fload admin to generate an API key.
52
-
53
- ### 2. Configure Environment
54
-
55
- **Option A: Environment Variables (Recommended)**
56
-
57
- ```bash
58
- export FLOAD_API_KEY=fload_sk_your_key_here
59
- export DATABASE_URL=postgresql://user:pass@host:port/fload
60
- ```
61
-
62
- **Option B: Config File**
63
-
64
- Create `~/.fload/config.json`:
65
-
66
- ```json
67
- {
68
- "apiKey": "fload_sk_your_key_here",
69
- "databaseUrl": "postgresql://user:pass@host:port/fload",
70
- "organizationId": "your-org-id"
71
- }
72
- ```
73
-
74
- ### 3. Test the Server
75
-
76
- ```bash
77
- # From monorepo
78
- pnpm --filter @fload/mcp dev
79
-
80
- # Or via npx
81
- npx @fload/mcp
82
- ```
83
-
84
- You should see:
85
- ```
86
- [Fload MCP] Starting server...
87
- [Fload MCP] Configuration loaded
88
- [Fload MCP] Database connected
89
- [Fload MCP] Server running on stdio
90
- ```
91
-
92
- ## Usage
93
-
94
- ### With Claude Desktop
95
-
96
- Add to your `claude_desktop_config.json`:
97
-
98
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
99
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
13
+ Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
100
14
 
101
15
  ```json
102
16
  {
103
17
  "mcpServers": {
104
18
  "fload": {
105
19
  "command": "npx",
106
- "args": ["@fload/mcp"],
20
+ "args": ["-y", "@fload-ai/mcp"],
107
21
  "env": {
108
- "FLOAD_API_KEY": "fload_sk_your_key_here",
109
- "DATABASE_URL": "postgresql://..."
22
+ "FLOAD_API_KEY": "fload_sk_your_key_here"
110
23
  }
111
24
  }
112
25
  }
113
26
  }
114
27
  ```
115
28
 
116
- Restart Claude Desktop, and you'll see the Fload tools available!
117
-
118
- ### With Custom MCP Client
119
-
120
- ```typescript
121
- import { McpClient } from '@modelcontextprotocol/sdk/client/mcp.js';
122
- import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
29
+ Restart Claude Desktop. You'll see 16 Fload tools available.
123
30
 
124
- const client = new McpClient({
125
- name: 'my-client',
126
- version: '1.0.0',
127
- });
31
+ ### 3. Add the Fload skill (optional, recommended)
128
32
 
129
- const transport = new StdioClientTransport({
130
- command: 'npx',
131
- args: ['@fload/mcp'],
132
- env: {
133
- FLOAD_API_KEY: 'fload_sk_...',
134
- DATABASE_URL: 'postgresql://...',
135
- },
136
- });
33
+ The Fload skill teaches your AI agent how to use Fload tools effectively — common workflows, tips, and best practices.
137
34
 
138
- await client.connect(transport);
139
-
140
- // List apps
141
- const result = await client.callTool('list_apps', { limit: 10 });
142
- console.log(result);
143
- ```
144
-
145
- ## Tools Reference
146
-
147
- ### `list_apps`
148
-
149
- List all mobile apps in your organization.
150
-
151
- **Input:**
152
- ```typescript
153
- {
154
- platform?: 'ios' | 'android', // Filter by platform
155
- limit?: number // Max results (1-100, default: 50)
156
- }
157
- ```
158
-
159
- **Output:**
160
- ```json
161
- {
162
- "total": 2,
163
- "apps": [
164
- {
165
- "id": "uuid",
166
- "name": "My Awesome App",
167
- "bundleId": "com.example.app",
168
- "platform": "ios",
169
- "iconUrl": "https://...",
170
- "category": "Games",
171
- "addedAt": "2024-01-15T10:30:00Z"
172
- }
173
- ]
174
- }
35
+ ```bash
36
+ npx skills add fload-ai/mcp --skill fload
175
37
  ```
176
38
 
177
- ### `get_app_details`
39
+ Works with Claude Code, Cursor, Cline, GitHub Copilot, and [18+ other agents](https://skills.sh).
178
40
 
179
- Get detailed information about a specific app.
41
+ ## Tools
180
42
 
181
- **Input:**
182
- ```typescript
183
- {
184
- assetId?: string, // App UUID (provide either this or bundleId)
185
- bundleId?: string // App bundle ID
186
- }
187
- ```
188
-
189
- **Output:** Full app metadata + connected data sources + sync status
43
+ | Tool | Description |
44
+ |------|-------------|
45
+ | `list_apps` | List all apps in your organization |
46
+ | `get_app_details` | Get detailed app info by ID or bundle ID |
47
+ | `get_reviews` | Get reviews with filtering (rating, date, platform) |
48
+ | `get_analytics_summary` | Metric timeseries (downloads, revenue, users, etc.) |
49
+ | `list_agents` | List AI agents (review, monitoring, growth, etc.) |
50
+ | `get_agent_details` | Get agent config for a specific app |
51
+ | `get_agent_run_history` | Agent execution history |
52
+ | `get_anomalies` | Detected metric anomalies (surges/declines) |
53
+ | `get_ads_performance` | Ad campaign data (ASA, Google, Meta, TikTok) |
54
+ | `get_growth_audit` | Comprehensive growth assessment |
55
+ | `get_growth_score` | 0-100 growth score with grade |
56
+ | `get_forecasts` | Valuation forecasts and trend analysis |
57
+ | `get_dashboard_overview` | Organization portfolio overview |
58
+ | `list_pending_actions` | Pending AI-generated review replies |
59
+ | `approve_action` | Approve a pending review reply |
60
+ | `reject_action` | Reject a pending review reply |
190
61
 
191
- ### `get_reviews`
62
+ ## Configuration
192
63
 
193
- Get app reviews with flexible filtering.
64
+ | Variable | Required | Default | Description |
65
+ |----------|----------|---------|-------------|
66
+ | `FLOAD_API_KEY` | Yes | — | Your API key (`fload_sk_...`) |
67
+ | `FLOAD_API_URL` | No | `https://api.fload.com` | API URL (override for self-hosted) |
194
68
 
195
- **Input:**
196
- ```typescript
197
- {
198
- assetId?: string, // App UUID
199
- bundleId?: string, // App bundle ID
200
- platform?: 'ios' | 'android',
201
- rating?: 1 | 2 | 3 | 4 | 5, // Filter by star rating
202
- replied?: boolean, // Has reply?
203
- startDate?: string, // ISO date (YYYY-MM-DD)
204
- endDate?: string,
205
- limit?: number, // Max results (1-200, default: 50)
206
- sortBy?: 'date' | 'rating' // Sort order
207
- }
208
- ```
69
+ Or use `~/.fload/config.json`:
209
70
 
210
- **Output:**
211
71
  ```json
212
72
  {
213
- "summary": {
214
- "totalReviews": 25,
215
- "averageRating": "4.20",
216
- "repliedCount": 10,
217
- "unrepliedCount": 15
218
- },
219
- "reviews": [
220
- {
221
- "id": "uuid",
222
- "rating": 5,
223
- "title": "Great app!",
224
- "body": "Love the new features...",
225
- "author": "John Doe",
226
- "date": "2024-02-20T14:30:00Z",
227
- "version": "2.1.0",
228
- "country": "US",
229
- "hasReply": true,
230
- "reply": "Thank you for your feedback!",
231
- "replyDate": "2024-02-21T09:00:00Z"
232
- }
233
- ]
234
- }
235
- ```
236
-
237
- ### `get_analytics_summary`
238
-
239
- Get analytics summary with timeseries data.
240
-
241
- **Input:**
242
- ```typescript
243
- {
244
- assetId?: string,
245
- bundleId?: string,
246
- metric: 'downloads' | 'revenue' | 'active_users' | 'sessions' | 'retention' | 'crashes',
247
- period?: '7d' | '30d' | '90d', // Default: '30d'
248
- granularity?: 'day' | 'week' | 'month' // Default: 'day'
249
- }
250
- ```
251
-
252
- **Output:**
253
- ```json
254
- {
255
- "app": {
256
- "id": "uuid",
257
- "name": "My App",
258
- "bundleId": "com.example.app",
259
- "platform": "ios"
260
- },
261
- "metric": "downloads",
262
- "period": "30d",
263
- "dateRange": {
264
- "start": "2024-01-25",
265
- "end": "2024-02-25"
266
- },
267
- "summary": {
268
- "total": 125000,
269
- "average": 4167,
270
- "min": 3200,
271
- "max": 5800,
272
- "trend": "+12.5%"
273
- },
274
- "timeseries": [
275
- { "date": "2024-01-25", "value": 4200 },
276
- { "date": "2024-01-26", "value": 4350 }
277
- ]
73
+ "apiKey": "fload_sk_your_key_here",
74
+ "apiUrl": "https://api.fload.com"
278
75
  }
279
76
  ```
280
77
 
281
- ## Development
282
-
283
- ### Project Structure
284
-
285
- ```
286
- packages/fload-mcp/
287
- ├── src/
288
- │ ├── index.ts # Main entry point (STDIO)
289
- │ ├── server.ts # MCP server setup
290
- │ ├── config.ts # Configuration loading
291
- │ ├── auth.ts # API key validation
292
- │ ├── tools/ # Tool implementations
293
- │ │ ├── apps.ts
294
- │ │ ├── reviews.ts
295
- │ │ └── analytics.ts
296
- │ └── lib/
297
- │ ├── db-client.ts # Database connection
298
- │ └── format.ts # Response formatting
299
- ├── bin/
300
- │ └── fload-mcp.js # CLI executable
301
- └── package.json
302
- ```
303
-
304
- ### Build
305
-
306
- ```bash
307
- pnpm build
308
- ```
309
-
310
- ### Test
311
-
312
- ```bash
313
- pnpm test
314
- ```
315
-
316
- ### Typecheck
317
-
318
- ```bash
319
- pnpm typecheck
320
- ```
321
-
322
- ### Lint
323
-
324
- ```bash
325
- pnpm lint
326
- ```
327
-
328
- ## Roadmap
329
-
330
- - **Phase 1** ✅ - Core tools (apps, reviews, analytics)
331
- - **Phase 2** 🚧 - Full tool suite (revenue, ratings, ASO, competitors, growth audit)
332
- - **Phase 3** 📋 - Resources & Prompts
333
- - **Phase 4** 📋 - CLI wrapper
334
- - **Phase 5** 📋 - HTTP/SSE transport (hosted MCP server)
335
-
336
- ## Security
337
-
338
- - **API keys** should be kept secret and never committed to version control
339
- - **Scoped access** - API keys only access their organization's data
340
- - **Audit logging** - All tool calls are logged for compliance
341
- - **Rate limiting** - Prevents abuse (coming in Phase 2)
342
-
343
- ## Contributing
344
-
345
- This package is part of the Fload monorepo. See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.
346
-
347
78
  ## License
348
79
 
349
- MIT © Fload
350
-
351
- ## Support
352
-
353
- - **Documentation:** [Design Doc](../../docs/cli-mcp-design.md)
354
- - **Issues:** GitHub Issues
355
- - **Email:** support@fload.io
356
-
357
- ---
358
-
359
- **Built with ❤️ for AI agents**
80
+ MIT