Browser workflow
Sign in as the seeded buyer and run search, evaluation, demo purchase, artifact access, plan, and PR simulation in one page.
Launch guided demoPut a capability check before code generation. Humans and agents use the same requirement records, evidence, organization boundaries, wallet policy, license ledger, and integration workflow.
Find, evaluate, and license a Node capability for commercial modification under $1,500.
Use the browser for the narrative, REST for direct integration, or MCP for tool-calling agents. All three end at the same domain services.
Sign in as the seeded buyer and run search, evaluation, demo purchase, artifact access, plan, and PR simulation in one page.
Launch guided demoAuthenticate with the local organization-scoped key, pass hard constraints, and retain request IDs for audit correlation.
Copy the first requestRun the stdio server locally. Spending tools demand explicit confirmation and remain subject to server-side wallet limits.
Configure MCPFunctionFoundry is a pre-build decision layer and marketplace for immutable, versioned software capabilities. Discovery spans primitives, modules, services, and systems, combining natural-language relevance with hard constraints for runtime, deployment, price, security, maintenance, data sensitivity, and license rights.
Inputs, outputs, runtimes, deployment, permissions, dependencies, and integration metadata.
Tests, findings, benchmarks, SBOM, provenance, maintenance status, and digest.
Hosted access, artifact access, source access, modification, commercial use, and scope.
The shared Zod schema validates fixtures, seller records, database hydration, and API boundaries. JSON Schema Draft 2020-12 is generated from the same source rather than maintained separately.
| Identity | capabilityId, version, slug, seller, maintenance status |
|---|---|
| Behavior | Purposes, features, functional description, typed inputs and outputs |
| Compatibility | Languages, runtimes, frameworks, deployment targets, dependencies |
| Trust | Permissions, data classes, tests, security findings, benchmarks, SBOM claims |
| Commerce | Commercial models, explicit rights, restrictions, scopes, seats, prices |
| Integrity | Artifact digests, builder, revision, signed provenance metadata |
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"schemaVersion": {
"type": "string",
"const": "1.0"
},
"capabilityId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"name": {
"type": "string",
"minLength": 3
},
"slug": {
"type": "string",
"pattern": "^[a-z0-9-]+$"
},
"summary": {
"type": "string",
"minLength": 20
},
"granularity": {
"default": "service",
"type": "string",
"enum": [
"primitive",
"module",
"service",
"system"
]
},
"purposes": {
"minItems": 1,
"type": "array",
"items": {
"type": "string"
}
},
"features": {
"minItems": 1,
"type": "array",
"items": {
"type": "string"
}
},
"functionalDescription": {
"type": "string",
"minLength": 40
},
"inputs": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"contentType": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"required": {
"default": true,
"type": "boolean"
}
},
"required": [
"name",
"contentType",
"description",
"required"
],
"additionalProperties": false
}
},
"outputs": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"contentType": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"required": {
"default": true,
"type": "boolean"
}
},
"required": [
"name",
"contentType",
"description",
"required"
],
"additionalProperties": false
}
},
"runtimes": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"language": {
"type": "string"
},
"runtime": {
"type": "string"
},
"versions": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"language",
"runtime",
"versions"
],
"additionalProperties": false
}
},
"frameworks": {
"type": "array",
"items": {
"type": "string"
}
},
"deploymentTargets": {
"minItems": 1,
"type": "array",
"items": {
"type": "string"
}
},
"dependencies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
},
"optional": {
"type": "boolean"
}
},
"required": [
"name",
"version",
"optional"
],
"additionalProperties": false
}
},
"permissions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"resource": {
"type": "string"
},
"access": {
"type": "string"
},
"reason": {
"type": "string"
}
},
"required": [
"resource",
"access",
"reason"
],
"additionalProperties": false
}
},
"dataClassifications": {
"type": "array",
"items": {
"type": "string"
}
},
"complianceClaims": {
"type": "array",
"items": {
"type": "string"
}
},
"testEvidence": {
"type": "object",
"properties": {
"coveragePercent": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"tests": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"lastRun": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"passing",
"partial",
"failing"
]
}
},
"required": [
"coveragePercent",
"tests",
"lastRun",
"status"
],
"additionalProperties": false
},
"securityEvidence": {
"type": "object",
"properties": {
"criticalFindings": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"highFindings": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"score": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"scannedAt": {
"type": "string"
},
"scanner": {
"type": "string"
}
},
"required": [
"criticalFindings",
"highFindings",
"score",
"scannedAt",
"scanner"
],
"additionalProperties": false
},
"benchmarks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "number"
},
"unit": {
"type": "string"
},
"environment": {
"type": "string"
}
},
"required": [
"name",
"value",
"unit",
"environment"
],
"additionalProperties": false
}
},
"buildBenchmark": {
"type": "object",
"properties": {
"basis": {
"type": "string",
"enum": [
"fixture-directional",
"seller-observed",
"independently-observed"
]
},
"sampleSize": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"referenceTask": {
"type": "string",
"minLength": 10
},
"tokenEstimate": {
"type": "object",
"properties": {
"low": {
"type": "number",
"minimum": 0
},
"high": {
"type": "number",
"minimum": 0
}
},
"required": [
"low",
"high"
],
"additionalProperties": false
},
"agentTimeMinutes": {
"type": "object",
"properties": {
"low": {
"type": "number",
"minimum": 0
},
"high": {
"type": "number",
"minimum": 0
}
},
"required": [
"low",
"high"
],
"additionalProperties": false
},
"humanReviewHours": {
"type": "object",
"properties": {
"low": {
"type": "number",
"minimum": 0
},
"high": {
"type": "number",
"minimum": 0
}
},
"required": [
"low",
"high"
],
"additionalProperties": false
},
"observedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
{
"type": "null"
}
]
},
"methodology": {
"type": "string",
"minLength": 20
},
"confidence": {
"type": "string",
"enum": [
"low",
"medium",
"high"
]
},
"disclosure": {
"type": "string",
"minLength": 20
}
},
"required": [
"basis",
"sampleSize",
"referenceTask",
"tokenEstimate",
"agentTimeMinutes",
"humanReviewHours",
"observedAt",
"methodology",
"confidence",
"disclosure"
],
"additionalProperties": false
},
"integration": {
"type": "object",
"properties": {
"estimatedHours": {
"type": "number",
"minimum": 0
},
"packageManager": {
"type": "string"
},
"configurationNotes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"estimatedHours",
"packageManager",
"configurationNotes"
],
"additionalProperties": false
},
"composition": {
"default": {
"composable": false,
"interface": "http-api",
"compatibleWith": [],
"requires": [],
"contractStability": "stable",
"evidence": "fixture-declared",
"notes": [
"No composition contract was declared for this manifest version"
]
},
"type": "object",
"properties": {
"composable": {
"type": "boolean"
},
"interface": {
"type": "string",
"enum": [
"in-process-function",
"package-library",
"middleware",
"cli",
"http-api",
"event-consumer",
"worker"
]
},
"compatibleWith": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9-]+$"
}
},
"requires": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9-]+$"
}
},
"contractStability": {
"type": "string",
"enum": [
"stable",
"evolving",
"experimental"
]
},
"evidence": {
"type": "string",
"enum": [
"fixture-declared",
"fixture-tested",
"seller-declared"
]
},
"notes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"composable",
"interface",
"compatibleWith",
"requires",
"contractStability",
"evidence",
"notes"
],
"additionalProperties": false
},
"commercialModels": {
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"enum": [
"pay-per-execution",
"licensed-artifact",
"source-license"
]
}
},
"licenseOptions": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"name": {
"type": "string",
"minLength": 1
},
"scope": {
"type": "string",
"enum": [
"execution",
"evaluation",
"individual",
"single-application",
"organization",
"commercial-source",
"enterprise"
]
},
"priceCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"unit": {
"type": "string",
"enum": [
"one-time",
"execution",
"evaluation",
"custom"
]
},
"rights": {
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"enum": [
"hosted-access",
"artifact-access",
"source-access",
"modification",
"commercial-use",
"redistribution",
"evaluation"
]
}
},
"developerSeats": {
"anyOf": [
{
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"restrictions": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"id",
"name",
"scope",
"priceCents",
"unit",
"rights",
"developerSeats",
"restrictions"
],
"additionalProperties": false
}
},
"artifactDigests": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"algorithm": {
"type": "string",
"const": "sha256"
},
"digest": {
"type": "string",
"minLength": 64,
"maxLength": 64
},
"artifactType": {
"type": "string",
"enum": [
"source",
"container",
"package"
]
}
},
"required": [
"algorithm",
"digest",
"artifactType"
],
"additionalProperties": false
}
},
"provenance": {
"type": "object",
"properties": {
"builder": {
"type": "string"
},
"sourceRevision": {
"type": "string"
},
"builtAt": {
"type": "string"
},
"signed": {
"type": "boolean"
}
},
"required": [
"builder",
"sourceRevision",
"builtAt",
"signed"
],
"additionalProperties": false
},
"maintenanceStatus": {
"type": "string",
"enum": [
"active",
"maintenance",
"deprecated",
"revoked"
]
},
"version": {
"type": "string"
},
"seller": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"verified": {
"type": "boolean"
},
"reputation": {
"type": "number",
"minimum": 0,
"maximum": 5
}
},
"required": [
"name",
"verified",
"reputation"
],
"additionalProperties": false
},
"verificationBadges": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"schemaVersion",
"capabilityId",
"name",
"slug",
"summary",
"granularity",
"purposes",
"features",
"functionalDescription",
"inputs",
"outputs",
"runtimes",
"frameworks",
"deploymentTargets",
"dependencies",
"permissions",
"dataClassifications",
"complianceClaims",
"testEvidence",
"securityEvidence",
"benchmarks",
"integration",
"composition",
"commercialModels",
"licenseOptions",
"artifactDigests",
"provenance",
"maintenanceStatus",
"version",
"seller",
"verificationBadges"
],
"additionalProperties": false
}FunctionFoundry is intended to run before substantial code generation. An agent compiles the requirement, searches verified supply, estimates both implementation and integration work, then recommends build, buy, compose, evaluate further, or request approval.
| Level | Decision boundary | Examples | Typical use |
|---|---|---|---|
| Primitive | One independently testable behavior | Parser, validator, retry policy, codec | Compose inside agent-built software |
| Module | Reusable subsystem behind a stable interface | Middleware, adapter pack, library | Integrate into an existing architecture |
| Service | Deployable or hosted capability | Worker, pipeline, gateway, extraction service | Consume by execution or pinned artifact |
| System | Complete domain operating surface | Billing engine, audit control plane | Acquire a larger behavior and ownership boundary |
Do not collapse the comparison to model-token price. A planning report should carry ranges for tokens, agent wall time, tool calls, CI cycles, engineering effort, human review, security work, integration, and maintenance. It should also state model choice, repository assumptions, confidence, and exclusions.
Evaluation, purchase, license price, entitlement, download, integration plan, and audit events.
Integration effort, compatibility, tests, security evidence, and maintenance state.
Broad token, time, CI, review, engineering-effort, and cost ranges with editable assumptions.
Every agent route accepts a signed browser session or bearer key, validates with Zod, applies a rate-limit provider, and returns a request ID. Commerce records are scoped to the authenticated organization.
| Method | Endpoint | Purpose | Effect |
|---|---|---|---|
| POST | /api/agent/build-vs-buy | Compare estimated regeneration cost with verified acquisition options | Read |
| POST | /api/agent/search | Rank capabilities with reasons and warnings | Read |
| GET | /api/agent/capabilities/:id | Read manifest, evidence, price, and rights | Read |
| POST | /api/agent/evaluations | Create an idempotent fixture evaluation | Records usage |
| GET | /api/agent/evaluations/:id | Poll organization-scoped evaluation status | Read |
| POST | /api/agent/purchases | Settle demo funds and issue entitlement | Spends demo funds |
| GET | /api/agent/licenses | List the organization license ledger | Read |
| GET | /api/agent/licenses/:id | Read certificate and artifact entitlement | Read |
| POST | /api/agent/integration-plans | Create a repository-specific plan | Writes record |
| GET | /api/agent/integration-plans/:id | Read plan and optional PR simulation | Read |
This read-only planning call estimates a range instead of claiming exact token metering. It can recommend an option, but purchasing remains a separate confirmed action.
Use Authorization: Bearer ff_demo_buyer_key locally. Persisted keys are stored as SHA-256 digests and resolve to an agent identity and organization. Browser sessions use signed HTTP-only, same-site cookies.
Send a capability ID and up to 20 bounded JSON fixtures with an idempotency key. Memory-only mode completes inline. PostgreSQL mode returns a durable queued record; run pnpm dev:worker and poll the scoped result endpoint.
Pass rate in the top seeded fixture
Compatibility recommendation
Seller executables launched
Prototype boundary: latency and resource values are deterministic estimates. Production execution requires an independently verified isolated worker plane; it remains disabled by default.
A purchase requires confirmPurchase: true plus a unique idempotency key. The server checks listing status, artifact verification, price, wallet balance, transaction limit, daily limit, and organization scope before settlement.
Simulated funds only. This endpoint never moves real money. Optional Stripe test-mode checkout is a separate, disabled-by-default adapter and does not issue a license until an authenticated paid-settlement event arrives.
Successful demo settlement transactionally creates the purchase, transaction, human-readable certificate, issued license, machine entitlement, immutable receipt hash, and audit events. Artifact downloads recheck the entitlement server-side.
Invocation rights only. No package, container, or source access is implied.
Digest-pinned package or container rights, without source modification rights.
Source, modification, and commercial-use rights only when explicitly included.
Prototype license templates are illustrative and have not received legal review.
The planner combines the purchased capability contract with repository language, framework, package manager, deployment environment, dependencies, and architecture summary. It returns likely files, dependencies, variables, migrations, wiring, tests, security considerations, rollback, and effort.
| Fixture target | Acme finance portal · TypeScript · Next.js · pnpm · AWS Lambda |
|---|---|
| Planner | Deterministic provider behind the IntegrationProvider boundary |
| Output | Compatibility assessment, nine implementation sections, hours, and timestamp |
| Pull request | Branch, commits, changed files, patches, tests, and checklist—always labeled simulation |
The TypeScript stdio server in apps/mcp-server delegates to REST. It does not duplicate search, commerce, licensing, or planning logic.
| Tool | Purpose | Spend effect |
|---|---|---|
| compare_build_vs_buy | Build estimate → ranked buy options and savings | No — read only |
| search_capabilities | Purpose and constraints → ranked evidence | No |
| get_capability | Manifest, evidence, pricing, and rights | No |
| compare_capabilities | Compare up to three capability records | No |
| start_evaluation | Start a fixture-based evaluation record | Usage only |
| get_evaluation | Read status and compatibility report | No |
| purchase_capability | Issue a license through the demo wallet | Yes — confirmation required |
| create_stripe_checkout | Create configured hosted test checkout | Reserves budget |
| list_licenses | List organization-owned licenses | No |
| create_integration_plan | Plan against target repository metadata | No |
| get_integration_plan | Read the deterministic plan | No |
Agent purchasing guard: purchase_capability rejects requests unless confirmPurchase: true; the server still enforces organization wallet limits.
Security-sensitive actions append actor type and identifier, organization, target, request ID, timestamp, and structured metadata. Signed outbound webhooks for evaluation completion, license issuance, revocation, and integration status are not implemented in this prototype.