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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_server_ascom-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d49c1ca6e80b687d2617da32e2e56d117edb93ed98f44dfabbf7fa774cd9ed22
MD5 ad89ade688c25fc1ccdc76a3ac0c95db
BLAKE2b-256 0c0dff921a56305e6d5f7243902ae23886c3cac901905a87cff48e69a3501fa3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_server_ascom-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d70cb9e4cc344068190335e8c31f346373a2034d55bfd02297f4d327ca42862d
MD5 32eba26485774983175a027e0300baea
BLAKE2b-256 14aa52450d179e92ddb2577179bffe33c645e3289ba52dc295429789dfd67fbd

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