# Mexc Spot Websocket

> MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.

- **Type:** Skill
- **Install:** `agentstack add skill-mncrftfrcnm-mexc-agent-trading-skills-mexc-spot-websocket`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [mncrftfrcnm](https://agentstack.voostack.com/s/mncrftfrcnm)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [mncrftfrcnm](https://github.com/mncrftfrcnm)
- **Source:** https://github.com/mncrftfrcnm/mexc-agent-trading-skills/tree/main/codex_mexc_skills/skills/mexc-spot-websocket

## Install

```sh
agentstack add skill-mncrftfrcnm-mexc-agent-trading-skills-mexc-spot-websocket
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# MEXC Spot WebSocket

## Workflow

Use this skill for streaming, not one-off REST queries. Open `references/streams.md` only for exact stream names and lifecycle details.

1. Use public REST endpoints for snapshots and WebSocket streams for increments.
2. Use `ws://wbs-api.mexc.com/ws` for public Spot streams.
3. For private streams, use `$mexc-spot-rest` to create an API-key-only listen key, then connect to `/ws?listenKey=...`.
4. Do not print or persist listen keys except in local process memory needed for the connection.
5. Reconnect before the 24-hour connection limit and extend listen keys every 30 minutes.
6. Decode current public pushes with MEXC protobuf files.
7. Use REST for initial balances/order books; private streams and depth streams are updates after snapshots.
8. For balance/account snapshots, use `$mexc-spot-rest` quick commands and `python scripts/lookup.py balance` before opening REST or stream references.

## Safety Rules

- Do not request API keys in chat. Use the Spot REST skill for listen-key creation.
- Treat listen keys as temporary secrets.
- Implement exponential backoff on reconnects.
- Respect 100 messages per second and 30 streams per connection.
- For local order books, restart from a REST snapshot when sequence versions gap.

## Verification

Before production code, verify subscription shape, protobuf channel suffixes, depth sequence continuity, and listen-key extension.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [mncrftfrcnm](https://github.com/mncrftfrcnm)
- **Source:** [mncrftfrcnm/mexc-agent-trading-skills](https://github.com/mncrftfrcnm/mexc-agent-trading-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-mncrftfrcnm-mexc-agent-trading-skills-mexc-spot-websocket
- Seller: https://agentstack.voostack.com/s/mncrftfrcnm
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
