Spaces:
Running

File size: 2,066 Bytes
6ed91fb
 
 
 
 
 
 
 
 
 
950662b
 
6ed91fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
950662b
6ed91fb
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Contributing

Thanks for helping. Bug reports, new themes, better presets and documentation fixes are all
welcome.

## Development loop

```bash
npm install
npm run build          # compile tiled-mcp/src to tiled-mcp/dist
npm test               # every offline suite: 96 + 96 (legacy coordinates) + 39 checks; must stay green
npm run test:loop      # the same 5 times in a row, to catch flaky failures
npm run docs           # regenerate docs/tools.md and docs/themes.md after changing tools or themes
npm run inspect        # try tools by hand in the MCP Inspector
npm run preview -- maps/<file>.tmj   # look at a map without Tiled
```

Node.js 20.9 or newer is required.

## Guidelines

- **Tool descriptions are documentation for agents.** Write them in English and say what the
  tool needs first (for example "call create_map first"), units, and what happens on failure.
  Add MCP annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`).
- **Fail with a useful message.** Throw an `Error` that tells the caller how to fix the call;
  the SDK returns it as a tool error.
- **Never write to stdout** from the server: stdout carries the MCP protocol. Use stderr.
- **Keep the output Tiled-correct.** Object positions follow
  [docs/map-format.md](docs/map-format.md#object-coordinates); check new output in Tiled or with
  `npm run preview`.
- **No machine-specific paths.** Resolve paths through `tiled-mcp/src/paths.ts`.
- **Paid calls stay opt-in.** Anything that spends money must be explicit and must not repeat
  work that already exists on disk.
- **Do not rename theme keys**: they name the asset folders and appear in existing maps.

## Adding a theme

See [docs/themes.md](docs/themes.md#adding-a-theme).

## Pull requests

1. One topic per pull request.
2. `npm run build && npm test` passes, and `npm run docs` shows no unexpected diff.
3. Update the README or `docs/` when behaviour changes, and add a line to `CHANGELOG.md`.

By contributing you agree that your contribution is licensed under the [MIT license](LICENSE).