funifier-mcp 0.1.0 → 0.2.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.
Files changed (111) hide show
  1. package/README.md +182 -351
  2. package/datasource-funifier-docs/knowledge/guides/aggregates.md +152 -0
  3. package/datasource-funifier-docs/knowledge/guides/database-access.md +132 -0
  4. package/datasource-funifier-docs/knowledge/guides/java-entities.md +373 -0
  5. package/datasource-funifier-docs/knowledge/guides/java-libraries.md +330 -0
  6. package/datasource-funifier-docs/knowledge/guides/java-managers.md +509 -0
  7. package/datasource-funifier-docs/knowledge/guides/triggers-guide.md +271 -0
  8. package/datasource-funifier-docs/knowledge/index.md +121 -0
  9. package/datasource-funifier-docs/knowledge/modules/achievement.md +46 -0
  10. package/datasource-funifier-docs/knowledge/modules/action-log.md +88 -0
  11. package/datasource-funifier-docs/knowledge/modules/action.md +80 -0
  12. package/datasource-funifier-docs/knowledge/modules/auth.md +104 -0
  13. package/datasource-funifier-docs/knowledge/modules/avatar.md +28 -0
  14. package/datasource-funifier-docs/knowledge/modules/backup.md +40 -0
  15. package/datasource-funifier-docs/knowledge/modules/challenge.md +91 -0
  16. package/datasource-funifier-docs/knowledge/modules/compact.md +40 -0
  17. package/datasource-funifier-docs/knowledge/modules/competition.md +149 -0
  18. package/datasource-funifier-docs/knowledge/modules/crossword.md +41 -0
  19. package/datasource-funifier-docs/knowledge/modules/csv-data.md +30 -0
  20. package/datasource-funifier-docs/knowledge/modules/custom-object.md +53 -0
  21. package/datasource-funifier-docs/knowledge/modules/database.md +241 -0
  22. package/datasource-funifier-docs/knowledge/modules/folder.md +111 -0
  23. package/datasource-funifier-docs/knowledge/modules/kpi-formulas.md +23 -0
  24. package/datasource-funifier-docs/knowledge/modules/lastmile.md +45 -0
  25. package/datasource-funifier-docs/knowledge/modules/leaderboard.md +98 -0
  26. package/datasource-funifier-docs/knowledge/modules/level.md +83 -0
  27. package/datasource-funifier-docs/knowledge/modules/lottery.md +112 -0
  28. package/datasource-funifier-docs/knowledge/modules/marketplace.md +27 -0
  29. package/datasource-funifier-docs/knowledge/modules/mystery.md +82 -0
  30. package/datasource-funifier-docs/knowledge/modules/notification.md +40 -0
  31. package/datasource-funifier-docs/knowledge/modules/patterns.md +1096 -0
  32. package/datasource-funifier-docs/knowledge/modules/player.md +101 -0
  33. package/datasource-funifier-docs/knowledge/modules/point.md +67 -0
  34. package/datasource-funifier-docs/knowledge/modules/public.md +253 -0
  35. package/datasource-funifier-docs/knowledge/modules/question.md +136 -0
  36. package/datasource-funifier-docs/knowledge/modules/quiz.md +163 -0
  37. package/datasource-funifier-docs/knowledge/modules/scheduler.md +58 -0
  38. package/datasource-funifier-docs/knowledge/modules/security.md +169 -0
  39. package/datasource-funifier-docs/knowledge/modules/staging.md +28 -0
  40. package/datasource-funifier-docs/knowledge/modules/static-repo.md +41 -0
  41. package/datasource-funifier-docs/knowledge/modules/story.md +42 -0
  42. package/datasource-funifier-docs/knowledge/modules/studio-page.md +180 -0
  43. package/datasource-funifier-docs/knowledge/modules/swap.md +132 -0
  44. package/datasource-funifier-docs/knowledge/modules/team.md +75 -0
  45. package/datasource-funifier-docs/knowledge/modules/trigger.md +189 -0
  46. package/datasource-funifier-docs/knowledge/modules/upload.md +155 -0
  47. package/datasource-funifier-docs/knowledge/modules/virtual-good.md +99 -0
  48. package/datasource-funifier-docs/knowledge/modules/webhook.md +41 -0
  49. package/datasource-funifier-docs/knowledge/modules/websocket.md +41 -0
  50. package/datasource-funifier-docs/knowledge/modules/widget.md +42 -0
  51. package/datasource-funifier-docs/process-gtm-saas.md +143 -0
  52. package/datasource-funifier-docs/process-instagram.md +88 -0
  53. package/datasource-funifier-docs/process.md +1826 -0
  54. package/datasource-funifier-docs/readme.md +132 -0
  55. package/dist/cli/config-writers.d.ts +15 -0
  56. package/dist/cli/config-writers.d.ts.map +1 -0
  57. package/dist/cli/config-writers.js +55 -0
  58. package/dist/cli/config-writers.js.map +1 -0
  59. package/dist/cli/config-writers.test.d.ts +2 -0
  60. package/dist/cli/config-writers.test.d.ts.map +1 -0
  61. package/dist/cli/config-writers.test.js +55 -0
  62. package/dist/cli/config-writers.test.js.map +1 -0
  63. package/dist/cli/copy.d.ts +6 -0
  64. package/dist/cli/copy.d.ts.map +1 -0
  65. package/dist/cli/copy.js +63 -0
  66. package/dist/cli/copy.js.map +1 -0
  67. package/dist/cli/copy.test.d.ts +2 -0
  68. package/dist/cli/copy.test.d.ts.map +1 -0
  69. package/dist/cli/copy.test.js +94 -0
  70. package/dist/cli/copy.test.js.map +1 -0
  71. package/dist/cli/init.d.ts +2 -0
  72. package/dist/cli/init.d.ts.map +1 -0
  73. package/dist/cli/init.js +167 -0
  74. package/dist/cli/init.js.map +1 -0
  75. package/dist/cli/paths.d.ts +7 -0
  76. package/dist/cli/paths.d.ts.map +1 -0
  77. package/dist/cli/paths.js +62 -0
  78. package/dist/cli/paths.js.map +1 -0
  79. package/dist/cli/paths.test.d.ts +2 -0
  80. package/dist/cli/paths.test.d.ts.map +1 -0
  81. package/dist/cli/paths.test.js +50 -0
  82. package/dist/cli/paths.test.js.map +1 -0
  83. package/dist/cli/platforms.d.ts +22 -0
  84. package/dist/cli/platforms.d.ts.map +1 -0
  85. package/dist/cli/platforms.js +50 -0
  86. package/dist/cli/platforms.js.map +1 -0
  87. package/dist/cli/prompts.d.ts +7 -0
  88. package/dist/cli/prompts.d.ts.map +1 -0
  89. package/dist/cli/prompts.js +49 -0
  90. package/dist/cli/prompts.js.map +1 -0
  91. package/dist/index.js +1 -1
  92. package/dist/index.js.map +1 -1
  93. package/dist/mcp/bundle.js +94 -49
  94. package/dist/mcp/index.js +18 -1
  95. package/dist/mcp/index.js.map +1 -1
  96. package/package.json +4 -2
  97. package/skills/funifier-create-action/SKILL.md +86 -86
  98. package/skills/funifier-create-aggregate/SKILL.md +39 -0
  99. package/skills/funifier-create-challenge/SKILL.md +87 -87
  100. package/skills/funifier-create-custom-page/SKILL.md +39 -0
  101. package/skills/funifier-create-leaderboard/SKILL.md +87 -87
  102. package/skills/funifier-create-level/SKILL.md +86 -86
  103. package/skills/funifier-create-point/SKILL.md +86 -86
  104. package/skills/funifier-create-quiz/SKILL.md +86 -86
  105. package/skills/funifier-create-scheduler/SKILL.md +39 -0
  106. package/skills/funifier-create-trigger/SKILL.md +39 -0
  107. package/skills/funifier-create-virtual-good/SKILL.md +86 -86
  108. package/skills/funifier-debug/SKILL.md +90 -90
  109. package/skills/funifier-help/SKILL.md +85 -85
  110. package/skills/funifier-implement-frontend/SKILL.md +89 -89
  111. package/skills/funifier-index/SKILL.md +50 -50
package/README.md CHANGED
@@ -1,351 +1,182 @@
1
- # @funifier-ai
2
-
3
- Funifier AI toolkit — API client, MCP server, and AI assistant skills for the [Funifier](https://funifier.com) gamification platform.
4
-
5
- ## What's included
6
-
7
- | Component | Description |
8
- |-----------|-------------|
9
- | **API Client** | Pure Node.js client for the Funifier REST API (80+ methods, 18 resource types) |
10
- | **MCP Server** | Model Context Protocol server exposing 8 tools + 3 prompts + documentation resources |
11
- | **Skills** | 15 guided workflows for Claude Code, Codex, Copilot, Continue, and Cursor |
12
- | **Instructions** | Platform-specific instruction files (AGENTS.md, copilot-instructions.md, cursor rules) |
13
-
14
- ## Quick Start
15
-
16
- 1. **Install:**
17
-
18
- ```bash
19
- npm install @funifier-ai
20
- ```
21
-
22
- 2. **Choose your platform** and follow setup instructions:
23
-
24
- - [Claude Code](#claude-code) Claude's official IDE and CLI
25
- - [Codex CLI](#codex-cli-and-opencode) — Codex command-line agent
26
- - [OpenCode](#codex-cli-and-opencode) — Open-source agent framework
27
- - [GitHub Copilot](#github-copilot) — VS Code, JetBrains, GitHub.com
28
- - [Continue IDE](#continue-ide) Open-source IDE extension
29
- - [Cursor IDE](#cursor-ide) — AI-native code editor
30
-
31
- For detailed setup instructions, see:
32
- - **[docs/INSTALL_EXAMPLES.md](docs/INSTALL_EXAMPLES.md)** Real-world examples
33
- - **[docs/PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md)** Full platform guide
34
- - **[docs/](docs/)** — Complete documentation index
35
-
36
- ## Installation
37
-
38
- ### From npm (published)
39
-
40
- ```bash
41
- npm install @funifier-ai
42
- ```
43
-
44
- ### Local development (before publishing)
45
-
46
- **Automated setup (recommended):**
47
-
48
- From **funifier-ai directory**, run:
49
-
50
- ```bash
51
- node scripts/install-local.js /path/to/my-project
52
- # or relative path:
53
- node scripts/install-local.js ../my-project
54
- # or install in current directory:
55
- node scripts/install-local.js
56
- ```
57
-
58
- The script will:
59
- 1. Ask which platforms you're using (Claude Code, Codex, OpenCode, Copilot, Cursor, or all/none)
60
- 2. Build Funifier AI
61
- 3. Create npm link
62
- 4. Copy only the files you need for your selected platforms
63
-
64
- Changes to funifier-ai appear immediately in your project.
65
-
66
- **Manual setup:**
67
-
68
- ```bash
69
- # In funifier-ai directory
70
- npm run build && npm run bundle && npm link
71
-
72
- # In your project
73
- npm link @funifier-ai
74
- ```
75
-
76
- **Direct path (copy mode):**
77
-
78
- ```bash
79
- npm install /path/to/funifier-ai
80
- # or
81
- npm install file:../funifier-ai
82
- ```
83
-
84
- See [docs/PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md#local-development-setup) for details.
85
-
86
- ## Quick Verification
87
-
88
- After local installation, verify everything is working:
89
-
90
- ```bash
91
- # From your project directory
92
- node ../funifier-ai/scripts/test-local.js
93
- ```
94
-
95
- This checks:
96
- - ✓ Symlink is set up correctly
97
- - ✓ Built files exist (dist/)
98
- - ✓ Instruction files copied
99
- - ✓ Can import the package
100
- - ✓ API client works (if credentials set)
101
-
102
- For detailed information on how local testing works, see [docs/LOCAL_TESTING.md](docs/LOCAL_TESTING.md).
103
-
104
- If any check fails, see [docs/MCP_SETUP.md](docs/MCP_SETUP.md) for troubleshooting.
105
-
106
- ---
107
-
108
- ## MCP Server Setup
109
-
110
- ### With Claude Code
111
-
112
- Add to your `.mcp.json` (project or global `~/.claude/.mcp.json`):
113
-
114
- ```json
115
- {
116
- "mcpServers": {
117
- "funifier": {
118
- "command": "node",
119
- "args": ["node_modules/@funifier-ai/dist/mcp/index.js"],
120
- "env": {
121
- "FUNIFIER_API_KEY": "your-api-key",
122
- "FUNIFIER_SECRET_KEY": "your-secret-key",
123
- "FUNIFIER_SERVER_URL": "https://your-instance.funifier.com"
124
- }
125
- }
126
- }
127
- }
128
- ```
129
-
130
- Or place a `funifier.json` in your project root:
131
-
132
- ```json
133
- {
134
- "apiKey": "your-api-key",
135
- "secretKey": "your-secret-key",
136
- "serverUrl": "https://your-instance.funifier.com"
137
- }
138
- ```
139
-
140
- ### With Claude Desktop
141
-
142
- ```json
143
- {
144
- "mcpServers": {
145
- "funifier": {
146
- "command": "npx",
147
- "args": ["@funifier-ai"],
148
- "env": {
149
- "FUNIFIER_API_KEY": "your-api-key",
150
- "FUNIFIER_SECRET_KEY": "your-secret-key",
151
- "FUNIFIER_SERVER_URL": "https://your-instance.funifier.com"
152
- }
153
- }
154
- }
155
- }
156
- ```
157
-
158
- ### Runtime connection
159
-
160
- If no config is provided at startup, use the `funifier_connect` tool to connect:
161
-
162
- ```
163
- funifier_connect({ apiKey: "...", secretKey: "...", serverUrl: "https://..." })
164
- ```
165
-
166
- ## MCP Tools
167
-
168
- | Tool | Description |
169
- |------|-------------|
170
- | `funifier_connect` | Connect to a Funifier instance (or switch between instances) |
171
- | `funifier_list` | List resources by type with optional search filtering |
172
- | `funifier_get` | Get a specific resource with full details (including code) |
173
- | `funifier_save` | Create or update a resource |
174
- | `funifier_delete` | Delete a resource by type and ID |
175
- | `funifier_execute` | Execute a scheduler, aggregate, or public endpoint |
176
- | `funifier_logs` | Get execution logs for triggers and schedulers |
177
- | `funifier_database` | Query, aggregate, insert, update, delete on any collection |
178
-
179
- ### Resource types
180
-
181
- trigger, scheduler, aggregate, websocket, widget, custom-page, public-endpoint, challenge-aggregate, auth-module, ai-knowledge, action, challenge, point, level, leaderboard, quiz, virtual-good-catalog, virtual-good-item
182
-
183
- ## API Client (library usage)
184
-
185
- ```typescript
186
- import { createAPIClient } from "@funifier-ai";
187
-
188
- const api = createAPIClient({
189
- apiKey: "your-api-key",
190
- secretKey: "your-secret-key",
191
- serverUrl: "https://your-instance.funifier.com",
192
- });
193
-
194
- // List all triggers
195
- const triggers = await api.listTriggers();
196
-
197
- // Execute an aggregate
198
- const result = await api.executeAggregate("my-aggregate-id", {});
199
-
200
- // Query any collection
201
- const players = await api.queryCollection("player", { active: true }, { limit: 10 });
202
- ```
203
-
204
- ## Skills and Instructions
205
-
206
- This package includes generated instruction files for multiple platforms. Each provides guided workflows, code quality standards, MCP tool routing, and documentation search.
207
-
208
- ### Claude Code
209
-
210
- Install skills to your project:
211
-
212
- ```bash
213
- cp -r node_modules/@funifier-ai/skills/* .claude/skills/
214
- ```
215
-
216
- Invoke any skill with `/funifier-<name>`:
217
-
218
- ```
219
- /funifier-create-trigger
220
- /funifier-debug
221
- /funifier-help
222
- ```
223
-
224
- ### Codex CLI and OpenCode
225
-
226
- The generated `AGENTS.md` file provides instructions for Codex, OpenCode, and any agent that reads AGENTS.md.
227
-
228
- **Codex CLI:**
229
-
230
- ```bash
231
- cp node_modules/@funifier-ai/AGENTS.md .
232
- codex "Create a trigger for player registration"
233
- ```
234
-
235
- **OpenCode:**
236
-
237
- ```bash
238
- cp node_modules/@funifier-ai/AGENTS.md .
239
- # Add to .opencode.json:
240
- # { "instructions": { "file": "./AGENTS.md" } }
241
- opencode "Debug my scheduler"
242
- ```
243
-
244
- See [PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md) for full configuration details.
245
-
246
- ### GitHub Copilot
247
-
248
- ```bash
249
- mkdir -p .github
250
- cp node_modules/@funifier-ai/.github/copilot-instructions.md .github/
251
- ```
252
-
253
- Copilot automatically applies `.github/copilot-instructions.md` to code suggestions, chat, and PR reviews.
254
-
255
- ### Continue IDE
256
-
257
- ```bash
258
- mkdir -p .github
259
- cp node_modules/@funifier-ai/.github/copilot-instructions.md .github/
260
- # Configure ~/.continue/config.json with customInstructions and MCP
261
- ```
262
-
263
- Continue (VS Code / JetBrains) supports full MCP integration. See [PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md) for configuration.
264
-
265
- ### Cursor IDE
266
-
267
- ```bash
268
- mkdir -p .cursor/rules
269
- cp node_modules/@funifier-ai/.cursor/rules/funifier.mdc .cursor/rules/
270
- ```
271
-
272
- Cursor automatically discovers and applies `.mdc` files in `.cursor/rules/` to all code generation and completions.
273
-
274
- ---
275
-
276
- ### Available Workflows
277
-
278
- Each platform above provides access to these guided workflows:
279
-
280
- | Skill | Description |
281
- |-------|-------------|
282
- | `funifier-help` | Documentation router and guidance |
283
- | `funifier-debug` | Systematic debugging workflow |
284
- | `funifier-create-trigger` | Create server-side event handlers |
285
- | `funifier-create-scheduler` | Create scheduled Groovy jobs |
286
- | `funifier-create-aggregate` | Create MongoDB aggregate pipelines |
287
- | `funifier-create-custom-page` | Create Studio admin pages |
288
- | `funifier-create-action` | Create trackable player actions |
289
- | `funifier-create-challenge` | Create missions with rewards |
290
- | `funifier-create-point` | Create point categories |
291
- | `funifier-create-level` | Create level progression |
292
- | `funifier-create-leaderboard` | Create rankings |
293
- | `funifier-create-quiz` | Create quizzes |
294
- | `funifier-create-virtual-good` | Create virtual stores |
295
- | `funifier-implement-frontend` | Build frontend consuming Funifier API |
296
-
297
- ## Generated Files
298
-
299
- When you install `@funifier-ai`, the package includes pre-generated instruction and skill files:
300
-
301
- | File | Platforms | Purpose |
302
- |------|-----------|---------|
303
- | `skills/funifier-*/SKILL.md` | Claude Code | Guided workflows with system prompt, doc search, and steps |
304
- | `AGENTS.md` | Codex, OpenCode | Agent routing, MCP tools, and skill index |
305
- | `.github/copilot-instructions.md` | Copilot, Continue | Code quality standards and skill routing |
306
- | `.cursor/rules/funifier.mdc` | Cursor | Development rules with YAML frontmatter |
307
-
308
- All files embed:
309
- - **Senior developer persona** (SOLID, DRY, KISS, YAGNI)
310
- - **Skill routing** (which skill to use for each task)
311
- - **MCP tool reference** (if server is configured)
312
- - **Lexical search command** (to find relevant docs efficiently)
313
-
314
- ---
315
-
316
- ## Documentation
317
-
318
- - **[docs/README.md](docs/)** — Complete documentation index
319
- - **[docs/PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md)** — Detailed setup for all platforms
320
- - **[docs/QUICK_REFERENCE.md](docs/QUICK_REFERENCE.md)** — Copy-paste setup commands
321
- - **[docs/INSTALL_EXAMPLES.md](docs/INSTALL_EXAMPLES.md)** — Real-world scenarios
322
- - **[docs/MCP_SETUP.md](docs/MCP_SETUP.md)** — MCP configuration and troubleshooting
323
-
324
- ---
325
-
326
- ## Configuration
327
-
328
- ### Environment variables
329
-
330
- | Variable | Description |
331
- |----------|-------------|
332
- | `FUNIFIER_API_KEY` | API key for authentication |
333
- | `FUNIFIER_SECRET_KEY` | Secret key for authentication |
334
- | `FUNIFIER_SERVER_URL` | Base URL of your Funifier instance |
335
- | `FUNIFIER_DOCS_PATH` | Path to documentation files (optional) |
336
-
337
- ### funifier.json
338
-
339
- Place in your project root for automatic configuration:
340
-
341
- ```json
342
- {
343
- "apiKey": "your-api-key",
344
- "secretKey": "your-secret-key",
345
- "serverUrl": "https://your-instance.funifier.com"
346
- }
347
- ```
348
-
349
- ## License
350
-
351
- MIT
1
+ # funifier-mcp
2
+
3
+ Funifier AI toolkit — API client, MCP server, and AI assistant skills for the [Funifier](https://funifier.com) gamification platform.
4
+
5
+ ## What's included
6
+
7
+ | Component | Description |
8
+ |-----------|-------------|
9
+ | **API Client** | Pure Node.js client for the Funifier REST API (80+ methods, 18 resource types) |
10
+ | **MCP Server** | Model Context Protocol server exposing 8 tools + 3 prompts + documentation resources |
11
+ | **Skills** | 15 guided workflows for Claude Code, Codex, OpenCode, Cursor, Copilot, and Antigravity |
12
+ | **Instructions** | Platform-specific instruction files (AGENTS.md, copilot-instructions.md, cursor rules) |
13
+ | **Init CLI** | `npx funifier-mcp init` — interactive setup for every supported platform |
14
+
15
+ ## Quick Start
16
+
17
+ ```bash
18
+ # 1. Create (or cd into) your project
19
+ npm init -y
20
+
21
+ # 2. Install
22
+ npm install funifier-mcp
23
+
24
+ # 3. Run interactive setup
25
+ npx funifier-mcp init
26
+ ```
27
+
28
+ `init` asks which platforms you use, optionally collects Funifier credentials, then:
29
+
30
+ - Copies the skill/instruction files each platform expects (`.claude/skills/`, `AGENTS.md`, `.cursor/rules/`, etc.)
31
+ - Writes the correct MCP server config for each platform (`.mcp.json`, `.codex/config.toml`, `opencode.json`, `.cursor/mcp.json`, `.antigravity/mcp_config.json`)
32
+ - Writes `funifier.json` with your credentials (and adds it to `.gitignore`), or `funifier.json.example` if you skip credentials
33
+ - Prompts before overwriting anything that already exists
34
+
35
+ ### Supported platforms
36
+
37
+ - **Claude Code** — Anthropic's official CLI/IDE
38
+ - **Codex CLI** — OpenAI's command-line agent
39
+ - **OpenCode** — open-source agent framework
40
+ - **Cursor IDE** — AI-native code editor
41
+ - **GitHub Copilot** — VS Code, JetBrains, GitHub.com
42
+ - **Google Antigravity** — Gemini-based desktop agent
43
+
44
+ > Antigravity reads its MCP config from `~/.gemini/antigravity/mcp_config.json`. `init` writes a project-level snippet to `.antigravity/mcp_config.json` and prints the global path so you can merge it in.
45
+
46
+ ## CLI
47
+
48
+ ```bash
49
+ funifier-mcp # Start the MCP server over stdio (used by MCP clients)
50
+ funifier-mcp init # Interactive setup
51
+ funifier-mcp --version
52
+ funifier-mcp --help
53
+ ```
54
+
55
+ ## MCP Tools
56
+
57
+ | Tool | Description |
58
+ |------|-------------|
59
+ | `funifier_connect` | Connect to a Funifier instance (or switch between instances) |
60
+ | `funifier_list` | List resources by type with optional search filtering |
61
+ | `funifier_get` | Get a specific resource with full details (including code) |
62
+ | `funifier_save` | Create or update a resource |
63
+ | `funifier_delete` | Delete a resource by type and ID |
64
+ | `funifier_execute` | Execute a scheduler, aggregate, or public endpoint |
65
+ | `funifier_logs` | Get execution logs for triggers and schedulers |
66
+ | `funifier_database` | Query, aggregate, insert, update, delete on any collection |
67
+
68
+ ### Resource types
69
+
70
+ trigger, scheduler, aggregate, websocket, widget, custom-page, public-endpoint, challenge-aggregate, auth-module, ai-knowledge, action, challenge, point, level, leaderboard, quiz, virtual-good-catalog, virtual-good-item
71
+
72
+ ## API Client (library usage)
73
+
74
+ ```typescript
75
+ import { createAPIClient } from "funifier-mcp";
76
+
77
+ const api = createAPIClient({
78
+ apiKey: "your-api-key",
79
+ secretKey: "your-secret-key",
80
+ serverUrl: "https://your-instance.funifier.com",
81
+ });
82
+
83
+ const triggers = await api.listTriggers();
84
+ const result = await api.executeAggregate("my-aggregate-id", {});
85
+ const players = await api.queryCollection("player", { active: true }, { limit: 10 });
86
+ ```
87
+
88
+ ## Manual MCP Setup (if you skip `init`)
89
+
90
+ Point your MCP client at the bundled server:
91
+
92
+ ```json
93
+ {
94
+ "mcpServers": {
95
+ "funifier": {
96
+ "command": "npx",
97
+ "args": ["funifier-mcp"],
98
+ "env": {
99
+ "FUNIFIER_API_KEY": "your-api-key",
100
+ "FUNIFIER_SECRET_KEY": "your-secret-key",
101
+ "FUNIFIER_SERVER_URL": "https://your-instance.funifier.com"
102
+ }
103
+ }
104
+ }
105
+ }
106
+ ```
107
+
108
+ Or drop a `funifier.json` in your project root and the server will pick it up automatically:
109
+
110
+ ```json
111
+ {
112
+ "apiKey": "your-api-key",
113
+ "secretKey": "your-secret-key",
114
+ "serverUrl": "https://your-instance.funifier.com"
115
+ }
116
+ ```
117
+
118
+ If no config is provided at startup, call the `funifier_connect` tool at runtime.
119
+
120
+ ## Available Workflows
121
+
122
+ | Skill | Description |
123
+ |-------|-------------|
124
+ | `funifier-help` | Documentation router and guidance |
125
+ | `funifier-debug` | Systematic debugging workflow |
126
+ | `funifier-create-trigger` | Create server-side event handlers |
127
+ | `funifier-create-scheduler` | Create scheduled Groovy jobs |
128
+ | `funifier-create-aggregate` | Create MongoDB aggregate pipelines |
129
+ | `funifier-create-custom-page` | Create Studio admin pages |
130
+ | `funifier-create-action` | Create trackable player actions |
131
+ | `funifier-create-challenge` | Create missions with rewards |
132
+ | `funifier-create-point` | Create point categories |
133
+ | `funifier-create-level` | Create level progression |
134
+ | `funifier-create-leaderboard` | Create rankings |
135
+ | `funifier-create-quiz` | Create quizzes |
136
+ | `funifier-create-virtual-good` | Create virtual stores |
137
+ | `funifier-implement-frontend` | Build frontend consuming Funifier API |
138
+
139
+ In Claude Code, invoke any skill with `/funifier-<name>` (e.g. `/funifier-help`).
140
+
141
+ ## Configuration
142
+
143
+ ### Environment variables
144
+
145
+ | Variable | Description |
146
+ |----------|-------------|
147
+ | `FUNIFIER_API_KEY` | API key for authentication |
148
+ | `FUNIFIER_SECRET_KEY` | Secret key for authentication |
149
+ | `FUNIFIER_SERVER_URL` | Base URL of your Funifier instance |
150
+ | `FUNIFIER_DOCS_PATH` | Path to documentation files (optional) |
151
+
152
+ Resolution order: `funifier.json` in cwd → environment variables → `funifier_connect` tool at runtime.
153
+
154
+ ## Local development
155
+
156
+ ```bash
157
+ git clone https://github.com/funifierinc/funifier-mcp.git
158
+ cd funifier-mcp
159
+ npm install
160
+ npm run build # tsc dist/
161
+ npm run bundle # build + esbuild single-file bundle
162
+ npm test # vitest
163
+ ```
164
+
165
+ To test `init` against a scratch project:
166
+
167
+ ```bash
168
+ npm link
169
+ cd /tmp/scratch && npm init -y && npm link funifier-mcp
170
+ npx funifier-mcp init
171
+ ```
172
+
173
+ ## Documentation
174
+
175
+ - **[docs/PLATFORM_SETUP.md](docs/PLATFORM_SETUP.md)** Detailed setup for all platforms
176
+ - **[docs/QUICK_REFERENCE.md](docs/QUICK_REFERENCE.md)** Copy-paste setup commands
177
+ - **[docs/INSTALL_EXAMPLES.md](docs/INSTALL_EXAMPLES.md)** Real-world scenarios
178
+ - **[docs/MCP_SETUP.md](docs/MCP_SETUP.md)** — MCP configuration and troubleshooting
179
+
180
+ ## License
181
+
182
+ MIT