The MCP package
@aigmented/mcp is not yet published to npm. For now, use the source build from the repository.Setup for Claude Desktop
Add to yourclaude_desktop_config.json:
Setup for Cursor
Add to Cursor’s MCP settings:Environment variables
Available tools
Thirteen tools are exposed by the MCP server, split into four groups.Discovery & Q&A
list_collections
List all available knowledge collections. No parameters.
search_knowledge
Semantic search over the knowledge base.
ask_question
Ask a question and get an AI-generated answer with citations.
get_card_details
Fetch full contents of a card with complete source provenance. Use this when you need to cite where information came from.
Response includes:
card_id,title,statement,knowledge_type,importance_scoresource_documents— array of{id, name}for every document the card was generated frompage_numbers— flat array of all source page numbers (across all docs; the schema doesn’t track per-doc page mapping)section_context— section path inside the source document (e.g."Chapter 3 / Vacations")related_header— nearest header in the source documentverbatim_content— exact quote from the source, when applicable (forms, templates, legal text)source_card_ids— Phase 2 intermediate cards (deeper traceability)related_card_ids— up to 5 graph-derived neighbors (empty if no graph)created_at,updated_at
source_document (the first entry of source_documents plus a page_range like "12-14").
Knowledge graph navigation
These tools require that the collection has a built knowledge graph. Collections without a graph will return a409 error with a guiding message — use retrieve_for_topic or search_knowledge instead.
describe_collection
Returns collection statistics, graph-built flag, and a preview of top clusters. Call this first to understand what’s available before running more expensive tools.
Returns:
{ total_cards, has_graph, total_clusters, total_entities, top_clusters }.
list_clusters
Lists all knowledge graph clusters (topics / communities) in a collection.
Each cluster contains: id, llm_name, llm_description, card_count, and up to 5 top_entities. Use this to get a structured view of “what topics exist in this collection”.
get_cluster
Full detail of a single cluster: cards (with 200-character previews), entities, and related clusters.
list_entities
Top entities (people, organizations, concepts) in the collection, with card counts.
get_gaps
Knowledge gaps: isolated entities (appearing in only one card with few relations) and undersized clusters. Useful for identifying coverage problems before generating content.
Content retrieval
retrieve_for_topic
The key tool for content creation. Runs the same retrieval pipeline that Aigmented’s auto-wiki uses internally: embedding search → importance filter → deduplication → Cohere reranking. Returns the most relevant cards for a given topic, ready to feed into your agent’s synthesis step.
Returns cards as
{ card_id, title, statement, importance_score, knowledge_type }.
Card-level browsing
Use these when you want to enumerate, bulk-fetch, or explore semantic neighborhoods of individual cards — without going through the retrieval pipeline.list_collection_cards
Flat paginated browse of all cards in a collection. No query needed. Useful for “show me what’s in this collection” overviews.
Returns:
{ cards: [{card_id, title, statement, knowledge_type, importance_score}], total_count, offset, limit, has_more }. Statement truncated to 200 chars — call get_card_details for full content.
get_cards_batch
Fetch full details of multiple cards in one call (up to 25 IDs). Use after search_knowledge / retrieve_for_topic when you need full content of several cards — avoids N round-trips.
Returns:
{ cards: [...], not_found: [ids] }.
get_related_cards
Find cards semantically similar to a given card. Use to build topical clusters around a single card (e.g. for quiz generation: “5 cards most related to card X”).
Returns:
{ source_card_id, related: [{card_id, title, statement, similarity_score}] }. Does not require a graph.
Building content with MCP — a cookbook
The new tools let your agent replicate what Aigmented’s auto-wiki does internally — navigating the graph and pulling topic-scoped sources — while keeping synthesis in your agent’s hands. Some common patterns:1. “Summarize what we know about X”
2. “Generate a training section on onboarding”
3. “What people appear in our knowledge base?“
4. “Where are our knowledge gaps?“
5. “Build a quiz around this specific card”
6. “Browse all cards in a collection and pick what’s relevant”
Tips
- Always start with
describe_collectionon a fresh collection. It tells your agent whether graph tools are available and gives an at-a-glance map of topics. - Prefer
retrieve_for_topicoversearch_knowledgefor content generation — it runs the fuller pipeline (importance filter + dedup + rerank) that produces cleaner source sets. get_card_detailsis cheap — once your agent has a card_id from any other tool, pulling the full card is lightweight.- Cost note:
retrieve_for_topicuses Cohere embedding + reranking (paid). Defaulttop_k=25is a good balance. Settingrerank=falseskips the rerank if you’re cost-sensitive.
HTTP mode (LibreChat)
For LibreChat or other HTTP-based MCP clients, run the HTTP server:MCP_PORT) with the MCP Streamable HTTP transport at /mcp.