Skip to main content
Glama
runiwwang-spec

AstroMesh Compass MCP

README.md
# AstroMesh Compass MCP

Minimal production-quality Node.js MCP-style JSON-RPC server for the Battle of the Minds AstroMesh puzzle.

The server exposes five AstroMesh tools over HTTP JSON-RPC 2.0 and is designed to deploy cleanly on Render.com.

## Runtime

- Node.js 18 or newer.
- Express HTTP server.
- Native Node `fetch`; `node-fetch` is included as a dependency per package requirements but is not imported.
- Server-side `.env` loading via `dotenv`.

## Endpoints

### `GET /`

Landing page with:
- Server name and version.
- Endpoint list.
- Tool list.
- Environment status showing whether `ASTROLOGY_API_KEY` is set.
- No secret values.

### `GET /health`

Returns health JSON with ok/version/tools/uptime/env_status.

### `GET /tools`

Returns a JSON array of all five tools with `input_schema`.

### `POST /mcp`

Primary JSON-RPC 2.0 endpoint. Methods: server/info, tools/list, tools/describe, tools/call.

### `GET /mcp`

Browser-friendly JSON-RPC testing endpoint.

## Tools

1. astrology_natal_chart - Free Astrology API
2. astrology_sun_sign - Free Astology API
3. astro_market_pulse - Free Astrology + CoinGecko
4. astro_weather - Free Astrology + Open-Meteo
5. celestial_conditions - All four in parallel via Promise.allSettled

## Upstream timeout

Each upstream call uses an 8 second timeout through `AbortController`.

## JSON-RPC errors

- -32700 parse error.
- -32601 method not found.
- -32602 invalid params.
- -32603 internal error.

## Local development

Install: `npm install`. Copy .env.example` to `.env`, edit, then `npm start`.

## Render deployment

Option A: Blueprint - push to GitHub, New + Blueprint in Render, select repo, add astrology_api_key env.

Option B: Manual Web Service - runtime Node, build npm install, start npm start, env astrology_api_key.

## Security note

`astrology_api_key` is server-side only. Never browser-visible.

## CORS

CORS enabled with `Access-Control-Allow-Origin: *`.