Agent Context MCP Server
The Agent Context MCP Server provides a portable, local memory and code structure graph for agentic AI coding tools, enabling context persistence and codebase analysis across sessions and tools.
Working Context Management
Create tasks – Start a new working context task tracked by a unique task ID
Log progress – Append progress entries of types:
step_done,error_hit,next_step, ornoteLog decisions – Record technical decisions with reasoning and optional code symbol references
Manage open questions – Add and resolve open questions during development
Resume work – Retrieve the full state of an active task (progress, decisions, questions) to pick up where you left off
List tasks – View all tasks filtered by status:
active,done,blocked, orabandoned
Code Structure Graph
Index files – Parse Python, JavaScript, and TypeScript files using
tree-sitterto extract classes, functions, and methods locally, with incremental indexing via content-hashingLook up symbols – Retrieve a specific symbol's file path and line numbers
Trace call chains – Follow inbound or outbound function call relationships for a given symbol within a file
Get architecture overview – View a high-level summary of the parsed codebase including files, symbol counts, and entry points
Project Lifecycle
Export project context – Create a compressed zip backup of the entire
.agentctx/directory for storage or sharing
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Agent Context MCP Server resume my last task"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Agent Context MCP Server
A portable, tool-agnostic memory and code structure graph for agentic AI coding tools (OpenCode, Antigravity, Claude Code, etc.).
🧠 The Problem
Agentic AI tools typically keep their memory locked inside a single session. When you run out of context tokens or switch to a different AI tool, you lose:
What you were currently working on (tasks, pending steps).
Why past technical decisions were made.
The structural architecture of the codebase.
Related MCP server: Memory MCP
🚀 The Solution
The Agent Context Server is an MCP (Model Context Protocol) server that tracks working context and code structure in a lightweight, local SQLite database (.agentctx/context.db). It provides a single, portable memory that follows the project rather than the tool.
You can start a task in one AI tool, hit a context limit, open a completely different AI tool, and resume exactly where you left off.
✨ Features
Working Context Engine: Tracks active tasks, decisions, progress logs, and open questions across sessions.
Code Structure Graph: Uses
tree-sitterto parse and mapPython,JavaScript, andTypeScriptfiles, extracting classes, functions, and methods without sending your code to external APIs.Incremental Indexing: Smart content-hashing ensures only modified files are re-indexed.
Project Export: Built-in tools to instantly zip and backup your agent's memory state.
Fully Local & Private: No LLM calls inside the server; all state is kept entirely locally via SQLite.
🛠️ Prerequisites
uv (Fast Python package and project manager)
📦 Installation
Clone this repository to your machine:
git clone (replace with your own repo URL once you push this to GitHub) cd agent-context-mcp-serverThe project uses
uvfor dependency management. The required packages (mcp,tree-sitter,tree-sitter-python,tree-sitter-javascript,tree-sitter-typescript) will be automatically managed when you run the server.
⚙️ MCP Configuration
To use this server with your preferred agentic AI tool (like Google Antigravity, OpenCode, or Claude Code), add the following to your MCP configuration settings:
{
"mcpServers": {
"agent-context-server": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/agent-context-mcp-server",
"run",
"server.py"
]
}
}
}Note: Replace
/absolute/path/to/agent-context-mcp-serverwith the actual path where you cloned this repository. The server will dynamically create the.agentctx/directory in whatever project folder your AI agent is currently working in.
🧰 Available Tools
Once connected, your AI agent will have access to the following tools:
Working Context
start_task(title): Creates a new working context task.log_progress(task_id, entry, entry_type): Appends a progress log (step_done,error_hit,next_step,note).log_decision(task_id, decision, reason, symbol_ref): Logs technical decisions and the reasoning behind them.add_question(question)/resolve_question(question_id): Manages open questions.resume(task_id?): Retrieves the full state of the active task to seamlessly pick up work.list_tasks(status?): Lists active, done, blocked, or abandoned tasks.
Structure Graph
graph.index(path, languages?): Parses a file (.py,.js,.ts,.jsx,.tsx) and extracts structural symbols.graph.get_symbol(name): Retrieves a specific symbol's file path and line numbers.graph.trace_calls(symbol_name, direction): Traces inbound or outbound function calls within the same file.graph.get_architecture(): Returns a high-level overview of the parsed codebase, including files, symbol counts, and root entry points.
Lifecycle
project.export(): Zips the entire.agentctx/directory for safe backup and sharing.
📄 License
MIT License
Available Tools
12 toolsadd_questionC
Adds an unresolved open question to the context.
Inputs: question (required). Returns: result
graph.get_architectureB
Returns a basic high-level overview of the parsed codebase, including files, symbol counts, and entry points.
Inputs: no named parameters. Returns: result
graph.get_symbolC
Retrieves a symbol's info, file, and line numbers from the database.
Inputs: name (required). Returns: result
graph.indexC
Parses a given file path and saves the extracted symbols to the symbols table.
Inputs: path (required), languages. Returns: result
graph.trace_callsB
Returns the inbound or outbound call chain for a given symbol. direction: 'inbound' or 'outbound'
Inputs: direction (required), symbol_name (required). Returns: result
list_tasksB
Lists tasks, optionally filtered by status (active, done, blocked, abandoned).
Inputs: status. Returns: result
log_decisionC
Logs a technical decision with its reason to the context.
Inputs: reason (required), task_id (required), decision (required), symbol_ref. Returns: result
log_progressB
Appends a progress log entry to the task.
Valid entry_type values: step_done, error_hit, next_step, note
Inputs: entry (required), task_id (required), entry_type (required). Returns: result
project.exportA
Creates a compressed zip backup of the entire .agentctx/ directory.
Inputs: no named parameters. Returns: result
resolve_questionB
Marks an open question as resolved.
Inputs: question_id (required). Returns: result
resumeA
Returns the full state of a task (or the most recent active one if not provided):
active task details, recent progress, decisions, and open questions.
Inputs: task_id. Returns: result
start_taskC
Creates a new working context task and returns the task ID.
Inputs: title (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Tools are clearly separated into graph analysis (graph.*) and context management (add_question, log_decision, etc.), each with distinct purposes. No overlap between tools.
Uses a mix of plain snake_case (add_question, list_tasks) and dotted hierarchical names (graph.get_architecture, project.export). Consistent within subgroups but inconsistent across the whole set.
12 tools cover the main functionalities of code graph analysis and task/context management without being excessive. Well-scoped for the server's domain.
Core operations are present but missing lifecycle actions: no update/delete for tasks, decisions, or questions. Graph tools lack search or listing capabilities.
Maintenance
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Project memory, documentation and controlled secret access for AI coding agents.
Shared work memory for Claude Code, Codex, Cursor and chat, scoped to each repository.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI coding assistants with persistent project memory to retain architectural decisions, code patterns, and domain knowledge across sessions. It stores data locally in a SQLite database, allowing agents to remember, recall, and manage project-specific context using full-text search.3 npmApache 2.0
- AlicenseAqualityDmaintenanceProvides persistent cross-session memory and full-text search for AI coding assistants, storing project context, decisions, and preferences while enabling searchable access to conversation history via local SQLite.81MIT
- AlicenseAqualityBmaintenanceProvides AI coding assistants with persistent memory storage using a local SQLite database. Enables tools to remember project details, notes, and relationships across sessions to maintain context and reduce repetitive explanations.174MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to maintain persistent understanding of code projects across chat sessions via a SQLite brain that caches structural maps, summaries, and decisions. Provides tools for querying project structure, searching code, and recording insights to reduce token usage and avoid re-analysis.166MIT