Skip to main content

MCP server for ASCOM astronomy equipment control

Project description

MCP Server for ASCOM

MCP Python PyPI 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: pip install (Simplest)

pip install mcp-server-ascom

Option 2: uvx (No install needed)

uvx mcp-server-ascom

Option 3: From source

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

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.3.tar.gz (22.4 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.3-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mcp_server_ascom-0.2.3.tar.gz
Algorithm Hash digest
SHA256 a965668f30d43608ba3f97fe5936b5e04519331133be938b64f66caf9beeb55a
MD5 67f22b6032c649579804b694e550b98e
BLAKE2b-256 128b8ce516e536e85d3c2552b82e9a98f627bafdecf330f96f7eeaa87ef24fb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_server_ascom-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b4a981b7c66a7e61591f75c9a52f878ebd8142764308371900ec2a3d0188086a
MD5 7b225abd5143f4f2da2a6219529b0b7a
BLAKE2b-256 af6809a947db31606ec78c415df250ee3ab9ff5298390e83296668b63c7825ed

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