MCP Tools Reference
Awareness exposes 6 MCP tools that any AI agent (Claude, GPT, Cursor, etc.) can call over the MCP protocol. This page is the complete reference.
Quick Overview
| Tool | Purpose | When to Use |
|---|---|---|
__awareness_workflow__ | Workflow reference (DO NOT CALL) | Read the description for the mandatory 5-step workflow |
awareness_init | Initialize session + load cross-session persistent memory context | First call every session |
awareness_get_agent_prompt | Lazy-load the full activation prompt for a specific agent role | Before spawning a sub-agent |
awareness_recall | Semantic + keyword hybrid search across cross-session persistent memory | Targeted question / lookup |
awareness_lookup | Structured data retrieval (no vector search) | Tasks, knowledge, risks, timeline |
awareness_record | All write operations to cross-session persistent memory | Record events, batch save, update tasks, submit insights |
Recommended Workflow
The __awareness_workflow__ meta-tool contains a persistent workflow guide visible in every tool listing. Follow these steps:
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(action="remember", text=...) ← after EVERY code edit, decision, bug fix
4. If _extraction_instruction returned → process → submit_insights
5. awareness_record(action="remember_batch", steps=[...]) ← session-end summary
Tool Reference
awareness_init
Initialize a new session and load full cross-session persistent memory context. MUST call ONCE at session start, BEFORE any other memory tool.
Returns session_id (pass to all subsequent awareness_record calls), recent narratives, open tasks, and top knowledge cards.
| 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". Recognized IDE sources still receive the sync contract by default. |
Returns: { session_id, context: { recent_days, open_tasks, knowledge_cards }, agent_profiles: [{ agent_role, title, when_to_use }], active_skills?: [{ title, summary, methods }] }
active_skills— reusable skill prompts pre-loaded from this memory and any installed memories. When present, apply each skill'ssummaryas behavioral guidance and follow itsmethodssteps. Skills are delivered at session start so no extraawareness_recallcall is needed for known procedures.
Note:
agent_profilescontains only lightweight summaries (noactivation_prompt). Useawareness_get_agent_promptto fetch the full prompt when spawning a sub-agent.
awareness_get_agent_prompt
Fetch the full activation prompt for a specific agent role. Use this immediately before spawning a sub-agent so the main agent context stays clean.
Sub-agent spawning workflow:
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: "# Developer Agent\n...\n## Memory Integration\n..." }
4. Spawn sub-agent with activation_prompt as its system prompt
5. Sub-agent calls awareness_recall/record with agent_role="developer_agent"
| Parameter | Type | Default | Description |
|---|---|---|---|
agent_role | string | required | The agent role key to fetch (e.g. "developer_agent", "reviewer_agent"). |
memory_id | string | env var | Target memory ID. Auto-resolved from environment. |
api_key | string | header | Bearer token for authentication. |
Returns: { agent_role, title, activation_prompt, system_prompt }
Error responses:
{ "error": "agent_role is required." }— empty agent_role{ "error": "Agent role '<role>' not found in memory <id>." }— role does not exist{ "error": "Authentication required..." }— missing API key
awareness_recall
Search cross-session persistent memory for relevant context. Primary mid-session read tool.
RETRIEVAL NECESSITY — do NOT call for:
- Simple greetings, acknowledgments, or generic knowledge questions
- Questions answerable from the current conversation alone
- If unsure, call it — false positive is better than missing context
BEFORE CALLING — rewrite the query:
- SEMANTIC_QUERY: Expand into full natural-language question with context.
- Example: user says "auth bug" →
"authentication bug in login flow, JWT token handling, session management, and OAuth integration"
- Example: user says "auth bug" →
- KEYWORD_QUERY: Extract 2–5 precise terms for full-text matching. Use exact identifiers.
- Example:
"auth.py JWT session_cookies OAuth2 login"
- Example:
- SCOPE: Choose the right layer to search.
- WEIGHTS: Factual →
vector_weight=0.8; Keyword-heavy →vector_weight=0.5
| 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 from semantic_query if empty. |
memory_id | string | env var | Target memory ID. |
scope | string | "all" | all | timeline | knowledge | insights |
limit | int | 6 | Maximum results (1–30). |
recall_mode | string | "hybrid" | hybrid | auto | precise | session | structured |
confidence_threshold | float | null | Min confidence for cards (0.0–1.0). |
user_id | string | "" | User filter for multi-user memories. |
agent_role | string | "" | Agent role filter (typically provided via X-Awareness-Agent-Role header). |
session_id | string | "" | Filter to specific session. |
multi_level | bool | false | Enable multi-level retrieval (session and time-range context) for broader context. |
cluster_expand | bool | false | Enable topic-based context expansion for comprehensive hierarchical recall. |
metadata_filter | object | null | Additional metadata filters. |
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 results are 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 |
Cards in structured/hybrid are split by evidence confidence into verified and unverified tiers.
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" |
awareness_lookup
Get structured data from cross-session persistent memory — no vector search, pure DB lookup (<50ms).
| Parameter | Type | Default | Description |
|---|---|---|---|
type | string | required | context | tasks | knowledge | risks | session_history | timeline | handoff |
memory_id | string | env var | Target memory ID. |
days | int | 7 | Days to look back (for context type). |
max_cards | int | 20 | Max knowledge cards (for context type). |
max_tasks | int | 20 | Max tasks (for context type). |
query | string | "" | Keyword filter for knowledge cards (not vector search). |
category | string | "" | Category filter for knowledge cards. |
status | string | "" | Status filter (e.g. 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). Obtained from awareness_init. |
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. |
Type reference:
| Type | Returns | Use When |
|---|---|---|
context | Narratives + tasks + cards | Session start overview |
tasks | Open/in-progress action items | Task pickup |
knowledge | Structured knowledge cards | Check known solutions |
risks | Active risks and mitigations | Risk review |
session_history | Full chronological event log | Deep session inspection |
timeline | Paginated activity timeline | Recent activity review |
handoff | Compact briefing | Tool switch |
awareness_record
Write to cross-session persistent memory. Handles all write operations.
| Parameter | Type | Default | Description |
|---|---|---|---|
action | string | required | remember | remember_batch | backfill | ingest | update_task | submit_insights |
memory_id | string | env var | Target memory ID. |
session_id | string | "" | Session ID from awareness_init. |
text | string | "" | Text content for remember action. |
steps | list | null | Array of {text} objects for remember_batch. |
history | string/list | null | Conversation transcript for backfill. |
content | any | null | Content for ingest (string, array, or object). |
content_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 on batch/backfill. |
max_events | int | 800 | Max events for backfill (capped at 5000). |
Action reference:
remember — Store a single event
Call after each significant step: architecture decision, code change, bug fix, test result.
TEXT QUALITY: Include ALL of: WHAT happened · WHY it matters · OUTCOME · FILES affected.
Good examples:
"Decision: Switched auth from JWT to session cookies. Reason: simpler refresh logic.
Affected: backend/auth.py, frontend/lib/auth.ts."
"Bug fixed: Memory leak in background worker caused by unclosed DB connections.
Fix: added finally block in server/awareness/tasks.py line 89."
Bad examples: "Updated auth" / "Fixed bug" / "Tests pass" (too vague)
remember_batch — Store multiple events at once
Use for session-end summaries or history import (not periodic checkpoints — use remember after each change instead).
{
"action": "remember_batch",
"steps": [
{"text": "Session summary: Added user authentication with JWT tokens"},
{"text": "Files changed: auth.py, middleware.py, login.tsx"},
{"text": "Decisions: Chose bcrypt over argon2 for password hashing (wider library support)"},
{"text": "TODO: Add rate limiting to login endpoint"}
]
}
backfill — Import conversation history
Use when MCP is connected late and prior chat exists.
ingest — Import external content
Use for uploading documents, specs, or knowledge base content. Set content_scope="knowledge" to store in the knowledge layer (separate from timeline events).
update_task — Update task status
Requires task_id (from awareness_lookup(type="tasks")) and status.
submit_insights — Submit pre-extracted insights
Submit insights extracted by your LLM. Every awareness_record(action="remember") call may return an _extraction_instruction in the response — process it with your LLM and submit the extracted JSON result via this action. The server handles dedup, conflict resolution, and evidence scoring automatically.
Insight Auto-Extraction
The system extracts structured insights from your written events using your LLM (zero server-side LLM cost):
- Every
awareness_recordcall can return an_extraction_instructionin the response - Process the instruction with your LLM and call
awareness_record(action="submit_insights")with the JSON result - The server automatically handles deduplication, conflict detection, and evidence scoring
Categories auto-extracted (13 total):
Engineering categories (for technical/work content):
decision— A choice was made between alternativesworkflow— A process, setup, or configuration describedproblem_solution— A specific bug/error was identified AND fixedpitfall— A trap, gotcha, or limitation discoveredinsight— A reusable pattern or learningskill— A reusable procedure done 2+ times;summary= injectable instruction prompt,methods= numbered execution steps. Delivered viaactive_skillsat every session start — no recall needed.key_point— Important technical fact or architecture detail
Personal categories (for user-specific information):
personal_preference,important_detail,plan_intention,activity_preference,health_info,career_info,custom_misc
The extraction prompt uses a step-by-step decision tree for accurate classification. Categories are assigned automatically based on content — no manual categorization needed.
Status detection:
- Events mentioning
BLOCKED,TODO, orneed toare automatically marked asopen - Completed work is marked as
resolved - Work in progress is marked as
in_progress - Observations without action are marked as
noted
Write clearly so the extraction system can identify these patterns.
IDE Rules Auto-Injection
When you call awareness_init with a recognized source (e.g. "claude-code", "cursor", "copilot", "codex"), the response includes an ide_rules object in setup_hints:
{
"setup_hints": {
"ide_rules": {
"ide": "claude-code",
"rules_file": "CLAUDE.md",
"rules_content": "...",
"strategy": "managed_block",
"start_marker": "<!-- AWARENESS_RULES_START -->",
"end_marker": "<!-- AWARENESS_RULES_END -->",
"conflict_policy": "error_on_invalid_markers",
"instruction": "Sync the Awareness managed block in 'CLAUDE.md'..."
}
}
}
The agent should use the structured contract to sync the managed rules safely:
managed_block(CLAUDE.md,AGENTS.md,.windsurfrules,.clinerules,.github/copilot-instructions.md): create if missing, append when no markers exist, replace only the managed block when markers exist.managed_file(.cursor/rules/awareness.mdc): create if missing, replace the full file when markers exist, conflict on unmanaged existing files unless an explicit force mode is used.
Supported IDEs:
| IDE | Source Value | Rules File | Strategy |
|---|---|---|---|
| Claude Code | claude-code, claude | CLAUDE.md | managed_block |
| Cursor | cursor | .cursor/rules/awareness.mdc | managed_file |
| Windsurf | windsurf | .windsurfrules | managed_block |
| Cline | cline | .clinerules | managed_block |
| VS Code Copilot | copilot, github-copilot, vscode-copilot | .github/copilot-instructions.md | managed_block |
| Codex | codex, opencode | AGENTS.md | managed_block |
The marker pair (<!-- AWARENESS_RULES_START --> / <!-- AWARENESS_RULES_END -->) is used to upgrade existing managed rules instead of permanently skipping future syncs.
Alternative: CLI setup tool
For deterministic sync without relying on the MCP agent, run:
npx @awareness-sdk/setup # auto-detect IDE
npx @awareness-sdk/setup --configure-mcp --ide copilot
# prompt for MCP values interactively
npx @awareness-sdk/setup --ide cursor # force specific IDE
npx @awareness-sdk/setup --ide copilot # force VS Code Copilot
npx @awareness-sdk/setup --ide copilot --mcp-url https://awareness.market/mcp --api-key aw_xxx --memory-id mem_xxx
# also create/merge the MCP config file
npx @awareness-sdk/setup --dry-run # preview without writing
npx @awareness-sdk/setup --force # allow Cursor managed_file takeover