Spaces:
Running

File size: 4,083 Bytes
6ed91fb
 
 
 
 
 
 
 
950662b
6ed91fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e183811
 
 
 
 
 
 
 
 
 
6ed91fb
 
 
 
 
270f46d
 
 
 
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Troubleshooting

Start with the automated check. It starts the server and exercises it end to end, offline:

```bash
npm run build && npm run smoke
```

If it prints `96 passed, 0 failed`, the server works and the problem is in the client setup.

## The tools do not appear in my client

- Run `npm run build`: the client starts `tiled-mcp/dist/index.js`, which only exists after a build.
- Use an **absolute** path in the client configuration.
- Check the Node version with `node --version`; it must be 20.9 or newer. If your client starts
  a different Node than your terminal, put the full path to `node` in `command`.
- Restart the client after editing its configuration.
- Try `npm run inspect`: if the MCP Inspector lists the tools, the server is fine.

## `Unknown mapId`

Maps live in server memory. They disappear when the client restarts the server, and every
client session has its own server process. Call `list_maps`, or create the map again. Save with
`save_to_disk` before closing the session.

## Tiled shows red placeholder tiles

- The theme has no sprites yet: `list_themes` shows `sprites.status: "none"`. Use a theme with
  bundled sprites, or [generate them](sprite-generation.md).
- The file was produced by `export_json` and saved by hand somewhere else. Its image paths are
  relative to the repository root (`./assets/...`). Use `save_to_disk`, which writes paths
  relative to the file, or move the file to the repository root.
- You moved a saved `.tmj` to another folder. Save it again from the server, or fix the paths in
  Tiled (Map, Tileset properties).

## Objects or spawns are on the wrong tiles in my engine

Since 0.2.0, objects use Tiled's native isometric encoding. If your importer was written for the
older screen-space encoding, either update it with the formulas in
[map-format.md](map-format.md#object-coordinates) or set `TILED_OBJECT_COORDS=screen`.

## "Map too small for generate_crypt_layout"

Presets need room for their rooms not to overlap: crypt 27x18, castle 27x20, werewolf den 22x16.
Create a larger map, or build the layout with `generate_room` and `generate_corridor`.

## A placement is rejected

The error says why: a wall on that cell, no ground (outside the rooms), an obstacle prop, or
another object or spawn already there. Use `get_tile_info` on the `walls` and `ground` layers
and pick a free floor cell. Doors are the exception: they go in wall openings.

## "cannot be reached on foot"

`validate_map` or `validate_world` found part of the map the player cannot walk to from the
player spawn (see [Walking reachability](map-format.md#walking-reachability)). The usual causes:
an obstacle prop or a building right behind a doorway, a wall opening with no ground painted in
it, or two rooms whose walls overlap and leave no opening between them. The warning names the
objects and gives one cell of each cut-off area: open a path there with `erase_tile`
(`layer=decorations` for a prop, `layer=walls` for a wall) or `paint_rect` on the ground, or move
the building.

## Sprite generation fails

- `HUGGINGFACE_API_KEY (or HF_TOKEN) is not set`: add the token to `tiled-mcp/.env` or to the
  client's `env` block. See [sprite-generation.md](sprite-generation.md).
- `The sprite already exists`: nothing was billed. Pass `force: true` to regenerate.
- Provider or billing errors come from Hugging Face. `We have not been able to find inference
  provider information` means the provider in use no longer serves FLUX.1-dev: the error lists
  the ones that do. Remove `TILED_HF_PROVIDER` to pick one automatically, or set it to one of
  them.
- `'sharp' could not be loaded`: run `npm install` again. Map editing works without it; only
  sprite generation and previews need it.
- The client times out on `generate_theme_sprite_set`: use `node scripts/gen-theme-set.mjs <THEME> --yes`.

## Running the server on WSL from a Windows client

See [client-setup.md](client-setup.md#windows-with-the-server-inside-wsl). Windows paths passed to
tools, such as `D:/maps/crypt.tmj`, are translated to `/mnt/d/...` automatically.