@remix-gg/mcp 0.4.3
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 +81 -0
- package/dist/client-helpers/index.d.ts +2 -0
- package/dist/client-helpers/index.d.ts.map +1 -0
- package/dist/client-helpers/index.js +2 -0
- package/dist/client-helpers/index.js.map +1 -0
- package/dist/config.d.ts +20 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +58 -0
- package/dist/config.js.map +1 -0
- package/dist/core/api-client.d.ts +4 -0
- package/dist/core/api-client.d.ts.map +1 -0
- package/dist/core/api-client.js +12 -0
- package/dist/core/api-client.js.map +1 -0
- package/dist/core/config.d.ts +6 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +19 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +4 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/skills.d.ts +22 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +49 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/tool-defs.d.ts +12 -0
- package/dist/core/tool-defs.d.ts.map +1 -0
- package/dist/core/tool-defs.js +356 -0
- package/dist/core/tool-defs.js.map +1 -0
- package/dist/core/tools/create-game.d.ts +9 -0
- package/dist/core/tools/create-game.d.ts.map +1 -0
- package/dist/core/tools/create-game.js +21 -0
- package/dist/core/tools/create-game.js.map +1 -0
- package/dist/core/tools/create-shop-item.d.ts +14 -0
- package/dist/core/tools/create-shop-item.d.ts.map +1 -0
- package/dist/core/tools/create-shop-item.js +78 -0
- package/dist/core/tools/create-shop-item.js.map +1 -0
- package/dist/core/tools/delete-shop-item.d.ts +9 -0
- package/dist/core/tools/delete-shop-item.d.ts.map +1 -0
- package/dist/core/tools/delete-shop-item.js +19 -0
- package/dist/core/tools/delete-shop-item.js.map +1 -0
- package/dist/core/tools/generate-image.d.ts +8 -0
- package/dist/core/tools/generate-image.d.ts.map +1 -0
- package/dist/core/tools/generate-image.js +32 -0
- package/dist/core/tools/generate-image.js.map +1 -0
- package/dist/core/tools/generate-sprite-sheet.d.ts +14 -0
- package/dist/core/tools/generate-sprite-sheet.d.ts.map +1 -0
- package/dist/core/tools/generate-sprite-sheet.js +29 -0
- package/dist/core/tools/generate-sprite-sheet.js.map +1 -0
- package/dist/core/tools/helpers.d.ts +60 -0
- package/dist/core/tools/helpers.d.ts.map +1 -0
- package/dist/core/tools/helpers.js +68 -0
- package/dist/core/tools/helpers.js.map +1 -0
- package/dist/core/tools/index.d.ts +13 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +13 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/list-shop-items.d.ts +8 -0
- package/dist/core/tools/list-shop-items.d.ts.map +1 -0
- package/dist/core/tools/list-shop-items.js +17 -0
- package/dist/core/tools/list-shop-items.js.map +1 -0
- package/dist/core/tools/update-game.d.ts +11 -0
- package/dist/core/tools/update-game.d.ts.map +1 -0
- package/dist/core/tools/update-game.js +22 -0
- package/dist/core/tools/update-game.js.map +1 -0
- package/dist/core/tools/update-shop-item.d.ts +15 -0
- package/dist/core/tools/update-shop-item.d.ts.map +1 -0
- package/dist/core/tools/update-shop-item.js +24 -0
- package/dist/core/tools/update-shop-item.js.map +1 -0
- package/dist/core/tools/upload-game-asset.d.ts +8 -0
- package/dist/core/tools/upload-game-asset.d.ts.map +1 -0
- package/dist/core/tools/upload-game-asset.js +43 -0
- package/dist/core/tools/upload-game-asset.js.map +1 -0
- package/dist/core/tools/upload-version.d.ts +8 -0
- package/dist/core/tools/upload-version.d.ts.map +1 -0
- package/dist/core/tools/upload-version.js +20 -0
- package/dist/core/tools/upload-version.js.map +1 -0
- package/dist/core/tools/validate-game.d.ts +6 -0
- package/dist/core/tools/validate-game.d.ts.map +1 -0
- package/dist/core/tools/validate-game.js +41 -0
- package/dist/core/tools/validate-game.js.map +1 -0
- package/dist/core/tools.test.d.ts +2 -0
- package/dist/core/tools.test.d.ts.map +1 -0
- package/dist/core/tools.test.js +825 -0
- package/dist/core/tools.test.js.map +1 -0
- package/dist/generated/server-api.d.ts +3673 -0
- package/dist/generated/server-api.d.ts.map +1 -0
- package/dist/generated/server-api.js +2 -0
- package/dist/generated/server-api.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +365 -0
- package/dist/index.js.map +1 -0
- package/dist/server/create-server.d.ts +12 -0
- package/dist/server/create-server.d.ts.map +1 -0
- package/dist/server/create-server.js +29 -0
- package/dist/server/create-server.js.map +1 -0
- package/dist/server/create-server.test.d.ts +2 -0
- package/dist/server/create-server.test.d.ts.map +1 -0
- package/dist/server/create-server.test.js +37 -0
- package/dist/server/create-server.test.js.map +1 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +8 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/lib/config.d.ts +2 -0
- package/dist/server/lib/config.d.ts.map +1 -0
- package/dist/server/lib/config.js +2 -0
- package/dist/server/lib/config.js.map +1 -0
- package/dist/server/resources/skills.d.ts +3 -0
- package/dist/server/resources/skills.d.ts.map +1 -0
- package/dist/server/resources/skills.js +60 -0
- package/dist/server/resources/skills.js.map +1 -0
- package/dist/server/resources/skills.test.d.ts +2 -0
- package/dist/server/resources/skills.test.d.ts.map +1 -0
- package/dist/server/resources/skills.test.js +44 -0
- package/dist/server/resources/skills.test.js.map +1 -0
- package/dist/server/tools/register.d.ts +3 -0
- package/dist/server/tools/register.d.ts.map +1 -0
- package/dist/server/tools/register.js +26 -0
- package/dist/server/tools/register.js.map +1 -0
- package/dist/server/tools/register.test.d.ts +2 -0
- package/dist/server/tools/register.test.d.ts.map +1 -0
- package/dist/server/tools/register.test.js +85 -0
- package/dist/server/tools/register.test.js.map +1 -0
- package/dist/types.d.ts +73 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +31 -0
- package/dist/types.js.map +1 -0
- package/package.json +38 -0
- package/skills/SKILL.md +82 -0
- package/skills/actions/open-game.md +18 -0
- package/skills/workflows/add-image-to-game.md +121 -0
- package/skills/workflows/add-sprite-to-game.md +127 -0
- package/skills/workflows/game-creation.md +124 -0
- package/skills/workflows/implement-multiplayer.md +355 -0
- package/skills/workflows/integrate-save-game.md +135 -0
- package/skills/workflows/manage-shop-items.md +246 -0
- package/skills/workflows/upload-game.md +74 -0
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @remix-gg/mcp
|
|
2
|
+
|
|
3
|
+
MCP server and skills for building and publishing HTML games on [Remix](https://remix.gg).
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### Claude Code
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
claude mcp add remix-mcp -- npx -y @remix-gg/mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Claude Desktop
|
|
14
|
+
|
|
15
|
+
Add to your Claude Desktop config:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"remix": {
|
|
21
|
+
"command": "npx",
|
|
22
|
+
"args": ["-y", "@remix-gg/mcp"],
|
|
23
|
+
"env": {
|
|
24
|
+
"REMIX_API_KEY": "your-api-key"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Authentication
|
|
32
|
+
|
|
33
|
+
Set the `REMIX_API_KEY` environment variable with your API key from [remix.gg](https://remix.gg).
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
export REMIX_API_KEY=your-api-key
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Set API Key in Claude Code
|
|
40
|
+
|
|
41
|
+
You can make the ENV variable work for all Claude Code sessions but setting it in `.claude/settings.json`
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"env": {
|
|
46
|
+
"REMIX_API_KEY": "sk_agent_your-api-key-from-remixgg"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Tools
|
|
52
|
+
|
|
53
|
+
| Tool | Description |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `createGame` | Create a new game on Remix |
|
|
56
|
+
| `uploadVersion` | Upload an HTML game file to a game version |
|
|
57
|
+
| `validateGame` | Validate an HTML game file for common issues |
|
|
58
|
+
| `generateImage` | Generate an AI image and host it as a game asset |
|
|
59
|
+
| `uploadGameAsset` | Upload an asset file (image, audio, 3D model, video) |
|
|
60
|
+
|
|
61
|
+
## Skills
|
|
62
|
+
|
|
63
|
+
The MCP server exposes skill resources that guide agents through multi-step workflows:
|
|
64
|
+
|
|
65
|
+
| Skill | Description |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| `game-creation` | Full workflow for creating an HTML5 game from scratch |
|
|
68
|
+
| `upload-game` | Package and upload a finished game to Remix |
|
|
69
|
+
| `integrate-save-game` | Add save/load game state via the Remix SDK |
|
|
70
|
+
| `add-image-to-game` | Generate and integrate image assets into a game |
|
|
71
|
+
| `open-game` | Open a game in Remix Studio for browser preview |
|
|
72
|
+
| `overview` | Master overview of all available capabilities |
|
|
73
|
+
|
|
74
|
+
## Game Settings
|
|
75
|
+
|
|
76
|
+
Game IDs are persisted in a `.remix-settings.json` file in the project root. The MCP tools read and write this file automatically so IDs carry across sessions.
|
|
77
|
+
|
|
78
|
+
## Links
|
|
79
|
+
|
|
80
|
+
- [remix.gg](https://remix.gg)
|
|
81
|
+
- [@remix-gg/sdk](https://www.npmjs.com/package/@remix-gg/sdk) — Client SDK for game developers
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client-helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client-helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Config } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Load configuration from .remix-mcp.json
|
|
4
|
+
* Returns empty object if file doesn't exist
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadConfig(): Promise<Config>;
|
|
7
|
+
/**
|
|
8
|
+
* Save configuration to .remix-mcp.json
|
|
9
|
+
* Merges with existing config, only updating provided fields
|
|
10
|
+
*/
|
|
11
|
+
export declare function saveConfig(updates: Partial<Config>): Promise<Config>;
|
|
12
|
+
/**
|
|
13
|
+
* Validate that API key is present
|
|
14
|
+
* Throws error if missing
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateApiKey(config: Config): {
|
|
17
|
+
apiKey: string;
|
|
18
|
+
apiUrl: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,YAAY,CAAA;AAWtD;;;GAGG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAelD;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAW1E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG;IAC9C,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf,CAaA"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { ConfigSchema } from './types.js';
|
|
5
|
+
const CONFIG_FILE_NAME = '.remix-mcp.json';
|
|
6
|
+
/**
|
|
7
|
+
* Get the path to the config file in the current working directory
|
|
8
|
+
*/
|
|
9
|
+
function getConfigPath() {
|
|
10
|
+
return join(process.cwd(), CONFIG_FILE_NAME);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Load configuration from .remix-mcp.json
|
|
14
|
+
* Returns empty object if file doesn't exist
|
|
15
|
+
*/
|
|
16
|
+
export async function loadConfig() {
|
|
17
|
+
const configPath = getConfigPath();
|
|
18
|
+
if (!existsSync(configPath)) {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const content = await readFile(configPath, 'utf-8');
|
|
23
|
+
const parsed = JSON.parse(content);
|
|
24
|
+
return ConfigSchema.parse(parsed);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error('Error loading config:', error);
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Save configuration to .remix-mcp.json
|
|
33
|
+
* Merges with existing config, only updating provided fields
|
|
34
|
+
*/
|
|
35
|
+
export async function saveConfig(updates) {
|
|
36
|
+
const configPath = getConfigPath();
|
|
37
|
+
const existing = await loadConfig();
|
|
38
|
+
const merged = { ...existing, ...updates };
|
|
39
|
+
// Validate the merged config
|
|
40
|
+
const validated = ConfigSchema.parse(merged);
|
|
41
|
+
await writeFile(configPath, JSON.stringify(validated, null, 2), 'utf-8');
|
|
42
|
+
return validated;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Validate that API key is present
|
|
46
|
+
* Throws error if missing
|
|
47
|
+
*/
|
|
48
|
+
export function validateApiKey(config) {
|
|
49
|
+
if (!config.apiKey) {
|
|
50
|
+
throw new Error('API key is not configured. Please run set_config tool with your apiKey:\n\nExample: set_config with apiKey: "your-api-key-here"');
|
|
51
|
+
}
|
|
52
|
+
const apiUrl = config.apiUrl || 'https://remix.gg';
|
|
53
|
+
return {
|
|
54
|
+
apiKey: config.apiKey,
|
|
55
|
+
apiUrl,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAe,YAAY,EAAE,MAAM,YAAY,CAAA;AAEtD,MAAM,gBAAgB,GAAG,iBAAiB,CAAA;AAE1C;;GAEG;AACH,SAAS,aAAa;IACpB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAA;AAC9C,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAElC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAClC,OAAO,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAA;QAC7C,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAwB;IACvD,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,QAAQ,GAAG,MAAM,UAAU,EAAE,CAAA;IACnC,MAAM,MAAM,GAAG,EAAE,GAAG,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAA;IAE1C,6BAA6B;IAC7B,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAE5C,MAAM,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;IAExE,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IAI3C,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CACb,iIAAiI,CAClI,CAAA;IACH,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,kBAAkB,CAAA;IAElD,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM;KACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { paths } from '../generated/server-api.js';
|
|
2
|
+
import { type RemixConfig } from './config.js';
|
|
3
|
+
export declare function createServerApiClient(config?: Partial<RemixConfig>): import("openapi-fetch").Client<paths, `${string}/${string}`>;
|
|
4
|
+
//# sourceMappingURL=api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/core/api-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,KAAK,WAAW,EAAa,MAAM,aAAa,CAAA;AAEzD,wBAAgB,qBAAqB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,gEASlE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import createClient from 'openapi-fetch';
|
|
2
|
+
import { getConfig } from './config.js';
|
|
3
|
+
export function createServerApiClient(config) {
|
|
4
|
+
const { apiKey, apiBaseUrl } = getConfig(config);
|
|
5
|
+
return createClient({
|
|
6
|
+
baseUrl: apiBaseUrl,
|
|
7
|
+
headers: {
|
|
8
|
+
Authorization: `Bearer ${apiKey}`,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=api-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/core/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAA;AAExC,OAAO,EAAoB,SAAS,EAAE,MAAM,aAAa,CAAA;AAEzD,MAAM,UAAU,qBAAqB,CAAC,MAA6B;IACjE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,CAAA;IAEhD,OAAO,YAAY,CAAQ;QACzB,OAAO,EAAE,UAAU;QACnB,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,MAAM,EAAE;SAClC;KACF,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,SAAS,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAmBvE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const DEFAULT_API_BASE_URL = 'http://localhost:3003';
|
|
2
|
+
function normalizeApiBaseUrl(value) {
|
|
3
|
+
return value.replace(/\/+$/, '').replace(/\/v1$/, '');
|
|
4
|
+
}
|
|
5
|
+
export function getConfig(overrides) {
|
|
6
|
+
const apiKey = overrides?.apiKey ?? process.env.REMIX_API_KEY;
|
|
7
|
+
if (!apiKey) {
|
|
8
|
+
throw new Error('Missing REMIX_API_KEY environment variable.\n\n' +
|
|
9
|
+
'For Claude Code:\n' +
|
|
10
|
+
' claude mcp add remix -- node /path/to/dist/server/index.js\n' +
|
|
11
|
+
' Then set REMIX_API_KEY in your shell or .env file.\n\n' +
|
|
12
|
+
'You can get an API key from https://remix.gg');
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
apiKey,
|
|
16
|
+
apiBaseUrl: normalizeApiBaseUrl(overrides?.apiBaseUrl ?? process.env.REMIX_API_BASE_URL ?? DEFAULT_API_BASE_URL),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,MAAM,oBAAoB,GAAG,uBAAuB,CAAA;AAEpD,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AACvD,CAAC;AAOD,MAAM,UAAU,SAAS,CAAC,SAAgC;IACxD,MAAM,MAAM,GAAG,SAAS,EAAE,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAA;IAE7D,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,iDAAiD;YAC/C,oBAAoB;YACpB,gEAAgE;YAChE,0DAA0D;YAC1D,8CAA8C,CACjD,CAAA;IACH,CAAC;IAED,OAAO;QACL,MAAM;QACN,UAAU,EAAE,mBAAmB,CAC7B,SAAS,EAAE,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,oBAAoB,CAChF;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const SKILL_MAP: Record<string, string>;
|
|
2
|
+
/**
|
|
3
|
+
* Load a skill file by name and return its markdown content.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { loadSkill } from "@remix-gg/mcp/core";
|
|
8
|
+
*
|
|
9
|
+
* const prompt = `${basePrompt}\n\n${loadSkill("game-creation")}`;
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadSkill(name: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Load a skill file by its relative filename within the skills directory.
|
|
15
|
+
* Used by the MCP resource layer which stores filenames directly.
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadSkillFile(filename: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* List all available skill names.
|
|
20
|
+
*/
|
|
21
|
+
export declare function listSkills(): string[];
|
|
22
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAU5C,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ9C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,EAAE,CAErC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
// From core/: go up to src/, then up to package root, then into skills/
|
|
6
|
+
const SKILLS_DIR = resolve(__dirname, '..', '..', 'skills');
|
|
7
|
+
export const SKILL_MAP = {
|
|
8
|
+
overview: 'SKILL.md',
|
|
9
|
+
'game-creation': 'workflows/game-creation.md',
|
|
10
|
+
'upload-game': 'workflows/upload-game.md',
|
|
11
|
+
'implement-multiplayer': 'workflows/implement-multiplayer.md',
|
|
12
|
+
'integrate-save-game': 'workflows/integrate-save-game.md',
|
|
13
|
+
'add-image-to-game': 'workflows/add-image-to-game.md',
|
|
14
|
+
'manage-shop-items': 'workflows/manage-shop-items.md',
|
|
15
|
+
'add-sprite-to-game': 'workflows/add-sprite-to-game.md',
|
|
16
|
+
'open-game': 'actions/open-game.md',
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Load a skill file by name and return its markdown content.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { loadSkill } from "@remix-gg/mcp/core";
|
|
24
|
+
*
|
|
25
|
+
* const prompt = `${basePrompt}\n\n${loadSkill("game-creation")}`;
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export function loadSkill(name) {
|
|
29
|
+
const filename = SKILL_MAP[name];
|
|
30
|
+
if (!filename) {
|
|
31
|
+
const available = Object.keys(SKILL_MAP).join(', ');
|
|
32
|
+
throw new Error(`Unknown skill "${name}". Available skills: ${available}`);
|
|
33
|
+
}
|
|
34
|
+
return readFileSync(resolve(SKILLS_DIR, filename), 'utf-8');
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Load a skill file by its relative filename within the skills directory.
|
|
38
|
+
* Used by the MCP resource layer which stores filenames directly.
|
|
39
|
+
*/
|
|
40
|
+
export function loadSkillFile(filename) {
|
|
41
|
+
return readFileSync(resolve(SKILLS_DIR, filename), 'utf-8');
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* List all available skill names.
|
|
45
|
+
*/
|
|
46
|
+
export function listSkills() {
|
|
47
|
+
return Object.keys(SKILL_MAP);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAEzD,wEAAwE;AACxE,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;AAE3D,MAAM,CAAC,MAAM,SAAS,GAA2B;IAC/C,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,4BAA4B;IAC7C,aAAa,EAAE,0BAA0B;IACzC,uBAAuB,EAAE,oCAAoC;IAC7D,qBAAqB,EAAE,kCAAkC;IACzD,mBAAmB,EAAE,gCAAgC;IACrD,mBAAmB,EAAE,gCAAgC;IACrD,oBAAoB,EAAE,iCAAiC;IACvD,WAAW,EAAE,sBAAsB;CACpC,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;IAChC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACnD,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,wBAAwB,SAAS,EAAE,CAAC,CAAA;IAC5E,CAAC;IAED,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAA;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAA;AAC7D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAC/B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { RemixConfig } from './config.js';
|
|
3
|
+
export interface ToolDefinition<TSchema extends z.ZodObject<any> = z.ZodObject<any>> {
|
|
4
|
+
name: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: TSchema;
|
|
8
|
+
execute: (input: z.infer<TSchema>, config?: Partial<RemixConfig>) => Promise<any>;
|
|
9
|
+
formatResult: (result: any) => string;
|
|
10
|
+
}
|
|
11
|
+
export declare const TOOL_DEFS: ToolDefinition[];
|
|
12
|
+
//# sourceMappingURL=tool-defs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-defs.d.ts","sourceRoot":"","sources":["../../src/core/tool-defs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAsB9C,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC;IACjF,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;IAEpB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IAEjF,YAAY,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,MAAM,CAAA;CACtC;AAoaD,eAAO,MAAM,SAAS,EAAE,cAAc,EAYrC,CAAA"}
|