Urgent.News

What's breaking now, across thousands of outlets.

Tech

How I Built a C# MCP Server with Single-Use Order Approvals

Giving an assistant a tool for reading orders is straightforward. Giving it a cancellation tool raises a different question: who authorizes the change? I wanted to explore that boundary without treating a model-generated confirmation as permission. I built dotnet-mcp-orders-server , a small .NET 8 MCP server exposing fictional orders. It offers list, lookup and cancellation tools over stdio.…

Building a C# MCP Server for Single-Use Order Approvals involved creating a small .NET 8 MCP server called dotnet-mcp-orders-server that exposes fictional orders with list, lookup, and cancellation tools over stdio. To ensure proper authorization, cancellation requires an independently recorded approval with a five-minute expiration time.

The project includes 12 tests, all passing in GitHub CI, which exercise the tool methods and approval behavior without establishing an interactive connection with the model. The server exposes three tools: list_orders, get_order, and cancel_order. The cancellation tool accepts only an order ID and requires a valid approval before proceeding.

Approval is recorded outside the conversation by an operator running a separate Python command, which writes an approval file containing the action, order ID, and expiration time in a designated directory. This file is then claimed by the server, validated, and used to cancel the pending order.

The cancellation flow involves checking the order's status and ensuring the approval is valid and not expired. If all conditions are met, the order's status is updated to cancelled, and the server returns the updated order. The server uses a lock to coordinate calls within the service instance and ensures that only pending orders can be cancelled.

The 12 test cases cover various scenarios, including listing orders, reading an order, rejecting unknown IDs, rejecting cancellations without approval, consuming valid approvals, and rejecting cancellations of shipped orders. The tests also include invalid approval cases and unsafe ID inputs to ensure proper error handling and validation.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The Rehearsal Layer — Or, an Escrow You Have Never Opened Is Indistinguishable from No Escrow

Yesterday's piece ended with a test: four items, PASS / FAIL / UNKNOWN, UNKNOWN counts as FAIL. It was a good test as far as it went. It had a hole, and the hole is the whole subject of today.

  • Rehearsal uncovers escrow differences, indistinguishable until needed
  • Drills costly, uncertain benefit, perceived cost outweighs benefit
  • Regular drills improve preparedness, resilience, document results

Does Turtle Trading Still Work? What 6.7 Years Showed

The short version. On the data I have, no: the original Turtle trading rules lost 37.9% on 11 Exness markets and 57.7% on 26, from January 2020 to September 2026, with the code checked three ways.

  • Turtle trading rules underperformed on 37.9% of 11 Exness markets from 2020-2026
  • Long-only trades outperformed in every market group when shorts were removed
  • Turtle system serves as valuable teaching tool despite current effectiveness concerns

More from Wednesday 28 October →