# OpenFund — Public AI Agent Integration Guide

> Domain: https://dev.openfund.run | Classification: Open Group Public / Non-Adult
> Brand: "Your ambition. Funded." — Find funding. Apply. Grow.

OpenFund is an independent software platform for Portugal and EU grant discovery, deterministic eligibility verification, application drafting, portal handoff, and post-award project execution. OpenFund is **not** a bank, lender, credit intermediary, securities platform, or government agency.

## Quickstart for External AI Agents
1. **Discover real verified open funding calls (no auth required)**:
   `GET https://dev.openfund.run/api/v1/opportunities?status=open,forthcoming&country=PT`
2. **Run deterministic eligibility & integer minor-unit co-financing math (no auth required)**:
   `POST https://dev.openfund.run/api/v1/eligibility/evaluate`
3. **Connect via MCP (Streamable HTTP, `MCP-Protocol-Version: 2025-11-25`)**:
   `POST https://dev.openfund.run/mcp`
4. **Authenticate scoped workspace actions**:
   Create a scoped token (`ofa_<64_hex>`) via `POST https://dev.openfund.run/api/agent/tokens` and send `Authorization: Bearer ofa_...`.

## Registered MCP Tools & Agent Actions (11)
- `openfund.find_opportunities` (scope: `public`, risk: `read_only`): Search and filter real verified open and forthcoming EU and Portugal funding calls with source provenance.
- `openfund.get_opportunity` (scope: `public`, risk: `read_only`): Get full opportunity details, hard program rules, official provenance links, and version history diff.
- `openfund.evaluate_eligibility` (scope: `public`, risk: `read_only`): Run pure deterministic eligibility rules (deadline, entity, NUTS II, EU SME 2003/361/EC, De Minimis EU 2023/2831 €300k, double funding) and integer minor-unit co-financing math.
- `openfund.get_passport` (scope: `passport:read`, risk: `read_only`): Read tenant Funding Passport facts and verified-vs-declared provenance.
- `openfund.create_application_draft` (scope: `applications:draft`, risk: `draft`): Create a new funding application draft for a verified opportunity.
- `openfund.validate_budget` (scope: `applications:read`, risk: `read_only`): Validate application budget lines with integer minor-unit math, co-financing, and double-funding detection.
- `openfund.export_application` (scope: `applications:read`, risk: `read_only`): Export portal-ready application package with SHA-256 bundle digest and official portal handoff URL.
- `openfund.get_application_status` (scope: `applications:read`, risk: `read_only`): Inspect application status, clarification deadlines, and verified external receipts.
- `openfund.plan_funded_project` (scope: `projects:execute`, risk: `writes`): Create a work package and milestone for an awarded funded project.
- `openfund.collect_evidence` (scope: `reporting:draft`, risk: `draft`): Attach verified clean document evidence to a project milestone.
- `openfund.verify_milestone` (scope: `reporting:read`, risk: `read_only`): Check milestone evidence completeness and OpenAudit verification status (distinct from funder acceptance).

## Machine-Readable Endpoints
- OpenAPI 3.1.0: `https://dev.openfund.run/openapi.json`
- Interactive API Docs: `https://dev.openfund.run/api/docs`
- Action Registry: `https://dev.openfund.run/api/agent/v1/actions`
- MCP Server: `https://dev.openfund.run/mcp`
- Agent Card: `https://dev.openfund.run/.well-known/agent-card.json`
- LLMs Summary: `https://dev.openfund.run/llms.txt` & `https://dev.openfund.run/llms-full.txt`
