jwx-mcp

jwx-mcp

Exposes Justworx devices to AI agents as MCP tools and resources, backed by the public Developer API. Supports local stdio and hosted remote OAuth operation for controlling device IO, rules, and viewing live state.

Category
访问服务器

README

jwx-mcp

The Justworx MCP server — exposes Justworx devices to AI agents (Claude, ChatGPT, agent frameworks) as MCP tools (control) and resources (read-only state), backed entirely by the public Developer API (/api/dev/v1).

It is a thin, standalone client of the Developer API: it calls the gateway over HTTPS, holding no device keys — actuation flows through the gateway to the Justworx platform.

Two run modes, one server core (the tools/resources are transport-agnostic):

  • stdio (src/index.js) — a client (Claude Desktop, etc.) launches it locally with a single jwx_live_ API key. This is the local/desktop path.
  • remote (src/http-entry.js) — a hosted, multi-tenant OAuth 2.1 Resource Server over the MCP Streamable HTTP transport, for clients that can't launch a local process (claude.ai web, ChatGPT connectors). Each caller brings their own OAuth access token; see below.

Tools

Tool What
list_devices List accessible devices (filters: status, productId, online; cursor-paginated).
get_device Full live twin state of one device (IO, rules, network, location).
get_device_events Recent event history (time window + type filter).
set_io Set an IO and hold it. confirm:true waits for a confirmed device reply.
pulse_io Drive an IO for durationMs then revert (momentary actions, e.g. a gate trigger).
set_rule Enable/disable an on-device rule.

Resources

  • justworx://devices — the accessible device list.
  • justworx://devices/{serial} — live state for one device.

Configure & run

The server speaks stdio (how MCP clients launch a local server). It needs a Developer API key — issue one via the portal / the gateway's /manage/keys API.

// Claude Desktop / MCP client config
{
  "mcpServers": {
    "justworx": {
      "command": "node",
      "args": ["C:/Users/Wkyle101/jwx-mcp/src/index.js"],
      "env": {
        "JWX_API_KEY": "jwx_live_…",
        "JWX_API_BASE_URL": "https://dev-api.justworx.com/api/dev/v1"
      }
    }
  }
}

Inspect it locally with the MCP Inspector:

JWX_API_KEY=jwx_live_… npx @modelcontextprotocol/inspector node src/index.js

Remote mode (hosted, OAuth 2.1)

For hosted clients (claude.ai web, ChatGPT connectors) that can't spawn a local process, run the Streamable HTTP server. It is a standard OAuth 2.1 Resource Server: it does not issue tokens, it validates the ones from the OAuth authorization server and forwards each caller's token to the Developer API (the gateway accepts either an API key or an OAuth token). Fully multi-tenant — a fresh server is built per request, bound to that caller's token; no shared key, no cross-tenant state.

npm run start:http     # → http://0.0.0.0:$MCP_HTTP_PORT/mcp
  • Endpoint: POST /mcp (Streamable HTTP, stateless). GET /healthz for liveness.
  • OAuth discovery (so clients self-register + authorize): GET /.well-known/oauth-protected-resource (RFC 9728 → points at the AS) and GET /.well-known/oauth-authorization-server (RFC 8414 mirror). An unauthenticated call returns 401 + WWW-Authenticate: Bearer resource_metadata="…".
  • Tokens must be audience-bound (RFC 8707) to MCP_RESOURCE_URL; scopes map to Developer-API scopes.

Deployment: run this server behind an HTTPS reverse proxy or tunnel and publish it at your resource URL (e.g. mcp.justworx.com). It validates tokens from the OAuth authorization server at https://oauth.justworx.com. The OAuth Resource-Server layer is complete and covered by tests against a stub issuer. See DEPLOY-REMOTE.md.

Config (env)

Var Default Notes
JWX_API_KEY (stdio only) A jwx_live_ Developer API key (local/stdio mode).
JWX_API_BASE_URL https://dev-api.justworx.com/api/dev/v1 Gateway base; point at a local gateway for testing.
JWX_API_TIMEOUT_MS 30000 Per-request timeout.
MCP_HTTP_PORT 8790 Remote server listen port.
MCP_RESOURCE_URL https://mcp.justworx.com This server's public URL = its OAuth resource id (token audience).
OAUTH_ISSUER https://oauth.justworx.com The OAuth authorization server (issuer) whose tokens are accepted.
OAUTH_JWKS_URL <issuer>/.well-known/jwks.json AS JWKS for token validation.

Test

npm test   # node:test — connects a real MCP client over an in-memory transport

Tests drive an actual MCP Client against the server with an injected fake API client; the HTTP client itself is also verified end-to-end against a live jwx-dev-api (mock upstream).

Layout

src/apiClient.js   thin fetch client for /api/dev/v1 (bearer: api key OR OAuth token)
src/server.js      buildServer({client}) — tools + resources (transport-agnostic)
src/config.js      env config (stdio + remote/OAuth)
src/index.js       stdio entrypoint
src/oauth.js       OAuth 2.1 token verifier (JWKS) — Resource Server side
src/http.js        remote app: Streamable HTTP + OAuth discovery + per-request token forwarding
src/http-entry.js  remote entrypoint (npm run start:http)
test/server.test.js  stdio: MCP client ⇄ server over in-memory transport
test/http.test.js    remote: real Streamable-HTTP MCP client + stub AS (JWKS) → authed tool calls

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选