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
| Tool | Purpose | When to Use |
|---|---|---|
__awareness_workflow__ | Workflow checklist (callable) | Call when unsure what to do next — returns step-by-step checklist |
awareness_init | Initialize session + load memory context | First call every session |
awareness_get_agent_prompt | Fetch full activation prompt for a sub-agent role | Before spawning a sub-agent |
awareness_recall | Semantic + keyword hybrid search | Targeted question / lookup |
awareness_lookup | Structured data retrieval (no vector search) | Tasks, knowledge, risks, timeline, rules, graph, agents |
awareness_record | All write operations | Record events, batch save, update tasks |
Recommended Workflow
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:
| Parameter | Type | Default | Description |
|---|---|---|---|
source | string | "" | Tool source label (e.g. "claude-code", "cursor"). |
memory_id | string | env var | Target 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 subsequentawareness_recordcalls.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_profilescontains only lightweight summaries. Useawareness_get_agent_promptto fetch the full prompt when spawning a sub-agent.
All parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
memory_id | string | env var | Target memory ID. Auto-resolved from environment. |
source | string | "" | Tool source label (e.g. "claude-code", "cursor"). |
days | int | 7 | Days of narrative history to look back (1–90). |
max_cards | int | 20 | Maximum knowledge cards to include. |
max_tasks | int | 20 | Maximum open tasks to include. |
user_id | string | "" | User filter for multi-user memories. |
agent_role | string | "" | Agent role identifier. |
client_capabilities | string | "" | Optional advisory string such as "file_write,local_dir". |
rules_version | string | "" | 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
| Parameter | Type | Default | Description |
|---|---|---|---|
agent_role | string | required | The agent role key (e.g. "developer_agent"). |
memory_id | string | env var | Target 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:
- SEMANTIC_QUERY: Expand into a full natural-language question with context.
"auth bug"→"authentication bug in login flow, JWT token handling, session management"
- KEYWORD_QUERY: Extract 2–5 precise terms for full-text matching.
"auth.py JWT session_cookies OAuth2 login"
Essential parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
semantic_query | string | required | Expanded natural-language question for vector search. |
keyword_query | string | "" | 2–5 precise terms for keyword matching. Auto-extracted if empty. |
scope | string | "all" | all | timeline | knowledge | insights |
recall_mode | string | "hybrid" | hybrid | auto | precise | session | structured |
Recall modes:
| Mode | Description | Tokens | Speed |
|---|---|---|---|
hybrid | Default. Structured data + top-K vector results in parallel | ~2-4k | ~200ms |
auto | Vector search first, supplements with structured data if weak | Variable | ~200ms |
precise | Chunk reconstruction only — targeted vector search | ~500-2k | ~150ms |
session | Expands matched chunks to full session histories | ~2-8k | ~300ms |
structured | Zero-LLM DB-only: verified/unverified cards + narratives + tasks | ~1-2k | <50ms |
Scope layers:
| Scope | Content | Use When |
|---|---|---|
all | Everything (default) | General search |
timeline | Session events, steps, decisions | "What happened last week?" |
knowledge | Uploaded docs, ingested content | "What does the spec say?" |
insights | Compressed session summaries | "Overview of past work" |
All parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
semantic_query | string | required | Expanded natural-language question for vector search. |
keyword_query | string | "" | 2–5 precise terms for keyword matching. Auto-extracted if empty. |
memory_id | string | env var | Target memory ID. |
scope | string | "all" | all | timeline | knowledge | insights |
limit | int | 6 | Maximum results (1–30). |
vector_weight | float | 0.7 | Weight for vector (semantic) search (0–1). |
bm25_weight | float | 0.3 | Weight for full-text keyword search (0–1). |
recall_mode | string | "hybrid" | hybrid | auto | precise | session | structured |
reconstruct_chunks | bool | true | Stitch adjacent chunks back into complete context (3-4x token lift). |
confidence_threshold | float | null | Min confidence for cards (0.0–1.0). |
include_raw_chunks | bool | false | Include raw vector chunks alongside reconstructed results. |
user_id | string | "" | User filter for multi-user memories. |
agent_role | string | "" | Agent role filter. |
session_id | string | "" | Filter to specific session. |
multi_level | bool | false | Enable multi-level retrieval for broader context. |
cluster_expand | bool | false | Enable topic-based context expansion. |
include_installed | bool | true | Also search memories installed from the marketplace. |
detail | string | "" | Progressive disclosure mode: "summary" for lightweight index (~80 tokens each), "full" to expand specific ids. Empty = legacy mode. |
ids | array | null | Item IDs to expand (used with detail="full", from a prior detail="summary" call). |
token_budget | int | 0 | [DEPRECATED] Context assembly token budget. 0 = auto (typically 4000-16000 tokens). Use detail for progressive disclosure instead. |
metadata_filter | object | null | Additional metadata filters (e.g. {"source": "cursor"}). |
awareness_lookup
Get structured data from memory — no vector search, pure DB lookup (<50ms).
Essential parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
type | string | required | See type reference table below. |
memory_id | string | env var | Target memory ID. |
Type reference:
| Type | Returns | Use When |
|---|---|---|
context | Narratives + tasks + cards + rules | Session start overview |
tasks | Open/in-progress action items | Task pickup |
knowledge | Structured knowledge cards | Check known solutions, decisions, patterns |
risks | Active risks and mitigations | Risk review |
session_history | Full chronological event log | Deep session inspection (requires session_id) |
timeline | Paginated activity timeline | Recent activity review |
handoff | Compact briefing | Tool/session handoff |
rules | Synthesized behavioral rules | Get auto-generated rules |
graph | Knowledge graph | Entity relationships and adjacency |
agents | Agent profiles list | Get all configured agent roles |
All parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
type | string | required | See type reference table. |
memory_id | string | env var | Target memory ID. |
days | int | 7 | Days to look back (for context type). |
query | string | "" | Keyword filter for knowledge cards. |
category | string | "" | Category filter for knowledge cards. |
status | string | "" | Status filter (pending, in_progress, completed). |
priority | string | "" | Priority filter for tasks (high, medium, low). |
include_completed | bool | false | Include completed tasks. |
level | string | "" | Risk level filter (high, medium, low). |
session_id | string | "" | Session ID for session_history type (required). |
limit | int | 50 | Maximum items to return. |
offset | int | 0 | Pagination offset. |
user_id | string | "" | User filter for multi-user memories. |
agent_role | string | "" | Agent role filter. |
awareness_record
Write to memory. Handles all write operations.
Essential parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
content | string/list | null | String for single event, array for batch. |
session_id | string | "" | Session ID from awareness_init. |
insights | object | null | Structured 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
| Parameter | Type | Default | Description |
|---|---|---|---|
content | string/list | null | String for single event, array for batch. |
insights | object | null | Structured insights. Include knowledge_cards, action_items, risks, entities, relations. |
action | string | "write" | Write action type. Use "update_task" for task status updates. |
memory_id | string | env var | Target memory ID. |
session_id | string | "" | Session ID from awareness_init. |
scope | string | "timeline" | timeline | knowledge — layer for ingested content. |
task_id | string | "" | Task ID for update_task. |
status | string | "" | New status for update_task (completed, in_progress, pending). |
source | string | "" | Source label. |
actor | string | "" | user | assistant | tool | system. Auto-detected. |
event_type | string | "" | Auto-detected from text. |
metadata | object | null | Additional metadata per event. |
metadata_defaults | object | null | Default metadata for all events. |
user_id | string | "" | User identifier for multi-user memories. |
agent_role | string | "" | Agent role identifier. |
generate_summary | bool | true | Generate session summary for batch writes (2+ events). |
max_events | int | 800 | Max 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:
| Group | Categories |
|---|---|
| Engineering | decision, workflow, problem_solution, pitfall, insight, skill, key_point |
| Personal | personal_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:
| IDE | Source Value | Rules File |
|---|---|---|
| Claude Code | claude-code | CLAUDE.md |
| Cursor | cursor | .cursor/rules/awareness.mdc |
| Windsurf | windsurf | .windsurfrules |
| Cline | cline | .clinerules |
| VS Code Copilot | copilot | .github/copilot-instructions.md |
| Codex | codex | AGENTS.md |
| Kiro | kiro | .kiro/steering/awareness.md |
| Trae | trae | .trae/rules/awareness.md |
| JetBrains | jetbrains | .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