Matrix openapi skill

From holon-run/uxc · View interactive version

Matrix openapi skill is an AI agent skill from the GitHub repository holon-run/uxc. Operate Matrix Client-Server API through UXC with a curated OpenAPI schema, bearer-token auth, and homeserver-aware messaging guardrails.

How to use this skill

Skill file

Matrix Client-Server API Skill

Use this skill to run Matrix Client-Server operations through uxc + OpenAPI.

Reuse the uxc skill for shared execution, auth, and error-handling guidance.

Prerequisites

Scope

This skill covers a practical request/response Matrix surface:

This skill does not cover:

Homeserver Base URL

Matrix is homeserver-specific. The endpoint you link must include the Matrix client-server base path:

Do not link only the homeserver origin without /_matrix/client/v3.

Authentication

Matrix Client-Server API uses Authorization: Bearer <access_token>.

Preferred path for OAuth-aware homeservers:

uxc auth oauth start matrix-oauth \
  --endpoint https://matrix.org/_matrix/client/v3 \
  --redirect-uri http://127.0.0.1:8788/callback \
  --client-id <client_id>

uxc auth oauth complete matrix-oauth \
  --session-id <session_id> \
  --authorization-response 'http://127.0.0.1:8788/callback?code=...'

uxc auth binding add \
  --id matrix-oauth \
  --host matrix.org \
  --path-prefix /_matrix/client/v3 \
  --scheme https \
  --credential matrix-oauth \
  --priority 100

Fallback path when you already have an access token:

uxc auth credential set matrix-access \
  --auth-type bearer \
  --secret-env MATRIX_ACCESS_TOKEN

uxc auth binding add \
  --id matrix-access \
  --host matrix.org \
  --path-prefix /_matrix/client/v3 \
  --scheme https \
  --credential matrix-access \
  --priority 100

If your homeserver is not matrix.org, replace the host while keeping the same path prefix. Validate the active mapping when auth looks wrong:

uxc auth binding match https://matrix.org/_matrix/client/v3

Notes:

Core Workflow

  1. Use the fixed link command by default:

uxc link matrix-openapi-cli https://matrix.org/_matrix/client/v3 --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/matrix-openapi-skill/references/matrix-client-server.openapi.json

  1. Inspect operation schema first:
  1. Prefer read validation before writes:
  1. Execute with key/value or positional JSON:

matrix-openapi-cli get:/sync timeout=30000 filter={"room":{"timeline":{"limit":10}}}

matrix-openapi-cli put:/rooms/{roomId}/send/{eventType}/{txnId} '{"roomId":"!abc123:example.org","eventType":"m.room.message","txnId":"uxc-001","msgtype":"m.text","body":"Hello from UXC"}'

  1. For background /sync polling, call uxc subscribe start directly against the homeserver base URL:

Operation Groups

Session / Discovery

Room Reads

User Reads

Messaging

Guardrails

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.