Releases: aipartnerup/apcore-mcp-python
Releases · aipartnerup/apcore-mcp-python
Release 0.3.0
Added
- trace_id passback: Every successful response now includes a second content item with
_trace_idmetadata for request tracing. - validate_inputs:
serve(validate_inputs=True)enables pre-execution input validation viaExecutor.validate(). Invalid inputs are rejected before module execution. - Always-on Context:
Contextis now always created for every tool call, enabling trace_id generation even without MCP callbacks.
Changed
- SchemaExporter integration:
MCPServerFactory.build_tool()now usesapcore.schema.exporter.SchemaExporter.export_mcp()for canonical MCP annotation mapping instead of duplicating logic. - to_strict_schema() delegation:
OpenAIConverter._apply_strict_mode()now delegates toapcore.schema.strict.to_strict_schema()instead of custom recursive implementation. This adds x-* extension stripping, oneOf/anyOf/allOf recursion, $defs recursion, and alphabetically sorted required lists. - Dependency bump: Requires
apcore>=0.5.0(was>=0.2.0).
Removed
- Custom strict mode: Removed
OpenAIConverter._apply_strict_recursive()in favor ofto_strict_schema().
Release 0.2.0
Added
- MCPServer: Non-blocking MCP server wrapper for framework integrations with configurable transport and async event loop management.
- serve() hooks:
on_startupandon_shutdowncallbacks for lifecycle management. - Health endpoint: Built-in health check support for HTTP-based transports.
- Constants module: Centralized
REGISTRY_EVENTS,ErrorCodes, andMODULE_ID_PATTERNfor consistent values across adapters and listeners. - Module ID validation: Enhanced
id_normalizer.normalize()with format validation usingMODULE_ID_PATTERN. - Exported building blocks: Public API exports for
MCPServerFactory,ExecutionRouter,RegistryListener, andTransportManager.
Fixed
- MCP Tool metadata: Fixed use of
_metainstead ofmetain MCP Tool constructor for proper internal metadata handling.
Refactored
- Circular import resolution: Moved utility functions (
resolve_registry,resolve_executor) to dedicated_utils.pymodule to prevent circular dependencies between__init__.pyandserver/server.py.
Release 0.1.0
Added
- Public API:
serve()to launch an MCP Server from any apcore Registry or Executor. - Public API:
to_openai_tools()to export apcore modules as OpenAI-compatible tool definitions. - CLI:
apcore-mcpcommand with--extensions-dir,--transport,--host,--port,--name,--version, and--log-leveloptions. - Three transports: stdio (default), Streamable HTTP, and SSE.
- SchemaConverter: JSON Schema conversion with
$ref/$defsinlining for MCP and OpenAI compatibility. - AnnotationMapper: Maps apcore annotations (readonly, destructive, idempotent, open_world) to MCP
ToolAnnotations. - ErrorMapper: Sanitizes apcore errors for safe client exposure — no stack traces, no internal details leaked.
- ModuleIDNormalizer: Bijective dot-to-dash conversion for OpenAI function name compatibility.
- OpenAIConverter: Full registry-to-OpenAI conversion with
strictmode (Structured Outputs) andembed_annotationssupport. - MCPServerFactory: Creates MCP Server instances, builds Tool objects, and registers
list_tools/call_toolhandlers. - ExecutionRouter: Routes MCP tool calls to apcore Executor with error sanitization.
- TransportManager: Manages stdio, Streamable HTTP, and SSE transport lifecycle.
- RegistryListener: Thread-safe dynamic tool registration via
registry.on("register"/"unregister")callbacks. - Structured logging: All components use
logging.getLogger(__name__)under theapcore_mcpnamespace. - Dual input: Both
serve()andto_openai_tools()accept either a Registry or Executor instance. - Filtering:
tagsandprefixparameters for selective module exposure. - 260 tests: Unit, integration, E2E, performance, and security test suites.