apcore-mcp¶
Build once, invoke by Code or AI. Same modules, same pipeline — an AI caller gets no shortcut.
apcore-mcp turns any apcore-based project into an MCP Server and OpenAI tool provider — with zero code changes to your existing project.
┌──────────────────┐
│ django-apcore │ ← your existing apcore project (unchanged)
│ nestjs-apcore │
│ tiptap-apcore │
│ ... │
└────────┬─────────┘
│ extensions directory
▼
┌──────────────────┐
│ apcore-mcp │ ← just install & point to extensions dir
└───┬──────────┬───┘
│ │
▼ ▼
MCP OpenAI
Server Tools
Installation¶
apcore == 0.34.0, and apcore-toolkit == 0.16.0. The optional [markdown] extra adds Markdown tool descriptions.
Quick Start¶
1. Serve your modules via MCP¶
use apcore::{APCore, ModulePack};
use apcore_mcp::APCoreMCP;
fn serve_pack(core: &APCore, pack: &ModulePack) -> Result<(), Box<dyn std::error::Error>> {
pack.register(core)?;
APCoreMCP::builder().backend(core.executor_arc()).build()?.serve()?;
Ok(())
}
The ModulePack API requires
the Core macros feature. The Rust CLI
serves OpenAPI backends through --from-openapi and rejects --extensions-dir.
# stdio (default)
apcore-mcp --extensions-dir ./extensions
# Streamable HTTP with Explorer UI
apcore-mcp --extensions-dir ./extensions --transport streamable-http --port 8000 --explorer
The commands above use the Python or TypeScript CLI. With the Rust CLI, use
apcore-mcp --from-openapi ./openapi.yaml.
2. Export as OpenAI Tools¶
Python and TypeScript default to strict OpenAI schemas. Rust's positional API
requires an explicit strict argument. Use strict=False in Python or
{ strict: false } in TypeScript to request permissive schemas.
Key Features¶
- 🚀 Zero Intrusion: Your apcore project needs no code changes, no imports, and no extra dependencies.
- 🔍 Auto-discovery: Point to an extensions directory, and everything is automatically discovered and exposed (Python and TypeScript; the Rust bridge needs a
Registryyou build in code — see the Quick Start note). - 🌐 Triple Transport: Supports
stdio(for local LLMs),Streamable HTTP, andSSE. - 🛠️ Tool Explorer: Browser-based UI to browse schemas and test tools interactively (like Swagger UI for MCP).
- 🛡️ Security: Built-in JWT authentication, PEM key support, and runtime approval elicitation.
- 🤖 AI Optimized: Enriched metadata (
x-when-to-use), error sanitization with AI guidance, and strict mode for OpenAI. - 🔄 Dynamic: Reflects module registrations/unregistrations at runtime without restarting.
- 📄 OpenAPI Backend: Point the bridge at an
openapi.jsonand every operation becomes an MCP tool, proxied over HTTP — no apcore project required (0.20+; the first backend source with full Rust parity).
Architecture¶
apcore-mcp acts as a protocol-specific adapter on top of the apcore Registry, mapping its metadata to MCP and OpenAI standards:
| apcore Concept | MCP Mapping | OpenAI Mapping |
|---|---|---|
module_id |
Tool name, verbatim — dots and all (image.resize); overridable via display.mcp.alias |
name (dash-normalized: image-resize) |
description |
Tool description | description |
input_schema |
inputSchema |
parameters |
annotations |
ToolAnnotations hints |
Description suffixes (optional) |
metadata |
_meta fields |
— |
MCP input contract¶
MCP input schemas preserve the module runtime's optionality, nullable values, defaults, references and free-form object behavior across Python, TypeScript and Rust. Arguments pass through unchanged. OpenAI strict schema projection remains specific to OpenAI tool exports. See the factory contract.
Features & Specifications¶
The project is architected as a set of modular features, each with its own specification to ensure consistency across languages:
- Feature Overview — Implementation roadmap & dependencies
- Schema Converter — Reference resolution for AI protocols
- Annotation Mapper — Behavioral hint translation
- Execution Router — Dispatcher for the 11-step pipeline
- Error Mapper — Protocol-compliant error feedback
- MCP Server Factory — Core server builder
- OpenAI Converter — Tool exporter for OpenAI
- Extension Bridge — Wires apcore ExtensionManager into MCP pipeline
- Transport Manager — Stdio/HTTP connectivity
- Registry Listener — Hot-reloading capabilities
- JWT Authenticator — Bearer token security
- Approval Handler — Human-in-the-loop elicitation
- Async Task Bridge — Routes async-hinted modules to apcore's AsyncTaskManager
- Explorer UI — Interactive dev dashboard
- Markdown — Rich Markdown tool descriptions via apcore-toolkit
- System Management Extension —
com.aiperceivable/managementMCP extension (Phase A) - ACL Builder —
mcp.acl→apcore.ACL, with apcore 0.29.0's pattern-array shape closure - OpenAPI Backend — Serve any OpenAPI 3.0/3.1 API as MCP tools
Documentation¶
- Full Documentation Site
- Getting Started Guide — Installation and basic setup
- PRD
- SRS
- Tech Design
Implementations¶
| Language | Repository | Package | Status |
|---|---|---|---|
| Python | apcore-mcp-python | pip install apcore-mcp |
✅ Available |
| TypeScript | apcore-mcp-typescript | npm install apcore-mcp |
✅ Available |
| Rust | apcore-mcp-rust | cargo add apcore-mcp |
✅ Available |
| Go | apcore-mcp-go | — | Planned |
License¶
This project is licensed under the Apache License 2.0. See the LICENSE file for details.