apcore
Define once.
Govern every call.
An embeddable microframework for application capabilities. Define each capability’s contract and apply the same validation, access and approval rules when code or AI agents call it through apcore.
Python · TypeScript · Rust
math.addWhat the runtime governs
The same execution boundary applies whether the call comes from your code or an adapter. Your application supplies caller identity and configures its policies.
Capability contract
Give each module a description, input and output schemas, and behavioral annotations. The runtime validates arguments and results against the contract.
Access and approval
Attach access rules using caller identity and install an approval handler for operations that require a decision before they run.
Execution pipeline
Run module code through middleware and call-chain guards for nested calls, with a shared execution contract across Python, TypeScript, and Rust.
Execution evidence
Inspect structured errors, trace context, and runtime events. Connect those signals to your application’s observability tools.
Try the runtime in your browser
Run the TypeScript SDK with sample data. Compare a valid call, a schema error, and the two outcomes of a configured approval gate.
Pass two numbers to math.add and inspect the returned sum.
{"a":10,"b":5}Run the selected scenario to see the result.Run your first module
Choose a language, install the SDK, and run the complete example locally. Once you see the expected output, connect the same module to MCP.
Open the SDK guideSDK 0.33.0 · Stable example
Python 3.11+
python3 -m pip install apcore==0.33.0from apcore import APCore
client = APCore()
@client.module(id="math.add", description="Add two numbers")
def add(a: int, b: int) -> dict:
return {"sum": a + b}
print(client.call("math.add", {"a": 10, "b": 5}))python3 add.py{'sum': 15}Documentation
Browse all docsCreate a module
Define schemas, register business logic, and call the module from an SDK.
Configure access rules
Attach an ACL and define permissions for callers, roles, and module IDs.
Set up approvals
Mark an approval-required module and configure how the runtime resolves decisions.
Read the protocol spec
Check the common contracts and execution behavior shared by the three SDKs.
Detailed capabilities and configuration
Module contracts
Give each module a stable ID, a description, and input and output schemas. Behavioral annotations such as readonly and requires_approval describe how callers should use it and can inform configured governance rules.
Connect another caller
Expose a capability through apcore-surfaces or integrate it with your application framework.