AI Agents are only as good as the tools they can use. But why is it so hard to connect our code to an LLM?
Right now, the ecosystem is fragmenting. Everyone is building custom MCP servers or manually writing massive JSON schemas just to let an AI call a simple Python function. In this post, I'll introduce apcore, a new framework designed to solve the root cause of the "AI Integration" problem.
The Problem: The "Documentation Gap"
Traditional modules are built for code to call, not AI. AI Agents need Schema and Intent. When we manually map our functions to JSON schemas for OpenAI or Anthropic, we create a maintenance nightmare.
The Solution: apcore
apcore is a universal module development framework that enforces a "Schema-First" approach. Every module you build becomes inherently AI-Perceivable.
It’s not just a wrapper—it's a complete protocol with identical SDKs in Python and TypeScript.
[ Application Layer ] Django / Flask / NestJS / Tiptap ...
|
[ Core Layer ] apcore (Capability Registry & Executor)
|
[ Protocol Layer ] /------|------\
MCP A2A Future-Protocols
| |
[ AI Layer ] LLMs Other-Agents
4 Ways to Integrate
The best part? You don't have to rewrite your app. You have four options:
The Decorator (1-line change): Add @module(id="email.send") to a function, and apcore infers the JSON schema from your type hints.
The Function Call: Pass an existing method to module(service.send) without touching the source code.
YAML External Bindings (Zero Code): Have a massive legacy system? Write a YAML file to map it to apcore. Zero code modification.
Class-based Modules: For heavy-duty tools with complex validation.
Truly Protocol Agnostic
Once you build an apcore module, you standardize how your logic is described. This makes it natively compatible with:
MCP (Model Context Protocol): Expose it to Claude or Cursor with zero work.
A2A (Agent-to-Agent): Ready for standardized cross-agent tool calls.
OpenAI Tools: Export standard tool definitions for ChatGPT or custom assistants.
REST/CLI: Your logic is also a web API or a command-line tool by default.
Three-Layer Metadata
apcore gives AI everything it needs to know:
Core Layer: input_schema, output_schema, and description.
Annotation Layer: Type-safe behavioral flags. Add destructive=True or requires_approval=True to a module, and the AI will know it shouldn't execute it without asking the user first.
Extension Layer: LLM intent hints (like x-when-to-use).
The Execution Pipeline (Enterprise Safety)
apcore isn't just about schemas; it manages execution. Every tool call goes through:
Default-Deny ACL: e.g., only allow api.* modules to call executor.* modules. Prevent AI agents from accidentally going rogue in your backend.
Onion-Model Middleware: Easily add custom hooks for caching or rate-limiting.
Context & Tracing: A Context object propagates W3C trace_id across your entire call chain.
🚀 The "Zero Glue Code" Multiplier: apcore-mcp
While apcore is protocol-neutral, we provide first-class bridges. apcore-mcp turns your apcore registry into a full Model Context Protocol (MCP) server instantly:
pip install apcore-mcp
python -m apcore_mcp --extensions-dir ./your_modules
Boom. You have an MCP server, complete with a built-in Tool Explorer UI.
🛡️ Built for the Future: NIST 2026 RFI Compliance
Security isn't an afterthought in apcore; it's the foundation. Our framework is one of the first to provide a production-ready implementation for the 2026 U.S. Federal Government RFI on AI Agent Security.
Here is how apcore maps to the NIST requirements:
Blast Radius Control: Use our pattern-based ACL to ensure agents only access the specific tools they need (Least Privilege).
Human-in-the-Loop (HITL): Modules annotated with requires_approval=True automatically trigger safety gates for high-impact actions.
Auditability: Every agent action is logged and traced with a W3C-compliant trace_id, allowing you to reconstruct the exact "trajectory" of an agent's decisions.
Input/Output Validation: Mandatory schemas act as a firewall, preventing prompt injection from turning into malicious tool parameters.
Conclusion
Building for AI shouldn't mean double the work—or double the risk. With apcore, you standardize how your modules are built, and expose them anywhere safely.
Check out the docs: https://apcore.aipartnerup.com/
GitHub: https://github.com/aipartnerup
Python SDK: https://github.com/aipartnerup/apcore-python
TypeScript SDK: https://github.com/aipartnerup/apcore-typescript
Top comments (0)