NINA Advanced API MCP server

Provides a bridge between natural language commands and N.I.N.A. astronomical software, enabling control of cameras, mounts, focusers, filter wheels, and domes for automated imaging sessions.
Back to servers
Setup instructions
Provider
PaDev1
Release date
Apr 27, 2025
Language
Python
Stats
5 stars

This MCP server provides an interface for AI agents to control N.I.N.A. (Nighttime Imaging 'N' Astronomy) software through its Advanced API, enabling natural language interactions with your astrophotography equipment.

Prerequisites

  • Python 3.8 or higher
  • N.I.N.A. software with Advanced API plugin installed
  • uv package manager
  • AI agent with MCP support (e.g., Claude)

Installation

Install N.I.N.A. Advanced API Plugin

First, install the Advanced API plugin in your N.I.N.A. software and enable it in settings.

Clone Repository

git clone https://github.com/PaDev1/Nina_advanced_api_mcp.git
cd nina-mcp

Set Environment Variables

Create a .env file with the following configuration:

NINA_HOST=your_nina_host
NINA_PORT=1888
LOG_LEVEL=INFO
IMAGE_SAVE_DIR=~/Desktop/NINA_Images

Configuration

MCP Server Setup

Add this configuration to your AI agent's MCP configuration:

{
  "mcpServers": {
    "nina_advanced_mcp_api": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "fastmcp,fastapi,uvicorn,pydantic,aiohttp,requests,python-dotenv",
        "fastmcp",
        "run",
        "path/nina_advanced_mcp.py"
      ],
      "env": {
        "NINA_HOST": "NINA_IP",
        "NINA_PORT": "1888",
        "LOG_LEVEL": "INFO",
        "IMAGE_SAVE_DIR": "~/Desktop/NINA_Images"
      }
    }
  }
}

Usage Examples

Basic Commands with AI Agents

You can use natural language to control your astrophotography setup. Here are some example commands you can give to an AI agent like Claude:

  • Connect to N.I.N.A.
  • Read the current equipment setup
  • Connect camera, mount, filter wheel, and guider
  • List available sequences and select one to start
  • Take a 30-second exposure of M31
  • Connect all equipment and start cooling the camera to -10°C
  • Start a sequence targeting NGC 7000
  • Get the current equipment status

Supported Equipment Control

The MCP server provides comprehensive control over:

  • Cameras: Capture images, control cooling, adjust settings
  • Mounts: Slew to targets, park, control tracking
  • Focusers: Move focus position, use temperature compensation
  • Filter Wheels: Select filters, get filter information
  • Domes: Control rotation and shutter
  • Rotators: Control movement, synchronize position

API Documentation

Equipment Control Modules

Camera Operations

  • Image capture with customizable exposure settings
  • Temperature control and monitoring
  • Connection management

Mount Control

  • Slewing to celestial objects
  • Tracking control
  • Parking operations

Focuser Management

  • Position adjustment
  • Temperature compensation
  • Auto-focus capabilities

Filter Wheel Control

  • Filter selection
  • Position information
  • Filter property management

Dome Automation

  • Rotation control
  • Shutter operations
  • Synchronization with mount

Rotator Functions

  • Position adjustment
  • Synchronization
  • Angle management

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "nina_advanced_mcp_api" '{"command":"uv","args":["run","--with","fastmcp,fastapi,uvicorn,pydantic,aiohttp,requests,python-dotenv","fastmcp","run","path/nina_advanced_mcp.py"],"env":{"NINA_HOST":"NINA_IP","NINA_PORT":"1888","LOG_LEVEL":"INFO","IMAGE_SAVE_DIR":"~/Desktop/NINA_Images"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "nina_advanced_mcp_api": {
            "command": "uv",
            "args": [
                "run",
                "--with",
                "fastmcp,fastapi,uvicorn,pydantic,aiohttp,requests,python-dotenv",
                "fastmcp",
                "run",
                "path/nina_advanced_mcp.py"
            ],
            "env": {
                "NINA_HOST": "NINA_IP",
                "NINA_PORT": "1888",
                "LOG_LEVEL": "INFO",
                "IMAGE_SAVE_DIR": "~/Desktop/NINA_Images"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "nina_advanced_mcp_api": {
            "command": "uv",
            "args": [
                "run",
                "--with",
                "fastmcp,fastapi,uvicorn,pydantic,aiohttp,requests,python-dotenv",
                "fastmcp",
                "run",
                "path/nina_advanced_mcp.py"
            ],
            "env": {
                "NINA_HOST": "NINA_IP",
                "NINA_PORT": "1888",
                "LOG_LEVEL": "INFO",
                "IMAGE_SAVE_DIR": "~/Desktop/NINA_Images"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later