AgentPMT
Lean Proof To Code Translator - C Rust Wasm

Lean Proof To Code Translator - C Rust Wasm

Function

Available ActionsEach successful request consumes credits as outlined below.

generate5crverify5crget_targets5crget_task5crlist_tasks5cr

Details

The Lean to Code Translator converts exportable Lean proof programs into auditable C, Rust, or WebAssembly deliverables. Upload a Lean source bundle, choose the entry module and symbol, and get generated code plus a certificate, logs, and a verification bundle so you can preserve provenance, re-run validation, and confirm the artifact still matches the original source under the pinned runtime.

Use Cases

Compile Lean proof programs to C for native integration, Generate Rust exports from pinned Lean proof bundles, Produce constrained Wasm artifacts from Lean proof code, Package code generation runs with certificates and logs, Verify previously generated bundles before shipping or publication, Preserve reproducible build evidence for audits and reviews, Archive proof export bundles for downstream teams

Dynamic MCP Setup

Connect once through AgentPMT Dynamic MCP, then use approved tools from the same agent connection.

30 Second Setup

STDIO connector for Claude Code, Codex, Cursor, Zed, and other LLMs that require STDIO or custom connections.

npm install -g @agentpmt/mcp-routeragentpmt-setup

Hosted Streamable HTTPS

MCP endpoint for browser-based apps like ChatGPT, Claude, Grok, or any time you want a streamable connection with no local install.

https://api.agentpmt.com/mcp

Config Example

Use the hosted endpoint directly in clients that support remote MCP. Store your Bearer token in the client config or secret field.

Full connection guide
{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}

Need client videos, organization controls, audit details, and the full feature overview?

More About Dynamic MCP

About this Product

Compile Lean proofs into auditable code artifacts

Proof Code Compiler starts asynchronous Lean proof export and verification jobs that produce reproducible C, Rust, or WebAssembly artifacts plus the files needed to audit and verify them later.

Read the full Lean input tutorial or download the working example zip.

Async workflow
  1. Call generate or verify. The tool returns a task_id immediately.
  2. Poll get_task with that task ID.
  3. When the task reaches completed, read the result payload for artifact metadata and file IDs.
  4. Use list_tasks to review recent jobs for the current budget.
What to upload for generation

Upload a .zip with a top-level UserProofs/ directory that contains only Lean source files.

user_source.zip
└── UserProofs/
├── Main.lean
├── Helpers.lean
└── Submodule/Util.lean

Do not upload lakefile.lean, lean-toolchain, lake-manifest.json, or .lake/. The platform supplies the pinned Lean toolchain and runtime.

Generate inputs
  1. source_archive_file_id
  2. entry_module, such as UserProofs.Main
  3. entry_symbol, such as exportProgram
  4. target_language: c, rust, or wasm

You may also set use_vendored_runtime for the built-in smoke-test program or adjust timeout_seconds within 10-300 seconds.

Verification inputs

Use the bundle_file_id from a completed generation task. Choose fast to re-check hashes and certificate details, or full to rebuild and compare regenerated output under the pinned runtime.

Task results

Completed tasks can return generated output metadata, a verification bundle, a certificate, a generation log, and normalized source-archive metadata. Keep the bundle file ID if you want to verify the export later.

Frequently Asked Questions

How do I connect this tool to an external agent?

Install commands

npm install -g @agentpmt/mcp-router
agentpmt-setup

Hosted MCP config

{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}

How does an external agent use this tool?

Agent prompt

Use the AgentPMT-Tool-Search-and-Execution tool. First call action 'get_instructions' so you know how to use the tool search interface. Then call action 'get_schema' with tool_id 69cdb31aff055c86b8b8a224 ("Lean Proof To Code Translator - C Rust Wasm"). After reading the schema and any returned instructions, tell me what this tool can do, we are going to be using it

Can I upload `lakefile.lean`, `lean-toolchain`, or my own build configuration?

Does this compile any Lean program?

What do `entry_module` and `entry_symbol` mean?

What do I upload to Proof Code Compiler?

What is the difference between `fast` and `full` verification?

What should I save after a successful generation?

Which target should I choose?

Looking for help integrating AI into your business? Set up a free consultation.