MCP Tools Reference

MCP Tools Reference

Awareness exposes 6 MCP tools that any AI agent (Claude, GPT, Cursor, etc.) can call over the MCP protocol.

Note: Awareness is not just an MCP server — it ships with workflow rules that teach your IDE agent to use memory proactively (auto-init, auto-recall, auto-record). See the Quick Start for setup instructions that include both MCP config and behavioral rules.


Quick Overview

ToolPurposeWhen to Use
__awareness_workflow__Workflow checklist (callable)Call when unsure what to do next — returns step-by-step checklist
awareness_initInitialize session + load memory contextFirst call every session
awareness_get_agent_promptFetch full activation prompt for a sub-agent roleBefore spawning a sub-agent
awareness_recallSemantic + keyword hybrid searchTargeted question / lookup
awareness_lookupStructured data retrieval (no vector search)Tasks, knowledge, risks, timeline, rules, graph, agents
awareness_recordAll write operationsRecord events, batch save, update tasks

1. awareness_init(source="claude-code")           ← load state + get session_id (ALWAYS first)
2. awareness_recall(semantic_query="...", keyword_query="...")  ← search past context before working
3. awareness_record(content="WHAT/WHY/OUTCOME")   ← after EVERY code edit, decision, bug fix
4. awareness_record(content=[step1, step2, ...])   ← session-end batch summary

Tool Reference

awareness_init

Call ONCE at session start. Returns session_id, recent narratives, open tasks, and top knowledge cards.

Essential parameters:

ParameterTypeDefaultDescription
sourcestring""Tool source label (e.g. "claude-code", "cursor").
memory_idstringenv varTarget memory ID. Auto-resolved from environment.

Response highlights:

{
  "session_id": "abc-123",
  "context": {
    "recent_days": [{ "date": "2026-03-15", "narrative": "..." }],
    "open_tasks": [{ "id": "...", "title": "...", "priority": "high" }],
    "knowledge_cards": [{ "id": "...", "category": "decision", "title": "..." }],
    "synthesized_rules": { "rules": ["..."] }
  },
  "agent_profiles": [{ "agent_role": "developer_agent", "title": "Developer" }],
  "active_skills": [{ "title": "Code Review", "summary": "...", "methods": ["Step 1..."] }]
}
  • session_id — pass to all subsequent awareness_record calls.
  • active_skills — reusable skill prompts pre-loaded at session start. No extra recall needed for known procedures.
  • synthesized_rules — behavioral rules auto-generated from accumulated knowledge cards.
  • _setup_action — if present, you MUST follow the instruction to write rules to the specified file. This enables persistent memory for all future sessions.

agent_profiles contains only lightweight summaries. Use awareness_get_agent_prompt to fetch the full prompt when spawning a sub-agent.

All parameters
ParameterTypeDefaultDescription
memory_idstringenv varTarget memory ID. Auto-resolved from environment.
sourcestring""Tool source label (e.g. "claude-code", "cursor").
daysint7Days of narrative history to look back (1–90).
max_cardsint20Maximum knowledge cards to include.
max_tasksint20Maximum open tasks to include.
user_idstring""User filter for multi-user memories.
agent_rolestring""Agent role identifier.
client_capabilitiesstring""Optional advisory string such as "file_write,local_dir".
rules_versionstring""Version of rules you already have. If current, _setup_action is skipped.

awareness_get_agent_prompt

Fetch the full activation prompt for a specific agent role. Use immediately before spawning a sub-agent.

1. awareness_init() → agent_profiles: [{ agent_role, title, when_to_use }, ...]
2. Identify which role matches the task
3. awareness_get_agent_prompt(agent_role="developer_agent") → { activation_prompt: "..." }
4. Spawn sub-agent with activation_prompt as its system prompt
ParameterTypeDefaultDescription
agent_rolestringrequiredThe agent role key (e.g. "developer_agent").
memory_idstringenv varTarget memory ID.

Returns: { agent_role, title, activation_prompt, system_prompt }


awareness_recall

Search memory for relevant context. Primary mid-session read tool.

Before calling — rewrite the query:

  1. SEMANTIC_QUERY: Expand into a full natural-language question with context.
    • "auth bug""authentication bug in login flow, JWT token handling, session management"
  2. KEYWORD_QUERY: Extract 2–5 precise terms for full-text matching.
    • "auth.py JWT session_cookies OAuth2 login"

Essential parameters:

ParameterTypeDefaultDescription
semantic_querystringrequiredExpanded natural-language question for vector search.
keyword_querystring""2–5 precise terms for keyword matching. Auto-extracted if empty.
scopestring"all"all | timeline | knowledge | insights
recall_modestring"hybrid"hybrid | auto | precise | session | structured

Recall modes:

ModeDescriptionTokensSpeed
hybridDefault. Structured data + top-K vector results in parallel~2-4k~200ms
autoVector search first, supplements with structured data if weakVariable~200ms
preciseChunk reconstruction only — targeted vector search~500-2k~150ms
sessionExpands matched chunks to full session histories~2-8k~300ms
structuredZero-LLM DB-only: verified/unverified cards + narratives + tasks~1-2k<50ms

Scope layers:

ScopeContentUse When
allEverything (default)General search
timelineSession events, steps, decisions"What happened last week?"
knowledgeUploaded docs, ingested content"What does the spec say?"
insightsCompressed session summaries"Overview of past work"
All parameters
ParameterTypeDefaultDescription
semantic_querystringrequiredExpanded natural-language question for vector search.
keyword_querystring""2–5 precise terms for keyword matching. Auto-extracted if empty.
memory_idstringenv varTarget memory ID.
scopestring"all"all | timeline | knowledge | insights
limitint6Maximum results (1–30).
vector_weightfloat0.7Weight for vector (semantic) search (0–1).
bm25_weightfloat0.3Weight for full-text keyword search (0–1).
recall_modestring"hybrid"hybrid | auto | precise | session | structured
reconstruct_chunksbooltrueStitch adjacent chunks back into complete context (3-4x token lift).
confidence_thresholdfloatnullMin confidence for cards (0.0–1.0).
include_raw_chunksboolfalseInclude raw vector chunks alongside reconstructed results.
user_idstring""User filter for multi-user memories.
agent_rolestring""Agent role filter.
session_idstring""Filter to specific session.
multi_levelboolfalseEnable multi-level retrieval for broader context.
cluster_expandboolfalseEnable topic-based context expansion.
include_installedbooltrueAlso search memories installed from the marketplace.
detailstring""Progressive disclosure mode: "summary" for lightweight index (~80 tokens each), "full" to expand specific ids. Empty = legacy mode.
idsarraynullItem IDs to expand (used with detail="full", from a prior detail="summary" call).
token_budgetint0[DEPRECATED] Context assembly token budget. 0 = auto (typically 4000-16000 tokens). Use detail for progressive disclosure instead.
metadata_filterobjectnullAdditional metadata filters (e.g. {"source": "cursor"}).

awareness_lookup

Get structured data from memory — no vector search, pure DB lookup (<50ms).

Essential parameters:

ParameterTypeDefaultDescription
typestringrequiredSee type reference table below.
memory_idstringenv varTarget memory ID.

Type reference:

TypeReturnsUse When
contextNarratives + tasks + cards + rulesSession start overview
tasksOpen/in-progress action itemsTask pickup
knowledgeStructured knowledge cardsCheck known solutions, decisions, patterns
risksActive risks and mitigationsRisk review
session_historyFull chronological event logDeep session inspection (requires session_id)
timelinePaginated activity timelineRecent activity review
handoffCompact briefingTool/session handoff
rulesSynthesized behavioral rulesGet auto-generated rules
graphKnowledge graphEntity relationships and adjacency
agentsAgent profiles listGet all configured agent roles
All parameters
ParameterTypeDefaultDescription
typestringrequiredSee type reference table.
memory_idstringenv varTarget memory ID.
daysint7Days to look back (for context type).
querystring""Keyword filter for knowledge cards.
categorystring""Category filter for knowledge cards.
statusstring""Status filter (pending, in_progress, completed).
prioritystring""Priority filter for tasks (high, medium, low).
include_completedboolfalseInclude completed tasks.
levelstring""Risk level filter (high, medium, low).
session_idstring""Session ID for session_history type (required).
limitint50Maximum items to return.
offsetint0Pagination offset.
user_idstring""User filter for multi-user memories.
agent_rolestring""Agent role filter.

awareness_record

Write to memory. Handles all write operations.

Essential parameters:

ParameterTypeDefaultDescription
contentstring/listnullString for single event, array for batch.
session_idstring""Session ID from awareness_init.
insightsobjectnullStructured insights (knowledge_cards, action_items, risks, entities, relations). Recommended — processes events and insights in one call.

Usage patterns:

Store a single event

{ "content": "Decision: Switched auth from JWT to session cookies. Reason: simpler refresh logic. Affected: backend/auth.py, frontend/lib/auth.ts." }

Content quality: Include ALL of: WHAT happened · WHY it matters · OUTCOME · FILES affected.

Bad examples: "Updated auth" / "Fixed bug" / "Tests pass" (too vague)

Store multiple events (batch)

{
  "content": [
    "Session summary: Added user authentication with JWT tokens",
    "Files changed: auth.py, middleware.py, login.tsx",
    "Decisions: Chose bcrypt over argon2 for password hashing (wider library support)",
    "TODO: Add rate limiting to login endpoint"
  ]
}

Ingest external content

Set content_scope="knowledge" to store documents/specs in the knowledge layer (separate from timeline events).

Update task status

Use action="update_task" with task_id (from awareness_lookup(type="tasks")) and status.

All parameters
ParameterTypeDefaultDescription
contentstring/listnullString for single event, array for batch.
insightsobjectnullStructured insights. Include knowledge_cards, action_items, risks, entities, relations.
actionstring"write"Write action type. Use "update_task" for task status updates.
memory_idstringenv varTarget memory ID.
session_idstring""Session ID from awareness_init.
scopestring"timeline"timeline | knowledge — layer for ingested content.
task_idstring""Task ID for update_task.
statusstring""New status for update_task (completed, in_progress, pending).
sourcestring""Source label.
actorstring""user | assistant | tool | system. Auto-detected.
event_typestring""Auto-detected from text.
metadataobjectnullAdditional metadata per event.
metadata_defaultsobjectnullDefault metadata for all events.
user_idstring""User identifier for multi-user memories.
agent_rolestring""Agent role identifier.
generate_summarybooltrueGenerate session summary for batch writes (2+ events).
max_eventsint800Max events for history import (capped at 5000).

Advanced Topics

Insight Extraction

When you pass content to awareness_record, the system can automatically extract structured insights — knowledge cards, action items, risks, and entity relationships.

Recommended: Pass insights directly in your awareness_record call to process events and insights in a single call.

Alternative: If you don't pass insights, the response may include an _extraction_instruction. Process it with your LLM, then call awareness_record(insights=<result>). The server handles deduplication, conflict detection, and evidence scoring automatically.

14 auto-detected categories:

GroupCategories
Engineeringdecision, workflow, problem_solution, pitfall, insight, skill, key_point
Personalpersonal_preference, important_detail, plan_intention, activity_preference, health_info, career_info, custom_misc

The system also auto-detects status (open, resolved, in_progress, noted) and performs conflict detection against existing knowledge cards (new, update, duplicate, contradiction).


IDE Rules Auto-Injection

When awareness_init is called with a recognized source, the response includes setup_hints.ide_rules — a structured contract for syncing workflow rules to the IDE's rules file.

Supported IDEs:

IDESource ValueRules File
Claude Codeclaude-codeCLAUDE.md
Cursorcursor.cursor/rules/awareness.mdc
Windsurfwindsurf.windsurfrules
Clinecline.clinerules
VS Code Copilotcopilot.github/copilot-instructions.md
CodexcodexAGENTS.md
Kirokiro.kiro/steering/awareness.md
Traetrae.trae/rules/awareness.md
JetBrainsjetbrains.junie/guidelines.md

Alternative: For deterministic sync without MCP, run:

npx @awareness-sdk/setup              # auto-detect IDE
npx @awareness-sdk/setup --ide cursor # force specific IDE