Back to Home

apcore-mcp

Automatic MCP Server & OpenAI Tools Bridge

About

apcore-mcp turns any apcore-based project into both a fully functional MCP (Model Context Protocol) Server and an OpenAI-compatible tool provider — with zero code changes. It auto-discovers all modules in an extensions directory, converts apcore schemas to MCP/OpenAI format, inlines $ref references, maps all 5 apcore annotations to MCP tool annotations, and routes execution through the apcore Executor pipeline (ACL, validation, middleware, timeout). Designed as a language-agnostic specification with a Python reference implementation available.

Features

Zero Intrusion: apcore projects need no code changes, imports, or dependencies
Zero Configuration: Point to an extensions directory, everything is auto-discovered
Three MCP Transports: stdio (default), Streamable HTTP, and SSE
OpenAI Tools Export: Pure dict output with strict mode support, no OpenAI SDK dependency
Schema Conversion: Auto-converts apcore input_schema/output_schema to MCP/OpenAI format
$ref Inlining: Resolves JSON Schema $ref/$defs references for MCP/OpenAI compatibility
Annotation Mapping: Maps all 5 apcore annotations (readonly, destructive, idempotent, etc.)
Error Sanitization: ACL errors and internal errors sanitized; stack traces never leaked
Dynamic Registration: Modules registered/unregistered at runtime reflected immediately
Multi-Language Spec: Language-agnostic specification, Python implementation available

Install

pip install apcore-mcp

Quick Start

from apcore import Registry
from apcore_mcp import serve

# Auto-discover all modules
registry = Registry(extensions_dir="./extensions")
registry.discover()

# Start MCP server (stdio by default)
serve(registry)

# Or export as OpenAI tools
from apcore_mcp import to_openai_tools
tools = to_openai_tools(registry)

Sub-projects

apcore-mcp-python

Python reference implementation of apcore-mcp. 260+ tests, 90%+ coverage.

pip install apcore-mcp

Related Products

apcore

The schema-driven module development framework that apcore-mcp bridges to AI agents.

apflow

Task orchestration framework for AI applications, built on apcore.