Secure Python sandbox for data optimization and Matplotlib rendering via x402 microtransactions.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
This project strictly adheres to the Razorpay Track 01 requirements for AI-agent storefronts:
AI Agents are charged per API call. If the wallet is empty, the FastAPI middleware intercepts the request and throws a graceful 402 Payment Required. If funded, it verifies the crypto token and settles USDC via the Base network.
All sandboxes run inside Azure Container Apps Dynamic Sessions. Code execution is strictly bounded to a 15-second maximum timeout limit enforced by Pydantic models. Malicious memory-clogging scripts are instantly killed.
Every successful and failed transaction generates an immutable AUDIT_RECORD locally, detailing the exact price_usdc, duration_ms, and execution exit code.
Handling base64 image strings in LLM context windows is notoriously unreliable and eats up thousands of tokens. agentic-compute-mcp solves this locally.
When Claude calls generate_plot, the Azure sandbox generates the chart and streams the payload back to the MCP client. The client automatically intercepts the payload, decodes it, and saves it directly to your local machine as optimized_load_trend.pngβcompletely bypassing the LLM context window to prevent token exhaustion.
The Graceful Failure: To meet the Track 01 requirement for agent-to-agent commerce, the backend is designed to fail gracefully. If an agent attempts to execute code without funding, the FastAPI middleware intercepts the payload and throws a clean 402 Payment Required error. This prevents compute theft and allows the agent to automatically reroute to the /verify and /settle endpoints.
The 2 AM Debug: We built a strict 5-second Pydantic execution bound to prevent malicious resource exhaustion. But at 2 AM, our trivial Python test scripts kept timing out. We realized that to guarantee security, Azure Dynamic Sessions provisions a 100% fresh, isolated microVM for every requestβresulting in an 8-second cold-start latency. By bumping the MCP client boundary to 15 seconds, we allowed the sandbox to boot, run the code, and return the result in exactly 5.7 seconds, proving our boundaries worked without suffocating the cloud infrastructure.
You need to run two components: the Backend Server and the MCP Client.
Create a .env file based on .env.example and add your configurations:
Code snippet:
Note: Make sure to replace the path and provide a funded EVM wallet key to allow Claude to process x402 microtransactions.
This server exposes the following endpoints. Agents must evaluate the required capability and cost before invoking.
| Tool | Cost (USDC) | Input | Output | When to use |
|---|---|---|---|---|
execute_code | 0.10 | Valid Python script string. | Text (stdout/stderr). Max return limit 8KB. | Execute arbitrary Python logic, heavy calculations, or data sorting in an isolated Azure sandbox. Do NOT use for local FS operations. |
sanitize_csv | 0.25 | Raw, unformatted CSV string. | JSON array. | Handle null values (converts NaN to null), normalize headers, and drop empty rows prior to modeling. |
optimize_ga | 0.50 | JSON array of numerical data. | Optimized model parameters and MAPE score. | Load forecasting, predictive modeling, or curve fitting. Employs proportional mutation for <1% MAPE accuracy. |
generate_plot | 0.30 | JSON array of coordinates and chart config. | Success string (File saved locally). | Visualize data without hitting token generation limits or requiring local GUI dependencies. |
Copy and paste this snippet into your agent's system prompt or .cursorrules file to enable autonomous tool usage:
MIT License - see LICENSE file for details.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/agentic-compute)<a href="https://allmcps.com/mcp/agentic-compute"><img src="https://allmcps.com/api/badge/agentic-compute?style=directory" alt="Agentic Compute on AllMCPs" /></a>