flecs-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_HOST | No | Bind address for `MCP_TRANSPORT=http`. | 127.0.0.1 |
| MCP_PORT | No | Bind port for `MCP_TRANSPORT=http`. The endpoint is `http://MCP_HOST:MCP_PORT/mcp`. | 8000 |
| MCP_LOG_LEVEL | No | `DEBUG`, `INFO`, `WARNING`, `ERROR` or `CRITICAL`. Logs go to stderr. | INFO |
| MCP_TRANSPORT | No | `stdio`, or `http` for streamable HTTP. | stdio |
| FLECS_REST_URL | Yes | Base URL of the FLECS REST API, e.g. `http://localhost:27750`. A path prefix is allowed (for a reverse proxy); a query string is not. Required. | |
| FLECS_REST_TIMEOUT | No | Request timeout in seconds (> 0). | 5 |
| FLECS_REST_VERIFY_TLS | No | Verify TLS certificates for `https://` URLs. Accepts `true/false`, `1/0`, `yes/no`, `on/off`. | true |
| FLECS_REST_ALLOW_MUTATIONS | No | Register the MUTATION tools. They change the running application. | false |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| flecs_get_world_infoA | [READ] Describe the connected FLECS world; call it first to test the link. Returns:
Fails if the FLECS REST API cannot be reached. |
| flecs_get_entityA | [READ] Get one entity with its tags, relationship pairs and component values. Returns the FLECS entity JSON: 'parent', 'name', 'tags' (list), 'pairs' (relationship -> target), 'components' (component -> value; null when the component has no reflection data) and, when requested, 'id', 'type_info', 'inherited', 'matches' and doc info. Names use full paths. Errors when the entity does not exist. Use flecs_query to find entities. |
| flecs_get_componentA | [READ] Get the value of a single component of an entity. Returns {entity, component, value}; 'value' is the component serialized by FLECS reflection (usually an object of members, e.g. {"x": 10, "y": 20}). Errors when the entity does not have the component, when the id is a tag (no data) or when it cannot be resolved. |
| flecs_queryA | [READ] Find entities with a query written in the FLECS query language. Syntax cheat sheet (terms are comma separated and all must match):
Returns {page, results, type_info?}. Each result has 'parent', 'name' and, depending on options, 'id', 'fields' ({values, ids, sources, is_set} per query term), 'vars' or, with table=true, 'tags'/'pairs'/'components'. page = {offset, limit, returned, may_have_more}; when may_have_more is true, call again with offset += limit. Invalid queries return the FLECS parser error (with position) so the query can be fixed. |
| flecs_run_named_queryA | [READ] Return what an existing named query, system or observer matches now. Useful to check which entities a system processes. Same result format as flecs_query: {page, results, type_info?}. |
| flecs_explain_queryA | [READ] Explain how FLECS parses and plans a query, without returning results. Returns 'query_info' (resolved terms: operator, source, traversal flags), 'field_info' (id, type and member schema per field), 'query_plan' (the FLECS query plan as text) and optionally 'query_profile'. Use it to debug queries that match nothing or match too much. Invalid queries return the FLECS parser error. |
| flecs_get_type_infoA | [READ] Get the reflection schema (members, types, units) of a component type. Returns {component, has_reflection, schema}. 'schema' maps member names to [type, {unit, ...}] descriptors, e.g. {"x": ["float"], "y": ["float"]}. has_reflection is false (and schema null) when the type has no reflection data, in which case FLECS cannot serialize or set its value. |
| flecs_list_componentsA | [READ] List the component, tag and pair ids in use, with storage statistics. Each entry has 'name', 'entity_count', 'entity_size', 'tables' (table ids), 'traits' (e.g. Exclusive, CanToggle, (OnDelete,Remove)), 'type' (size, alignment, which lifecycle hooks are set; absent for tags), 'sparse' (for sparse components) and 'memory' when the stats module is imported. Includes FLECS builtin ids and wildcard records. Returns {total, offset, limit, components}; total counts matches after filtering. Use flecs_get_type_info for a component's member schema. |
| flecs_list_queriesA | [READ] List named queries, systems and observers with evaluation statistics. Each entry has 'name' (usable with flecs_run_named_query), 'kind' (Query, System or Observer), 'expr' (the query expression), 'results' and 'count' (current matches), 'eval_count', 'eval_time', 'eval_mode', 'cache_kind', 'batched', 'empty_tables', 'plan_size' and, when the stats module is imported, 'memory'. FLECS evaluates every query to produce this list, which can take a while in very large worlds. Returns {total, offset, limit, queries}. |
| flecs_get_world_statsA | [READ] Get world performance statistics from the FLECS stats module. 'metrics' maps names such as 'performance.fps', 'performance.frame_time', 'entities.count', 'tables.count', 'queries.system_count', 'commands.add_count' and 'memory.alloc_count' to {avg, min, max, brief}. Times are in seconds. Requires the FLECS application to import the stats module (FlecsStats); returns an explanatory error otherwise. |
| flecs_get_pipeline_statsA | [READ] Get per-system timing statistics from the FLECS stats module. 'entries' contains one object per system: 'name', 'disabled', 'time_spent' and (for non-task systems) 'matched_entity_count' and 'matched_table_count', each metric as {avg, min, max}. With a pipeline, sync points ('multi_threaded', 'immediate', 'time_spent', 'commands_enqueued') are interleaved in execution order. Times are in seconds. Requires the stats module (FlecsStats). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| flecs_build_info | FLECS build of the connected application: version, compiler, enabled addons and debug/sanitize/perf_trace flags (flecs.core.BuildInfo). |
TDQS
Scored across 11 tools
Each tool has a clearly distinct purpose: entity vs component retrieval, ad-hoc vs named query execution vs query explanation, world info vs stats vs pipeline stats, and list vs schema inspection. The descriptions explicitly clarify boundaries (e.g., use flecs_query to find entities, flecs_run_named_query for existing named queries), so misselection risk is low.
All tools use the flecs_ prefix and snake_case, with a consistent verb_noun pattern in nearly every case (get_world_info, get_entity, list_components, run_named_query, etc.). The one minor deviation is flecs_query, which is verb-only rather than verb_noun, but overall the convention remains predictable.
Eleven tools is well-scoped for a FLECS inspection server, covering world info, entities, components, queries, and statistics without redundancy. Each tool earns its place and the surface is neither thin nor bloated.
The read-only introspection surface is thorough: world info, entity/component retrieval, query execution, query explanation, type schemas, lists, and performance stats. However, mutation operations (e.g., creating entities, setting components, running systems) are absent, which could be a gap if the server is intended for more than read-only diagnostics.