<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mrcnm</title>
    <description>The latest articles on DEV Community by mrcnm (@mrcnm).</description>
    <link>https://dev.to/mrcnm</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3975368%2F40c87ffd-63b1-49b5-8bbb-35d076242786.png</url>
      <title>DEV Community: mrcnm</title>
      <link>https://dev.to/mrcnm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mrcnm"/>
    <language>en</language>
    <item>
      <title>I've been implementing NAND-tree quantum algorithm in Qiskit Python</title>
      <dc:creator>mrcnm</dc:creator>
      <pubDate>Mon, 17 Aug 2026 15:27:06 +0000</pubDate>
      <link>https://dev.to/mrcnm/ive-been-implementing-nand-tree-quantum-algorithm-in-qiskit-python-2lmk</link>
      <guid>https://dev.to/mrcnm/ive-been-implementing-nand-tree-quantum-algorithm-in-qiskit-python-2lmk</guid>
      <description>&lt;p&gt;So, recently I started working with the Qiskit, a python library for quantum computing. Thankfully, it allows to simulate a few qubits on local devices, so I didn't go broke after a few sessions.&lt;/p&gt;

&lt;p&gt;Anyways, there is a model, called NAND trees. A NAND tree is basically a binary tree where every branch combines the two values below it using a NAND gate. The input bits sit at the leaves, and for the script to  work upward until it gets a single value at the root. For a small tree this is easy, but for bigger trees, as more and more values need to be checked, it can get quite computationally expensive.&lt;/p&gt;

&lt;p&gt;So, this is where the quantum computers can help. Instead of calculating from bottom to the top, the tree is turned into a graph and the different routes through it become paths that a quantum state can evolve across. A line, or "runway", is attached to the root of the tree, and the input bits change the connections near the leaves. The output after this operation is different depending on NAND tree, which allows to calculate them.&lt;/p&gt;

&lt;p&gt;I build the tree and runway as one graph, encode the input at the leaves, and send a quantum wave packet toward the tree. The wave spreads across the available paths, interferes, and the amount transmitted or reflected is used to predict the NAND-tree result.&lt;/p&gt;

&lt;p&gt;So, that's what i tried to reproduce in my project. &lt;br&gt;
Although it is still experimental, but prototype works like a pleasure. Although technically unlimited, the algorithm is not implemented perfectly, so there are issues with scalability, but experimental trees for up-to 8 leaves work perfectly! But, the more leaves are added, the more time and resources are required, so sadly it's just an experiment as of now. &lt;/p&gt;

&lt;p&gt;But any feedback will be helpful, as this may allow us to fully reproduce the algorithm!&lt;/p&gt;

&lt;p&gt;here's the project, with the deeper explanation of algorithm too: &lt;a href="https://github.com/mncrftfrcnm/qiskit-nand-tree-implementation" rel="noopener noreferrer"&gt;https://github.com/mncrftfrcnm/qiskit-nand-tree-implementation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
      <category>science</category>
      <category>github</category>
    </item>
    <item>
      <title>I Let Claude Code Control a Crypto Exchange API (Safely)</title>
      <dc:creator>mrcnm</dc:creator>
      <pubDate>Fri, 12 Jun 2026 14:25:26 +0000</pubDate>
      <link>https://dev.to/mrcnm/i-let-claude-code-control-a-crypto-exchange-api-safely-171i</link>
      <guid>https://dev.to/mrcnm/i-let-claude-code-control-a-crypto-exchange-api-safely-171i</guid>
      <description>&lt;p&gt;This sounded like a bad idea at first.&lt;/p&gt;

&lt;p&gt;Not “bad” in the fun startup way. More like: &lt;em&gt;this could accidentally place a real order if I get lazy&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I had been experimenting with Claude Code and API workflows, and eventually I wondered what would happen if I gave it access to a real crypto exchange API. In my case, I was working with the MEXC API.&lt;/p&gt;

&lt;p&gt;That sentence alone probably needs a disclaimer.&lt;/p&gt;

&lt;p&gt;I did &lt;strong&gt;not&lt;/strong&gt; want to build an autonomous trading bot. I did &lt;strong&gt;not&lt;/strong&gt; want to paste API keys into chat. I did &lt;strong&gt;not&lt;/strong&gt; want to tell an AI agent to “go trade for me.” That is not the point of this project.&lt;/p&gt;

&lt;p&gt;What I wanted to test was more specific:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can an AI coding agent safely help with exchange API workflows if the workflow is scoped, dry-run first, and human-approved?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That experiment became this repo:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mncrftfrcnm/mexc-agent-trading-skills" rel="noopener noreferrer"&gt;https://github.com/mncrftfrcnm/mexc-agent-trading-skills&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is still alpha. It is experimental. It is not production-ready. It is not financial advice. It is not affiliated with MEXC.&lt;/p&gt;

&lt;p&gt;But it works.&lt;/p&gt;

&lt;p&gt;And more importantly, it changed how I think about AI agents and dangerous APIs.&lt;/p&gt;




&lt;h2&gt;
  
  
  The scary part is not the model
&lt;/h2&gt;

&lt;p&gt;When people talk about AI agents doing risky things, the conversation usually turns into:&lt;/p&gt;

&lt;p&gt;“Is the model smart enough?”&lt;/p&gt;

&lt;p&gt;That is not the question I care about anymore.&lt;/p&gt;

&lt;p&gt;The better question is:&lt;/p&gt;

&lt;p&gt;“Why does the agent have access to things it does not need?”&lt;/p&gt;

&lt;p&gt;That is where the real danger starts.&lt;/p&gt;

&lt;p&gt;A crypto exchange API is not like a weather API. A bad request does not just return the wrong forecast. Depending on the permissions, it can place orders, cancel orders, read private account data, stream account events, or expose sensitive credentials in logs.&lt;/p&gt;

&lt;p&gt;The model does not need to be malicious for something to go wrong.&lt;/p&gt;

&lt;p&gt;It can simply:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;confuse Spot and Futures&lt;/li&gt;
&lt;li&gt;use the wrong endpoint&lt;/li&gt;
&lt;li&gt;assume the wrong symbol format&lt;/li&gt;
&lt;li&gt;place a live order when you meant dry-run&lt;/li&gt;
&lt;li&gt;print a signed URL while debugging&lt;/li&gt;
&lt;li&gt;mix up base quantity and quote quantity&lt;/li&gt;
&lt;li&gt;skip a confirmation step because your prompt was vague&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are normal developer mistakes.&lt;/p&gt;

&lt;p&gt;The difference is that an AI agent can make them very quickly and very confidently.&lt;/p&gt;

&lt;p&gt;So my goal was not to make Claude Code “autonomous.”&lt;/p&gt;

&lt;p&gt;My goal was to make it useful without giving it too much freedom.&lt;/p&gt;




&lt;h2&gt;
  
  
  My first mistake: too much documentation
&lt;/h2&gt;

&lt;p&gt;At first, I treated the API docs like a normal developer resource.&lt;/p&gt;

&lt;p&gt;I gave the agent a lot of documentation and expected it to figure out the right path.&lt;/p&gt;

&lt;p&gt;That sort of worked for simple things.&lt;/p&gt;

&lt;p&gt;But once the workflow got more specific, the problems became obvious.&lt;/p&gt;

&lt;p&gt;The MEXC API has different areas:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Spot REST
Spot WebSocket
Futures REST
Futures WebSocket
public market data
private account data
signed requests
test orders
live orders
listen keys
positions
balances
order books
rate limits
error responses
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is a lot for one agent to hold in its head for a simple task.&lt;/p&gt;

&lt;p&gt;If I asked something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Prepare a BTCUSDT buy workflow.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the agent had to infer too much.&lt;/p&gt;

&lt;p&gt;Is this Spot or Futures? Market or limit? Test order or live order? Should it check symbol rules first? Should it sign the request? Should it check balances? Should it use base quantity or quote quantity?&lt;/p&gt;

&lt;p&gt;A human developer would ask those questions too.&lt;/p&gt;

&lt;p&gt;The problem was that the agent had too much room to guess.&lt;/p&gt;

&lt;p&gt;That is when I stopped thinking of the documentation as “context” and started thinking of it as “permissions.”&lt;/p&gt;




&lt;h2&gt;
  
  
  The better idea: skills instead of giant docs
&lt;/h2&gt;

&lt;p&gt;The repo is built around a simple idea:&lt;/p&gt;

&lt;p&gt;Do not give the agent the whole API.&lt;/p&gt;

&lt;p&gt;Give it the skill it needs for the current job.&lt;/p&gt;

&lt;p&gt;Right now, the project is split into four main skill areas:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mexc-spot-rest
mexc-spot-websocket
mexc-futures-rest
mexc-futures-websocket
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sounds basic, but it makes a big difference.&lt;/p&gt;

&lt;p&gt;If I am working on a Spot REST task, the agent does not need to think about Futures WebSocket streams.&lt;/p&gt;

&lt;p&gt;If I am reading public market data, the agent does not need private account-stream instructions.&lt;/p&gt;

&lt;p&gt;If I am preparing an order, the workflow should be very different from a read-only ticker query.&lt;/p&gt;

&lt;p&gt;That separation made Claude Code much easier to work with.&lt;/p&gt;

&lt;p&gt;It stopped feeling like I had thrown a giant API manual at the model and hoped for the best.&lt;/p&gt;

&lt;p&gt;It felt more like giving a junior developer a specific runbook.&lt;/p&gt;

&lt;p&gt;That is a much better mental model.&lt;/p&gt;




&lt;h2&gt;
  
  
  What “safe” means here
&lt;/h2&gt;

&lt;p&gt;I am using the word “safe” carefully.&lt;/p&gt;

&lt;p&gt;This project does not magically make live trading safe.&lt;/p&gt;

&lt;p&gt;It does not remove risk.&lt;/p&gt;

&lt;p&gt;It does not mean the agent is always right.&lt;/p&gt;

&lt;p&gt;What it does is add friction in the places where friction should exist.&lt;/p&gt;

&lt;p&gt;For example, a safer workflow should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Use a scoped skill.
2. Start with read-only data.
3. Prepare the request.
4. Run a dry-run.
5. Redact secrets.
6. Show the final action clearly.
7. Ask for explicit human confirmation.
8. Only then consider live execution.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the difference between “Claude Code can help me operate an API” and “Claude Code is randomly controlling my exchange account.”&lt;/p&gt;

&lt;p&gt;The second one is terrifying.&lt;/p&gt;

&lt;p&gt;The first one is useful.&lt;/p&gt;




&lt;h2&gt;
  
  
  I do not paste secrets into chat
&lt;/h2&gt;

&lt;p&gt;This is one of the most important parts.&lt;/p&gt;

&lt;p&gt;The workflow should never require pasting API keys directly into the conversation.&lt;/p&gt;

&lt;p&gt;The repo expects credentials to come from local environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;MEXC_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_api_key_here
&lt;span class="nv"&gt;MEXC_API_SECRET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_api_secret_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That does not mean environment variables are perfect. They can still leak through logs, shell history, screenshots, bad scripts, or careless debugging.&lt;/p&gt;

&lt;p&gt;But it is much better than pasting real credentials into a prompt.&lt;/p&gt;

&lt;p&gt;The rule I follow is simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No real keys in chat.
No secrets in source files.
No .env files committed.
No signed URLs printed for convenience.
No listen keys or private account payloads copied into public places.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This part is boring, but it matters.&lt;/p&gt;

&lt;p&gt;Most security failures are boring right until they become expensive.&lt;/p&gt;




&lt;h2&gt;
  
  
  The API key should not be powerful
&lt;/h2&gt;

&lt;p&gt;Another obvious rule: the API key should have the smallest permissions possible.&lt;/p&gt;

&lt;p&gt;For this kind of experiment, withdrawal permissions should be disabled.&lt;/p&gt;

&lt;p&gt;Actually, for most agent experiments, the first key should probably be read-only.&lt;/p&gt;

&lt;p&gt;There is no reason to start with a key that can trade.&lt;/p&gt;

&lt;p&gt;The progression should be slow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public market data
→ signed read-only account data
→ dry-run order preparation
→ test order where supported
→ tiny live action only after explicit confirmation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Skipping straight to live trading is the fastest way to turn a fun experiment into a postmortem.&lt;/p&gt;




&lt;h2&gt;
  
  
  Dry-runs are the most important feature
&lt;/h2&gt;

&lt;p&gt;The biggest practical improvement was dry-run behavior.&lt;/p&gt;

&lt;p&gt;Before doing anything live, the agent should show what it intends to do.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"symbol"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"BTCUSDT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"side"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"BUY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"MARKET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"quoteOrderQty"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"25"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dry-run"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives me a chance to review the request before it touches the exchange.&lt;/p&gt;

&lt;p&gt;And the review is not just a formality.&lt;/p&gt;

&lt;p&gt;I want to check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is this Spot, not Futures?&lt;/li&gt;
&lt;li&gt;Is the symbol correct?&lt;/li&gt;
&lt;li&gt;Is the side correct?&lt;/li&gt;
&lt;li&gt;Is the amount correct?&lt;/li&gt;
&lt;li&gt;Is this a market order or limit order?&lt;/li&gt;
&lt;li&gt;Is it using quote amount or base amount?&lt;/li&gt;
&lt;li&gt;Is it still in dry-run mode?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent can prepare the request.&lt;/p&gt;

&lt;p&gt;The human should approve the risk.&lt;/p&gt;

&lt;p&gt;That boundary matters.&lt;/p&gt;




&lt;h2&gt;
  
  
  Vague approval should not count
&lt;/h2&gt;

&lt;p&gt;One small thing I added to my own workflow: vague approval is not enough.&lt;/p&gt;

&lt;p&gt;These should not trigger a live trade:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ok
yes
go ahead
looks good
continue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For live actions, the confirmation should repeat the actual action.&lt;/p&gt;

&lt;p&gt;Something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I confirm live Spot market buy BTCUSDT with quoteOrderQty 25 USDT.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Is that annoying?&lt;/p&gt;

&lt;p&gt;Yes.&lt;/p&gt;

&lt;p&gt;That is the point.&lt;/p&gt;

&lt;p&gt;When money is involved, I want the workflow to be slightly annoying.&lt;/p&gt;

&lt;p&gt;A little friction is better than an accidental order.&lt;/p&gt;




&lt;h2&gt;
  
  
  A safer prompt
&lt;/h2&gt;

&lt;p&gt;Here is the kind of prompt I would use with Claude Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use only the mexc-spot-rest skill.

Goal:
Prepare a BTCUSDT Spot market buy using 25 USDT.

Rules:
- Do not place a live order yet.
- Start with a dry-run.
- Do not print API keys, secrets, signatures, listen keys, or private account data.
- Check symbol information and current market data first.
- Check account balance only if credentials are already configured locally.
- Use a test order if supported before any live order.
- Ask for explicit confirmation before live execution.
- Do not treat vague approval as permission to trade.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is much better than:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use the MEXC API to buy BTC.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second prompt leaves too many decisions open.&lt;/p&gt;

&lt;p&gt;The first prompt gives the agent a job, a boundary, and a review process.&lt;/p&gt;




&lt;h2&gt;
  
  
  What worked
&lt;/h2&gt;

&lt;p&gt;The scoped-skill approach worked better than I expected.&lt;/p&gt;

&lt;p&gt;Claude Code was more focused when it did not have to read everything.&lt;/p&gt;

&lt;p&gt;It was easier to guide.&lt;/p&gt;

&lt;p&gt;It was easier to correct.&lt;/p&gt;

&lt;p&gt;And when something went wrong, it was easier to find the source of the mistake.&lt;/p&gt;

&lt;p&gt;If the issue was in Spot REST, I could inspect the Spot REST skill.&lt;/p&gt;

&lt;p&gt;If the issue was in Futures WebSocket, I could inspect that skill.&lt;/p&gt;

&lt;p&gt;That sounds small, but it makes debugging much less painful.&lt;/p&gt;

&lt;p&gt;The agent also became less likely to mix unrelated concepts because the context was smaller.&lt;/p&gt;

&lt;p&gt;Instead of asking it to reason over the whole exchange API, I was asking it to operate inside one lane.&lt;/p&gt;

&lt;p&gt;That made the whole workflow feel more controlled.&lt;/p&gt;




&lt;h2&gt;
  
  
  What still needs work
&lt;/h2&gt;

&lt;p&gt;This is still alpha, and I do not want to oversell it.&lt;/p&gt;

&lt;p&gt;Futures workflows especially need extra caution. Futures are more complicated than Spot. There are positions, leverage, margin modes, liquidation risks, contract rules, and more ways to make painful mistakes.&lt;/p&gt;

&lt;p&gt;Even if the agent prepares something that looks correct, I would not treat Futures live execution as “safe.”&lt;/p&gt;

&lt;p&gt;At this stage, the repo is better viewed as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;an experimental structure for safer agent/API workflows
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;not:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a finished trading framework
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That distinction matters.&lt;/p&gt;

&lt;p&gt;The project is useful, but it still needs testing, review, and hardening.&lt;/p&gt;




&lt;h2&gt;
  
  
  The pattern is bigger than crypto
&lt;/h2&gt;

&lt;p&gt;The part I find most interesting is that this pattern is not really about MEXC.&lt;/p&gt;

&lt;p&gt;It applies to any powerful API.&lt;/p&gt;

&lt;p&gt;Payment APIs.&lt;/p&gt;

&lt;p&gt;Cloud infrastructure.&lt;/p&gt;

&lt;p&gt;GitHub automation.&lt;/p&gt;

&lt;p&gt;Database admin tools.&lt;/p&gt;

&lt;p&gt;Deployment systems.&lt;/p&gt;

&lt;p&gt;Internal dashboards.&lt;/p&gt;

&lt;p&gt;Anywhere an AI agent can affect a real system, the same question comes up:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How much access does the agent actually need?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most of the time, the answer is: less than we give it.&lt;/p&gt;

&lt;p&gt;A good agent workflow should have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scoped context
limited permissions
dry-run mode
clear logs
secret redaction
human approval for dangerous actions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is not as exciting as “fully autonomous AI.”&lt;/p&gt;

&lt;p&gt;But it is much more practical.&lt;/p&gt;




&lt;h2&gt;
  
  
  My checklist now
&lt;/h2&gt;

&lt;p&gt;If I am letting an AI agent near a serious API, this is the checklist I want in place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ] Dedicated API key
[ ] Withdrawal permissions disabled
[ ] IP restrictions if available
[ ] Read-only access first
[ ] Minimal permissions
[ ] No secrets pasted into chat
[ ] No .env files committed
[ ] Sensitive values redacted
[ ] Spot and Futures separated
[ ] REST and WebSocket separated
[ ] Dry-run before live action
[ ] Test order where supported
[ ] Explicit confirmation for live action
[ ] Tiny size only if live testing is necessary
[ ] Manual review of every live request
[ ] Key rotation plan if anything leaks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This checklist does not make the system perfect.&lt;/p&gt;

&lt;p&gt;It just prevents the easiest mistakes.&lt;/p&gt;

&lt;p&gt;That alone is worth it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The repo
&lt;/h2&gt;

&lt;p&gt;The project is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mncrftfrcnm/mexc-agent-trading-skills" rel="noopener noreferrer"&gt;https://github.com/mncrftfrcnm/mexc-agent-trading-skills&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It currently includes skills for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MEXC Spot REST
MEXC Spot WebSocket
MEXC Futures REST
MEXC Futures WebSocket
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It also includes helper scripts, request-signing workflows, WebSocket notes, safety rules, and layouts for Claude / Claude Code / Claude Desktop and Codex-style repository agents.&lt;/p&gt;

&lt;p&gt;Again, this is alpha.&lt;/p&gt;

&lt;p&gt;It is experimental.&lt;/p&gt;

&lt;p&gt;It is unofficial.&lt;/p&gt;

&lt;p&gt;It is not financial advice.&lt;/p&gt;

&lt;p&gt;It is not production trading software.&lt;/p&gt;

&lt;p&gt;But it works as a real example of a better pattern:&lt;/p&gt;

&lt;p&gt;Do not give an AI agent a huge API and hope it behaves.&lt;/p&gt;

&lt;p&gt;Give it a small job, clear boundaries, and a human approval gate.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final thought
&lt;/h2&gt;

&lt;p&gt;Letting Claude Code control a crypto exchange API sounds reckless.&lt;/p&gt;

&lt;p&gt;And it would be reckless if the workflow was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Give it keys.
Give it docs.
Tell it to trade.
Hope nothing breaks.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is not what I built.&lt;/p&gt;

&lt;p&gt;The workflow I want is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Give it a scoped skill.
Limit the key.
Start read-only.
Dry-run first.
Redact secrets.
Ask for confirmation.
Let the human decide.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the difference.&lt;/p&gt;

&lt;p&gt;The future of AI agents is not just about making them more autonomous.&lt;/p&gt;

&lt;p&gt;It is about knowing where autonomy should stop.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>api</category>
      <category>claude</category>
      <category>cryptocurrency</category>
    </item>
    <item>
      <title>Building safer AI-agent workflows for the MEXC trading platform API</title>
      <dc:creator>mrcnm</dc:creator>
      <pubDate>Wed, 10 Jun 2026 11:34:12 +0000</pubDate>
      <link>https://dev.to/mrcnm/building-safer-ai-agent-workflows-for-the-mexc-api-2g1h</link>
      <guid>https://dev.to/mrcnm/building-safer-ai-agent-workflows-for-the-mexc-api-2g1h</guid>
      <description>&lt;p&gt;I’ve been working on a small open-source repo for AI-agent workflows around the MEXC API.&lt;/p&gt;

&lt;p&gt;The project is not meant to be a “trading bot.” The goal is more specific: to give coding agents like Claude Code, Codex-style agents, and similar tools a safer structure for working with live exchange API workflows.&lt;/p&gt;

&lt;p&gt;The first implementation is for MEXC.&lt;/p&gt;

&lt;p&gt;GitHub repo:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mncrftfrcnm/mexc-agent-trading-skills" rel="noopener noreferrer"&gt;https://github.com/mncrftfrcnm/mexc-agent-trading-skills&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What the project is
&lt;/h2&gt;

&lt;p&gt;This repo contains experimental skills/prompts for AI coding agents that work with MEXC API workflows.&lt;/p&gt;

&lt;p&gt;The skills are split into four main areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MEXC Spot REST&lt;/li&gt;
&lt;li&gt;MEXC Spot WebSocket&lt;/li&gt;
&lt;li&gt;MEXC Futures REST&lt;/li&gt;
&lt;li&gt;MEXC Futures WebSocket&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each skill gives an agent a smaller, focused set of instructions instead of making it read a large API reference every time. The repo also includes helper scripts, endpoint recipes, WebSocket notes, and safety rules for handling credentials and live actions.&lt;/p&gt;

&lt;p&gt;In simple terms, the skills can help an agent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;query public market data&lt;/li&gt;
&lt;li&gt;check account information, such as Spot or Futures balances&lt;/li&gt;
&lt;li&gt;see available tokens/assets in an account&lt;/li&gt;
&lt;li&gt;build signed REST requests&lt;/li&gt;
&lt;li&gt;use local API credentials from environment variables&lt;/li&gt;
&lt;li&gt;use dry-runs before sending live requests&lt;/li&gt;
&lt;li&gt;use Spot test orders before live Spot orders&lt;/li&gt;
&lt;li&gt;work with WebSocket streams for market data, order-book updates, and account/order events&lt;/li&gt;
&lt;li&gt;avoid printing API keys, signatures, listen keys, or private account data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main idea is to make unsafe behavior harder by default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I made it
&lt;/h2&gt;

&lt;p&gt;Coding agents are useful when working with APIs, but live trading APIs are different from normal developer APIs.&lt;/p&gt;

&lt;p&gt;If an agent makes a bad request to a normal test API, maybe the request just fails. If it makes a bad request to a trading API, it could place an unwanted order, cancel something, change account or position settings, expose credentials, or leak private account data into logs.&lt;/p&gt;

&lt;p&gt;That is the problem this repo is trying to reduce.&lt;/p&gt;

&lt;p&gt;The project focuses on safer defaults:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;use local environment variables instead of asking users to paste API keys into chat&lt;/li&gt;
&lt;li&gt;prefer dry-runs and read-only requests first&lt;/li&gt;
&lt;li&gt;require explicit confirmation before live authenticated write requests&lt;/li&gt;
&lt;li&gt;redact sensitive values in dry-run output&lt;/li&gt;
&lt;li&gt;separate Spot and Futures workflows&lt;/li&gt;
&lt;li&gt;separate REST and WebSocket workflows&lt;/li&gt;
&lt;li&gt;clearly mark experimental areas, especially Futures live-order workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Repo structure
&lt;/h2&gt;

&lt;p&gt;The repo includes compatibility layouts for different agent environments.&lt;/p&gt;

&lt;p&gt;For Claude / Claude Code / Claude Desktop, there are Claude-ready skill folders.&lt;/p&gt;

&lt;p&gt;For Codex-style repository agents, there is a separate Codex-oriented layout.&lt;/p&gt;

&lt;p&gt;The main skills are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mexc-spot-rest
mexc-spot-websocket
mexc-futures-rest
mexc-futures-websocket
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The REST skills include local helper scripts for request construction and signing.&lt;/p&gt;

&lt;p&gt;The WebSocket skills include workflow notes for public streams, private streams, reconnect behavior, listen keys, order-book updates, and handling sensitive stream data.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Spot REST skill includes
&lt;/h2&gt;

&lt;p&gt;The Spot REST skill focuses on one-off REST API workflows, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;public market data&lt;/li&gt;
&lt;li&gt;server time&lt;/li&gt;
&lt;li&gt;symbol and exchange information&lt;/li&gt;
&lt;li&gt;signed account reads&lt;/li&gt;
&lt;li&gt;balance checks&lt;/li&gt;
&lt;li&gt;Spot test orders&lt;/li&gt;
&lt;li&gt;order lookup&lt;/li&gt;
&lt;li&gt;signed request construction&lt;/li&gt;
&lt;li&gt;dry-run output with sensitive values redacted&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The helper script is designed so an agent can construct and sign requests without manually rebuilding the signing process every time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Spot WebSocket skill includes
&lt;/h2&gt;

&lt;p&gt;The Spot WebSocket skill is for live Spot streaming workflows.&lt;/p&gt;

&lt;p&gt;It includes guidance for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;public trade streams&lt;/li&gt;
&lt;li&gt;ticker and depth streams&lt;/li&gt;
&lt;li&gt;protobuf-based public messages&lt;/li&gt;
&lt;li&gt;listen-key based private streams&lt;/li&gt;
&lt;li&gt;account and order updates&lt;/li&gt;
&lt;li&gt;reconnect behavior&lt;/li&gt;
&lt;li&gt;local order-book recovery&lt;/li&gt;
&lt;li&gt;avoiding listen-key exposure in logs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is meant to give an agent a clear workflow for streaming data instead of mixing WebSocket logic into normal REST tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Futures REST skill includes
&lt;/h2&gt;

&lt;p&gt;The Futures REST skill focuses on Futures API workflows, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;public contract data&lt;/li&gt;
&lt;li&gt;contract details&lt;/li&gt;
&lt;li&gt;server status&lt;/li&gt;
&lt;li&gt;account assets&lt;/li&gt;
&lt;li&gt;position information&lt;/li&gt;
&lt;li&gt;signed Futures requests&lt;/li&gt;
&lt;li&gt;contract metadata checks&lt;/li&gt;
&lt;li&gt;precision and leverage-related information&lt;/li&gt;
&lt;li&gt;safer request patterns for live workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Futures live-order support is still treated as experimental. The repo keeps warnings around Futures private write endpoints because endpoint availability, permissions, and maintenance status can vary.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Futures WebSocket skill includes
&lt;/h2&gt;

&lt;p&gt;The Futures WebSocket skill is for live contract market data and private Futures events.&lt;/p&gt;

&lt;p&gt;It includes guidance for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;public contract streams&lt;/li&gt;
&lt;li&gt;tickers, deals, depth, funding, and price-related streams&lt;/li&gt;
&lt;li&gt;private account, order, and position streams&lt;/li&gt;
&lt;li&gt;ping/pong behavior&lt;/li&gt;
&lt;li&gt;reconnects and resubscriptions&lt;/li&gt;
&lt;li&gt;order-book recovery from snapshots&lt;/li&gt;
&lt;li&gt;redacting private authentication payloads and account data&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is currently tested
&lt;/h2&gt;

&lt;p&gt;The repo currently includes self-tests for the Spot REST and Futures REST request-signing helpers.&lt;/p&gt;

&lt;p&gt;The CI workflow also:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;runs the Spot REST helper self-test&lt;/li&gt;
&lt;li&gt;runs the Futures REST helper self-test&lt;/li&gt;
&lt;li&gt;compiles the Python files&lt;/li&gt;
&lt;li&gt;runs gitleaks secret scanning&lt;/li&gt;
&lt;li&gt;runs TruffleHog verified secret scanning&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means the repo already checks the local helper scripts, Python syntax, and basic secret hygiene in CI.&lt;/p&gt;

&lt;p&gt;Current project status:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spot REST helper signing: self-tested&lt;/li&gt;
&lt;li&gt;Futures REST helper signing: self-tested&lt;/li&gt;
&lt;li&gt;Python files: compile-tested&lt;/li&gt;
&lt;li&gt;Secret scanning: included in CI&lt;/li&gt;
&lt;li&gt;WebSocket workflows: documented and structured as agent skills&lt;/li&gt;
&lt;li&gt;Live trading workflows: guarded by confirmation rules and warnings, not claimed as production-ready&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Safety model
&lt;/h2&gt;

&lt;p&gt;The repo is designed around the idea that agents should not casually perform live trading actions.&lt;/p&gt;

&lt;p&gt;By default, the helper scripts prefer dry-run behavior. Authenticated live non-GET requests require explicit confirmation flags. Sensitive values such as API keys, signatures, and listen keys are treated as private and should not be printed or stored in logs.&lt;/p&gt;

&lt;p&gt;The project also recommends:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;dedicated API keys for this project&lt;/li&gt;
&lt;li&gt;disabled withdrawal permissions&lt;/li&gt;
&lt;li&gt;IP restrictions where possible&lt;/li&gt;
&lt;li&gt;minimum required API permissions&lt;/li&gt;
&lt;li&gt;small test sizes if live testing is ever done&lt;/li&gt;
&lt;li&gt;reviewing every symbol, side, order type, price, quantity, leverage, and account type before any live action&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Important disclaimer
&lt;/h2&gt;

&lt;p&gt;This project is unofficial and not affiliated with MEXC.&lt;/p&gt;

&lt;p&gt;It is not financial advice, investment advice, trading advice, or a recommendation to buy, sell, or hold any asset.&lt;/p&gt;

&lt;p&gt;Live trading APIs can affect real balances, orders, and positions. This repo is meant for developer experimentation and structured agent workflows, not unattended live trading.&lt;/p&gt;

&lt;p&gt;GitHub repo:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mncrftfrcnm/mexc-agent-trading-skills" rel="noopener noreferrer"&gt;https://github.com/mncrftfrcnm/mexc-agent-trading-skills&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>api</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
