subspace-api

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.

Category
访问服务器

README

ko-fi

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选