subspace-api
Stateless MCP server providing tools for weather forecasts and alerts, real-time stock quotes, DC Metro rail incidents and arrivals, and live flight tracking, secured with OAuth 2.0.
README
subspace-api
subspace-api is an Express-based RESTful API and stateless Model Context Protocol (MCP) server.
If you are utilizing this API as provided and hosted by us, please be sure to abide by the TOS. Otherwise, you are free to clone and self-host provided you abide by the GNU GPLv3 license, and the TOS will not pertain to you.
Features
- MCP Server — Stateless Model Context Protocol server over HTTP, secured with OAuth 2.0 bearer tokens
- Weather tools — NWS alerts and forecasts via MCP
- Stock quotes — Real-time stock data via MCP (powered by yahoo-finance2)
- DC Metro (WMATA) — Rail incident reports and live arrival predictions; also exposed as MCP tools
- Flight Tracker — Live flight status via AeroDataBox (RapidAPI); TRMNL plugin for e-ink display
- Discord Activity — OAuth token exchange endpoint for Discord activities
Getting Started
With Docker (preferably compose)
Building your own image
docker compose build && docker compose up -d
Pulling from stable releases
docker compose pull && docker compose up -d
Manual build
npm run build && npm run start
Environment Variables
Core (required)
| Env var | Purpose |
|---|---|
API_CLIENT_ID |
OAuth client ID for token introspection against your IdP |
API_CLIENT_SECRET |
OAuth client secret for token introspection |
AUTH_SERVER_URL |
Base URL of the Keycloak (or compatible) authentication server |
AUTH_REALM |
Keycloak realm name used for both incoming clients and the MCP OAuth client |
MCP_SERVER_URL |
The resource server URL — incoming tokens must include this in their audience claim |
Core (optional)
| Env var | Default | Purpose |
|---|---|---|
PORT |
9595 |
Port the server listens on |
LOG_LEVEL |
info |
Logging verbosity (debug, info, warn, error) |
ACTIVE_VERSION |
v1 |
API version prefix (not fully implemented) |
TZ |
— | Container timezone for log timestamps (e.g. America/New_York) |
TRMNL plugin settings
These are required if you are running TRMNL plugins (metro or flight tracker).
| Env var | Required | Purpose |
|---|---|---|
TRMNL_CLIENT_ID |
Yes | OAuth 2.0 client ID provided by TRMNL for your plugin |
TRMNL_CLIENT_SECRET |
Yes | OAuth 2.0 client secret paired with TRMNL_CLIENT_ID |
WMATA_PRIMARY_KEY |
For metro plugin | WMATA API key for DC Metro arrival predictions and incidents |
TRMNL_FLIGHTS_CLIENT_ID |
For flight plugin | OAuth 2.0 client ID for the TRMNL flight tracker plugin |
TRMNL_FLIGHTS_CLIENT_SECRET |
For flight plugin | OAuth 2.0 client secret paired with TRMNL_FLIGHTS_CLIENT_ID |
AERODATABOX_API_KEY |
For flight plugin | RapidAPI key for AeroDataBox (live flight status data) |
TRMNL_DB_PATH |
No | Path to SQLite database file (default: ./trmnl.sqlite) |
TRMNL_IP_ALLOW_PRIVATE |
No | Set to true to bypass TRMNL worker IP allowlist check (useful for local dev) |
Discord activity settings (DEPRECATED ENDPOINT)
| Env var | Purpose |
|---|---|
ACTIVITY_DISCORD_CLIENT_ID |
Discord OAuth client ID for the activity token exchange endpoint |
ACTIVITY_DISCORD_CLIENT_SECRET |
Discord OAuth client secret |
AI Disclosure
Parts of this project were assisted with Claude Code by having it provide examples for implementation. Some parts of the codebase were refactored by Claude Code suggestion to improve efficiency. Unless noted, the code base was largely written by hand. Some parts of implementing the OAuth 2.0 spec were assisted by LLM. Some parts for the TRMNL Flight Tracker logic regarding calculations were assisted by LLM, as with information display, but not generated out of thin air.
It is subspace's responsibility to examine the output of these LLMs for accuracy, implementation detail, and direction.
Disclaimer & Fair Use
This flight tracker contains logos and banners of various airlines and aviation operators.
Fair Use Notice: These images are the property of their respective owners (airlines and operators). They are provided here for educational and identification purposes only (e.g., to identify airlines in flight tracking applications).
- This use is considered Fair Use under copyright law as it is non-commercial, transformative (aggregating for identification), and does not impede the owners' ability to profit from their branding.
- The repository does not claim ownership of any trademarks or copyrighted material.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.