Agent Context MCP Server
Tracks working context and code structure in a portable local SQLite database, enabling seamless context and task continuity across different AI coding tools.
README
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.
🚀 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
- Python 3.10+
- 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-server - The 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。