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.2.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.2-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_server_ascom-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 618a2daa3f53b3474a38e8ec68e160235e7a017797a2b59028c3d4f0a957a76a
MD5 bddb1d59b62e8c2f03bf6ad6ff4167ff
BLAKE2b-256 020267241d95cc6b8b3de1baeaae8f73cb5cbd3fa6e2480e07c73ec0e4a37f2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_server_ascom-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 df0e14867a0b4dbffb647e9632ca703e2a9073a102af3278a89806b551e8ef5f
MD5 bf1f8d9ee04e410c6370f24e58e91512
BLAKE2b-256 0d886662c01f5d538f52d862c51bbbad1c4999bc1f1807942c8f97a4df0e7c9f

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