Skip to main content

Module mcp

Module mcp 

Source
Expand description

MCP tool functions. Re-exported under post_cortex::mcp so downstream callers writing custom MCP servers can embed them.

Modules§

analysis
Analysis, summaries, insights, and session statistics. Analysis, summaries, insights, and session statistics.
error
Typed error hierarchy for the MCP tool layer. Typed error hierarchy for post-cortex-mcp.
query
Structured and keyword-based queries over session context. Structured and keyword-based queries over session context.
schemas
JSON Schema descriptors for every MCP tool. JSON Schema descriptors for every MCP tool.
search
Semantic and embedding-powered search across sessions. Semantic and embedding-powered search across sessions.
session
Session lifecycle: create, load, checkpoint, list, search, metadata. Session lifecycle: create, load, checkpoint, list, search, and metadata.
update_context
Helpers for recording context updates (single and bulk). MCP-side adapter for context-update writes.
workspace
Workspace CRUD and session-to-workspace membership. Workspace CRUD and session-to-workspace membership.

Structs§

ContextUpdateItem
A single context update item accepted by the bulk-update tool.
EntityItem
Wire shape for an entity carried by an MCP update_conversation_context call. entity_type is a lowercase string from the closed set: technology, concept, problem, solution, decision, code_component. Unknown values fall back to concept server-side.
MCPToolResult
Standardised result envelope for every MCP tool.
RelationItem
Wire shape for a relation between two named entities. relation_type is a lowercase string from the closed set: required_by, leads_to, related_to, conflicts_with, depends_on, implements, caused_by, solves. Unknown values cause the request to be rejected with InvalidArgument.

Enums§

ContextQuery
Typed query descriptors dispatched by query::query_context.
ContextResponse
Typed response payloads returned by query::query_context.
Error
Errors produced by the MCP tool layer.
Interaction
Typed interaction payloads matching MCP interaction_type values.

Functions§

add_session_to_workspace
Add a session to a workspace with a specific role.
bulk_update_conversation_context
Record multiple context updates in a single batch via the canonical service. Items that fail translation or persistence are reported in the response payload — the rest still land, matching the legacy gRPC bulk semantics.
create_session_checkpoint
Create a session checkpoint using the global memory system.
create_session_checkpoint_with_system
Create a session checkpoint using an explicit memory system reference.
create_workspace
Create a new workspace with the given name and description.
delete_workspace
Delete a workspace (sessions are not removed).
enable_embeddings
Check whether the embeddings feature is available and return supported models.
find_related_content
Find content related to a topic within a session (embeddings feature required).
get_all_tool_schemas
Return the full set of MCP tool JSON Schema descriptors.
get_entity_importance_analysis
Analyse entity importance with optional minimum-score and limit filters.
get_entity_network_view
Build a network view of entities and their relationships.
get_key_decisions
Extract a timeline of key architectural and technical decisions.
get_key_insights
Extract the top insights from a session ranked by importance.
get_memory_system
Return the global memory system, lazily initialising it if needed.
get_memory_system_with_config
Create a new memory system from the given configuration.
get_service
Return the cached canonical service, building it from the current memory system if necessary. Both update_conversation_context and bulk_update_conversation_context flow through this — no transport is allowed to bypass the canonical impl.
get_session_statistics
Return detailed statistics about a session’s size and activity.
get_structured_summary
Generate a structured summary of the session with optional filtering.
get_tool_catalog
Return a JSON catalog describing every available MCP tool and its usage.
get_vectorization_stats
Retrieve vectorization statistics for the embedding index (embeddings feature required).
get_workspace
Retrieve workspace details including all associated sessions.
inject_memory_system
Inject a pre-built memory system for daemon mode.
list_sessions
List all sessions via the global memory system.
list_sessions_with_storage
List all persisted sessions using a direct storage reference.
list_workspaces
List all workspaces with session counts.
load_session
Load a session by ID via the global memory system.
load_session_checkpoint
Load a session checkpoint using the global memory system.
load_session_checkpoint_with_system
Load a session from a previously saved checkpoint.
load_session_with_system
Load a session by ID using an explicit memory system reference.
mark_important
Mark a specific context update as important within a session.
query_conversation_context
Execute a typed query against a session via the global memory system.
query_conversation_context_with_system
Execute a typed query against a session using an explicit memory system reference.
remove_session_from_workspace
Remove a session from a workspace.
search_sessions
Search sessions by name or description.
semantic_search
Unified semantic search dispatcher supporting session, workspace, and global scopes.
semantic_search_global
Search across all sessions using AI semantic understanding (embeddings feature required).
semantic_search_session
Search within a single session using AI semantic understanding (embeddings feature required).
update_conversation_context
Record a single context update via the canonical PostCortexService::update_context path.
update_session_metadata
Update the name and/or description of a session.
vectorize_session
Manually trigger embedding vectorization for a session (embeddings feature required).

Type Aliases§

McpResult
Crate-level result alias.