# proof mcp source first verification

> Generate and verify Lean or TLA+ formal specifications directly from source code using Proof-MCP.

proof mcp source first verification is a paid AI agent skill on Agensi by Yasir Karam, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $5 (one-time purchase)
- Creator: [Yasir Karam](https://www.agensi.io/creators/yasir-karam)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-11-20
- Security: scan passed (2026-11-20); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/proof-mcp-source-first-verification
- Tags: ai-agents, prompt-engineering, research, formal-verification, lean4, tla-plus, software-testing

## About this skill

Formal verification is often inaccessible to developers because it requires writing complex specifications before seeing any results. This skill bridges the gap by generating Lean or TLA+ specifications directly from your source code and running them through the Proof-MCP verification server.

### What it does
- **Source discovery** identifies languages, modules, and candidate verification checks within a repository.
- **Formal modeling** drafts Lean 4 theorems for functional correctness or TLA+ models for concurrency and protocols.
- **Automated checking** executes model-checkers and proof-checkers via MCP to verify safety and liveness properties.
- **Evidence reporting** generates QA reports that separate runtime test results from formal proof evidence.
- **Structural analysis** maps dependencies and cycles to provide context for verification bounds.

### How it works
1. Use `proof_discover_qa` to map the codebase and identify which modules require verification.
2. Provide a specific verification goal to extract the relevant source and structural context.
3. Review the ledger of observed behaviors versus intended properties and approve specific project commands.
4. Generate and check a candidate Lean or TLA+ bundle using the `proof_check_generated` tool.
5. Review the final evidence report which documents passes, failures, and unmodeled gaps.

### Frameworks & tools
This skill requires a connection to a Proof-MCP server. It supports Lean 4 for mathematical proofs, TLA+ with the TLC model checker for state transitions, and Python for property-based testing.

### Why this beats prompting it yourself
Generic prompts often hallucinate proof results or fail to maintain the strict boundary between implementation and abstraction. This skill uses a structured verification workflow that forces explicit documentation of assumptions and prevents the agent from claiming a proof passed without actual checker execution.

### Use cases
- Verify distributed protocols or state machine transitions using TLA+.
- Prove functional invariants and mathematical bounds in critical Lean 4 modules.
- Audit a complex workflow for potential deadlocks or liveness violations.
- Generate a formal QA report for a specific subset of a legacy codebase.

### Known limitations
Requires a configured Proof-MCP server to execute checks. It does not prove that executable source is verified unless a refinement relationship is explicitly modeled.

## Requires

- Proof MCP
- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the proof mcp source first verification skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill make formal verification easier for developers who aren't mathematicians?

Traditional verification requires manual specification writing; this skill automates the translation of your source code into Lean 4 or TLA+ models, allowing you to catch logical flaws and concurrency issues without being a formal methods expert.

### What are the technical requirements to run this skill?

This skill is designed for any AI agent or IDE that supports the Model Context Protocol (MCP). You will also need access to a Proof-MCP server to execute the generated Lean or TLA+ proofs.

### How does this ensure the generated proofs are actually valid?

While generic AI prompts often 'hallucinate' that a proof passed, this skill uses a structured workflow that requires actual verification from the Lean 4 or TLC model checker before reporting a success.

### Do I need to rewrite my code in a specific language to use this?

No, it works with your existing codebase. The `proof_discover_qa` tool maps your repository to identify modules, dependencies, and potential verification targets automatically.

### What is included in the purchase of this skill?

You receive the complete suite of MCP tools for source discovery, formal modeling, and evidence reporting, along with the documentation required to connect it to your verification server.

### Does this skill guarantee that my executable code is 100% bug-free?

The skill generates formal specifications based on your source, but it does not prove the final compiled binary matches the model unless you explicitly define a refinement relationship within the proof.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
