Skip to content

Install nasa-mcp on a new machine

This page takes a fresh machine to a running, verified server in about five minutes. Every dependency version comes from the hash-locked uv.lock, so two machines that follow these steps on the same release tag get identical environments.

Supported: macOS and Linux (both tested in CI), and Windows through WSL 2. Native Windows is untested.

1. Install the prerequisites

You need git and uv (0.5 or newer). You do not need to install Python yourself: uv downloads a matching interpreter.

xcode-select --install          # provides git, if not already installed
brew install uv                 # or: curl -LsSf https://astral.sh/uv/install.sh | sh
sudo apt install git            # or your distribution's package manager
curl -LsSf https://astral.sh/uv/install.sh | sh   # installs uv into ~/.local/bin

Without root, pip install --user uv also works.

Check with uv --version and git --version. Open a new terminal if uv is not found: the installer adds ~/.local/bin to your PATH.

2. Get the code at a pinned release

git clone https://github.com/idss-mesa/nasa-mcp.git ~/nasa-mcp
cd ~/nasa-mcp
git checkout v0.1.0             # a release tag; omit to track the latest main

Release tags are listed on the releases page. Use the same tag on every machine you want to behave identically.

3. Create the locked environment

uv sync --frozen --python 3.12 --managed-python
  • --frozen installs exactly the versions and sha256 hashes in uv.lock and fails rather than resolving anything new.
  • --python 3.12 --managed-python uses a uv-managed CPython 3.12 (3.11-3.13 are supported) and not whatever Python is on the machine. This also avoids broken system or conda interpreters; for example, a conda Python whose sqlite3 module fails to import breaks mypy and coverage, though not the server itself.

The environment lives in .venv/ inside the checkout. Nothing is installed globally.

4. Check it offline

uv run nasa-mcp --check

You should see "ok": true, "version": "0.1.0" and 37 tool names. This needs no network and no key.

Fourteen of the sixteen services need no key. NeoWs (asteroids) and InSight use the api.nasa.gov gateway; without a key they fall back to DEMO_KEY, which allows only about ten requests before a day-long block. Get a free key and store it in a private file outside the repository by following The api.nasa.gov key. In short:

mkdir -p ~/.config/nasa-mcp
read -rs -p "Paste your NASA API key, then Enter: " K; echo
printf 'NASA_MCP_NASA__API_KEY=%s\n' "$K" > ~/.config/nasa-mcp/env; unset K
chmod 600 ~/.config/nasa-mcp/env

6. Check it live

set -a; . ~/.config/nasa-mcp/env; set +a
uv run nasa-mcp --check --live

The output ends with "ok": true, and ping.apiKey.mode is "personal" when the key was read ("demo" means it was not; see troubleshooting). --live makes one small request per service.

7. Connect your MCP client

See Connect an MCP client for Claude Code, Claude Desktop and HTTP clients, including a launcher that reads the key from the file above, so no client config ever contains it.

Updating

cd ~/nasa-mcp
git fetch --tags && git checkout v0.2.0     # the new tag
uv sync --frozen --python 3.12 --managed-python
uv run nasa-mcp --check

Your key file and client registrations do not change.

Alternatives

As a uv tool (no checkout kept)

uv tool install --python 3.12 git+https://github.com/idss-mesa/nasa-mcp@v0.1.0
nasa-mcp --version

Unlike uv sync --frozen, this resolves dependencies within the ranges in pyproject.toml, not from uv.lock, so it is less strictly reproducible.

As a container

docker build -t nasa-mcp:0.1.0 .
docker run --rm -i nasa-mcp:0.1.0 nasa-mcp --transport stdio          # stdio
docker run --rm -p 127.0.0.1:8080:8080 nasa-mcp:0.1.0                 # HTTP on :8080/mcp
docker run --rm -i --env-file ~/.config/nasa-mcp/env nasa-mcp:0.1.0 nasa-mcp --transport stdio

The image pins its base images by digest, installs from uv.lock with hash checking, runs as uid 10001, serves stateless Streamable HTTP on port 8080 by default and has a HEALTHCHECK on /healthz. Over HTTP a key is used only with NASA_MCP_NASA__ALLOW_KEY_IN_HTTP_MODE=true (why).