xplane-dataref-mcp
An MCP server that gives any LLM client raw access to a
running X-Plane 12: search its ~10,000 datarefs and ~3,000 commands by substring, read values,
and fire commands — over X-Plane's own Web API. It exists mostly for the lookup problem: nobody
knows the string sim/cockpit2/gauges/indicators/airspeed_kts_pilot before finding it, and the
Web API itself only filters by exact name. For instructor-level operations ("place me on a
10 NM final") see its high-level sibling, xplane-mcp.
flowchart LR
client["Any MCP client<br/>Claude · Cursor · GPT · local models"]
server["xplane-dataref-mcp<br/>6 tools · cached catalogue"]
xplane["X-Plane 12 Web API<br/>12.1.4+"]
client -- "stdio / streamable-http" --> server
server -- "REST" --> xplane
Tools
| Tool | |
|---|---|
get_connection_status |
Is X-Plane reachable, and what does its API offer? Reported as data, not as an error. |
search_datarefs |
Substring search (AND of terms, case-insensitive) over every dataref name. |
read_dataref |
One dataref's current value, by exact name; index picks an array element. |
read_datarefs |
Several at once, read concurrently — one snapshot of related state. |
search_commands |
The same search over command names and descriptions. |
execute_command |
Press a command, or hold it for up to 10 s. |
Byte-array (data) datarefs are decoded from base64 to text when they are text. Writing
datarefs is deliberately absent — commands cover acting on the simulator with X-Plane's own
semantics and bounds.
How it works
sequenceDiagram
participant LLM as LLM client
participant S as xplane-dataref-mcp
participant XP as X-Plane 12
LLM->>S: search_datarefs("airspeed pilot")
Note over S: local substring search<br/>over the cached catalogue
S-->>LLM: …/airspeed_kts_pilot
LLM->>S: read_dataref(name)
S->>XP: GET /api/v2/datarefs/{id}/value
XP-->>S: 123.5
S-->>LLM: 123.5 (float)
Note over S,XP: Ids go stale when X-Plane restarts —<br/>a 404 refreshes the catalogue, one retry.
Quick start
- X-Plane 12.1.4+, Settings → Network → Accept incoming connections (serves on port 8086).
claude mcp add xplane-datarefs -- uvx xplane-dataref-mcp— or open your client below.- Ask: "what's my airspeed?"
The server starts fine with the simulator down — the moment X-Plane comes up, the tools work, no restart needed.
Persistent install / from source
uv tool install xplane-dataref-mcp # or: pip install xplane-dataref-mcp
uvx --from git+https://github.com/Santisoutoo/xplane-dataref-mcp xplane-dataref-mcp # from source
Use with your client
Every stdio config is the same idea — command: uvx, args: ["xplane-dataref-mcp"] — dressed
in each client's file format. If X-Plane is not at the default http://127.0.0.1:8086, add
XPLANE_URL via the config's env field (shown once, in the Claude Code example).
Claude Code
claude mcp add xplane-datarefs -- uvx xplane-dataref-mcp
Or as a project-scoped .mcp.json:
{
"mcpServers": {
"xplane-datarefs": {
"command": "uvx",
"args": ["xplane-dataref-mcp"],
"env": { "XPLANE_URL": "http://127.0.0.1:8086" }
}
}
}
Claude Desktop
Settings → Developer → Edit Config, then in claude_desktop_config.json:
{
"mcpServers": {
"xplane-datarefs": { "command": "uvx", "args": ["xplane-dataref-mcp"] }
}
}
Cursor
~/.cursor/mcp.json (global) or .cursor/mcp.json (per project):
{
"mcpServers": {
"xplane-datarefs": { "command": "uvx", "args": ["xplane-dataref-mcp"] }
}
}
VS Code (GitHub Copilot)
.vscode/mcp.json — note the different shape (servers, and a type):
{
"servers": {
"xplane-datarefs": { "type": "stdio", "command": "uvx", "args": ["xplane-dataref-mcp"] }
}
}
Codex CLI
~/.codex/config.toml:
[mcp_servers.xplane-datarefs]
command = "uvx"
args = ["xplane-dataref-mcp"]
Gemini CLI
~/.gemini/settings.json:
{
"mcpServers": {
"xplane-datarefs": { "command": "uvx", "args": ["xplane-dataref-mcp"] }
}
}
LM Studio
Program → Install → Edit mcp.json:
{
"mcpServers": {
"xplane-datarefs": { "command": "uvx", "args": ["xplane-dataref-mcp"] }
}
}
HTTP for programmatic agents
Agents built in code connect over streamable HTTP instead of stdio:
xplane-dataref-mcp --transport streamable-http --host 127.0.0.1 --port 8000
The MCP endpoint is http://127.0.0.1:8000/mcp.
Security: the server has no authentication. On 127.0.0.1 the SDK's Host/Origin validation
(DNS-rebinding protection) is enabled automatically; binding 0.0.0.0 disables it and hands
control of your simulator to anyone who can reach the port. Trusted networks only.
Connection examples (MCP Python SDK, OpenAI Agents SDK)
With the MCP Python SDK:
from mcp import Client
async with Client("http://127.0.0.1:8000/mcp") as client:
tools = await client.list_tools()
With the OpenAI Agents SDK:
from agents.mcp import MCPServerStreamableHttp
xplane = MCPServerStreamableHttp(params={"url": "http://127.0.0.1:8000/mcp"})
Configuration
One variable.
| Variable | Default | |
|---|---|---|
XPLANE_URL |
http://127.0.0.1:8086 |
Where X-Plane's Web API is serving. |
X-Plane's Web API is unauthenticated, so point XPLANE_URL only at machines on networks you
trust.
Development
git clone https://github.com/Santisoutoo/xplane-dataref-mcp && cd xplane-dataref-mcp
uv venv && uv pip install -e ".[dev]"
pytest # offline: every test runs against a canned Web API
pytest -m sim # against a real X-Plane at XPLANE_URL
ruff check . && ruff format --check . && mypy .
The default suite fakes X-Plane at the HTTP boundary, so everything — including the streamable-http transport — is exercised without a simulator.
Licence
MIT.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xplane_dataref_mcp-0.1.0.tar.gz.
File metadata
- Download URL: xplane_dataref_mcp-0.1.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92178b3bd3e1a24d9639ffbde447b60cb46d1fcadd5a9017dcb71c1dd80a0d86
|
|
| MD5 |
b291a33f643af4360e34012bc2ec24f1
|
|
| BLAKE2b-256 |
bf8310d5d56291301cbf7b8d287647af4ac3023f7fa44af57ff2048030e99270
|
Provenance
The following attestation bundles were made for xplane_dataref_mcp-0.1.0.tar.gz:
Publisher:
release.yml on Santisoutoo/xplane-dataref-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xplane_dataref_mcp-0.1.0.tar.gz -
Subject digest:
92178b3bd3e1a24d9639ffbde447b60cb46d1fcadd5a9017dcb71c1dd80a0d86 - Sigstore transparency entry: 2498019080
- Sigstore integration time:
-
Permalink:
Santisoutoo/xplane-dataref-mcp@49b3bdd6183bba1e9f46bd2c94692ad042a31005 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Santisoutoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@49b3bdd6183bba1e9f46bd2c94692ad042a31005 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xplane_dataref_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: xplane_dataref_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2bdb044ec8269e96a3404ff3fe428f4c39b3e6c368c5a9ddd0b5f8271cec94a
|
|
| MD5 |
165f8d08a3e22ff6186535a5646ac16e
|
|
| BLAKE2b-256 |
64dbc286a11ecc93a548425996ba37343f2aca37284a54a0212d643b2b692912
|
Provenance
The following attestation bundles were made for xplane_dataref_mcp-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Santisoutoo/xplane-dataref-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xplane_dataref_mcp-0.1.0-py3-none-any.whl -
Subject digest:
a2bdb044ec8269e96a3404ff3fe428f4c39b3e6c368c5a9ddd0b5f8271cec94a - Sigstore transparency entry: 2498019205
- Sigstore integration time:
-
Permalink:
Santisoutoo/xplane-dataref-mcp@49b3bdd6183bba1e9f46bd2c94692ad042a31005 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Santisoutoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@49b3bdd6183bba1e9f46bd2c94692ad042a31005 -
Trigger Event:
push
-
Statement type: