Skip to main content

MCP server for ASCOM astronomy equipment control

Project description

MCP Server for ASCOM

MCP Python Tests License

Control astronomy equipment through AI. MCP 2025-06-18 compliant.

Features

  • Latest Protocol - Structured outputs. Version negotiation.
  • Any ASCOM Device - Telescopes. Cameras. Focusers. More.
  • Natural Language - "Point at M31" just works.
  • Auto-Discovery - Finds devices. No configuration.
  • Fast - Async everywhere. Never blocks.
  • Secure - OAuth ready. Off by default.
  • Extensible - Add new device types easily.
  • Tested - Full coverage. Type safe.

Installation

Option 1: Using uv (Recommended)

# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone and install
git clone https://github.com/stellarpunk/mcp-server-ascom.git
cd mcp-server-ascom
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e .

Option 2: Using pip with venv

git clone https://github.com/stellarpunk/mcp-server-ascom.git
cd mcp-server-ascom
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e .

Option 3: Quick install script

git clone https://github.com/stellarpunk/mcp-server-ascom.git
cd mcp-server-ascom
./install.sh

Note: The alpyca package (ASCOM library) imports as alpaca in Python code.

Configuration

Claude Desktop

Quick Setup (Recommended)

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "ascom": {
      "command": "uvx",
      "args": ["mcp-server-ascom"]
    }
  }
}

This uses uvx to automatically handle Python environments and dependencies.

Alternative: Direct Installation

pip install mcp-server-ascom

Then use:

{
  "mcpServers": {
    "ascom": {
      "command": "mcp-server-ascom"
    }
  }
}

Running the Server

# Make sure virtual environment is activated
source .venv/bin/activate

# Run the server
python -m ascom_mcp

MCP Inspector (Testing)

npm install -g @modelcontextprotocol/inspector

# With virtual environment
mcp-inspector .venv/bin/python -m ascom_mcp

# Or if mcp-server-ascom is in PATH
mcp-inspector mcp-server-ascom

Usage

You: Connect to my telescope
AI: Found Seestar S50. Connected.

You: Point at the Orion Nebula
AI: Slewing to M42... Done.

Supported Equipment

ASCOM Alpaca devices: Telescopes. Cameras. Focusers. Filter wheels. Domes.

Tools

Find devices: discover_ascom_devices
Control telescope: connect goto goto_object park
Use camera: connect capture get_status

Development

Setup

git clone https://github.com/stellarpunk/mcp-server-ascom.git
cd mcp-server-ascom

# Create virtual environment (choose one)
uv venv                    # Using uv
python -m venv .venv       # Using standard venv

# Activate
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install with dev dependencies
pip install -e ".[dev]"    # or: uv pip install -e ".[dev]"

Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=ascom_mcp

# Run specific test file
pytest tests/test_device_manager.py

See CONTRIBUTING.md for guidelines.

Security

Off by default. Enable OAuth:

cp .env.example .env
# Edit .env: ASCOM_MCP_OAUTH_ENABLED=true
# Restart server

Done. See security.py for options.

Troubleshooting

ModuleNotFoundError: No module named 'alpyca'

The alpyca package installs as alpaca. Use:

from alpaca import discovery  # NOT from alpyca

Virtual Environment Issues

Always activate your virtual environment before running:

source .venv/bin/activate  # Linux/macOS
.venv\Scripts\activate     # Windows

No ASCOM devices found

  1. Ensure devices are powered on and connected to network
  2. Check firewall settings (UDP port 32227 for discovery)
  3. Try manual discovery at known IP:
    curl http://device-ip:11111/api/v1/description
    

License

MIT - see LICENSE

See Also

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_ascom-0.2.0.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_ascom-0.2.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_ascom-0.2.0.tar.gz.

File metadata

  • Download URL: mcp_server_ascom-0.2.0.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcp_server_ascom-0.2.0.tar.gz
Algorithm Hash digest
SHA256 af7b64bbf87b78013c71c4d02e3d65bac31cdda4c7ddafd646921b430c73b1aa
MD5 90d2a4af00b26726cf75151a49dd0014
BLAKE2b-256 04865479d33f683cec36ee217d088194be0887963e004e74a7527ce6fbe36b06

See more details on using hashes here.

File details

Details for the file mcp_server_ascom-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_ascom-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 950a834b7043e3e80d5349f2f97b3af25413662db22f4918b4196113f5565582
MD5 1907ad623ab25f17714fd459c87bc851
BLAKE2b-256 e2734ab991c65dc2fc9df3fd2531666632fbe5d3ce2f780e1aa2211370b6b930

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page