Skip to main content

Crate aprender_mcp

Crate aprender_mcp 

Source
Expand description

Model Context Protocol (MCP) server for aprender.

Exposes the apr CLI as MCP tools for Claude Code, Cursor, Cline, and other MCP clients over JSON-RPC 2.0 stdio transport.

Spec: docs/specifications/apr-mcp-server-spec.md. Protocol: MCP v2024-11-05 (https://spec.modelcontextprotocol.io).

§Example

let mut server = aprender_mcp::AprMcpServer::new();
server.run_stdio()?;

§Scope (M1–M3 shipped)

  • M1: initialize + tools/list + the apr.version stub.
  • M2: 7 subprocess wrappers (apr.validate, apr.tensors, apr.bench, apr.qa, apr.trace, apr.run, apr.serve) + FALSIFY-MCP-005/-007 dispatcher gates + Draft-7 schema meta-validation.
  • M3: apr.finetune (8th Phase-1 tool), notifications/cancelled → SIGTERM→SIGKILL for apr.run, build.rs codegen from contracts/apr-mcp-tool-schemas-v1.yaml for both inputSchema (schemas::APR_<TOOL>_SCHEMA) and tool-level description (schemas::APR_<TOOL>_DESCRIPTION, PMAT-514), and opt-in per-line notifications/progress for apr.finetune via params._meta.progressToken (FALSIFY-MCP-PROGRESS-001).

M4 (in progress) promotes FALSIFY-MCP-003/-004 from surface tests to real-model end-to-end; M5 ports the dispatcher to pmcp = "2.3" and extends cancellation to apr.serve.

Re-exports§

pub use server::AprMcpServer;
pub use server::NotificationSink;
pub use types::ContentBlock;
pub use types::InputSchema;
pub use types::JsonRpcError;
pub use types::JsonRpcNotification;
pub use types::JsonRpcRequest;
pub use types::JsonRpcResponse;
pub use types::PropertySchema;
pub use types::ServerCapabilities;
pub use types::ToolCallResult;
pub use types::ToolDefinition;
pub use types::ToolsCapability;

Modules§

schemas
FALSIFY-MCP-008: per-tool JSON Schema + description constants codegen’d at build time from contracts/apr-mcp-tool-schemas-v1.yaml by build.rs.
server
AprMcpServer — JSON-RPC 2.0 dispatcher for aprender MCP tools.
tools
MCP tool implementations for aprender.
types
JSON-RPC 2.0 + MCP protocol types.

Constants§

PROTOCOL_VERSION
MCP protocol version this server implements.
SERVER_NAME
Server identity reported in initialize response.