{"slug": "opencontext-persistent-project-local-memory-for-ai-coding-agents-via-mcp", "title": "OpenContext – Persistent, project-local memory for AI coding agents via MCP", "summary": "OpenContext has released a Model Context Protocol (MCP) server that gives AI coding agents persistent, project-local memory by reading and writing markdown files in a .opencontext/ directory, with tools save_context and read_context. The server runs via npx without a global install, supports Git-based team sharing or local private notes, and aims to prevent agents from forgetting decisions between sessions.", "body_md": "# Persistent, Project-Local Memory for AI Coding Agents\n\nCoding agents forget decisions between sessions. OpenContext MCP exposes a lightweight Model Context Protocol server that enables AI agents to read and write durable `.opencontext/`\n\nmarkdown rules.\n\n```\n.opencontext/\n  ├── architecture.md\n  ├── api-contracts.md\n  └── coding_rules.md\n01# Architecture0203## Authentication0405We use **JWT with refresh tokens**.0607### Access Token08- 15-minute expiry09- Stored in memory only1011### Refresh Token12- 7-day expiry13- HttpOnly secure cookie14- Rotated on each use\n```\n\n## Without vs. With OpenContext\n\nAI agents are powerful — but only if they remember what matters.\n\n### Without Memory\n\n#### Session context vanishes\n\nAgents lose all memory of prior decisions, conventions, and architecture between sessions.\n\n#### Architectural rules get broken\n\nWithout persistent rules, agents re-implement patterns that conflict with your codebase.\n\n#### Agents re-ask conventions\n\n\"Should I use Zod or Yup?\" — the same question, every session, no memory of past answers.\n\n### With OpenContext\n\n#### Plain .md storage in your repo\n\nPlain markdown files that persist across every session. Agents read before acting.\n\n#### Zero cloud or account lock-in\n\nOpen any .opencontext/ file in your editor. Human-readable, machine-readable, no magic.\n\n#### Team-wide alignment via Git\n\nCommit shared rules to your repo, or .gitignore for private local context. Your choice.\n\n## Get Started in 3 Steps\n\nGo from zero-install setup to a codebase with durable, searchable memory in one guided workflow.\n\nStep 01\n\n### Add OpenContext to your MCP Client\n\nAdd the OpenContext MCP entry to your client configuration. No global install is required. Your client launches the server via `npx`\n\nover `stdio`\n\n.\n\nCore command\n\n`[\"npx\", \"-y\", \"opencontext-mcp\"]`\n\nConfig path\n\nopencode.json / project MCP settings\n\n```\n{\n  \"mcp\": {\n    \"opencontext\": {\n      \"type\": \"local\",\n      \"command\": [\"npx\", \"-y\", \"opencontext-mcp\"],\n      \"enabled\": true\n    }\n  }\n}\n```\n\n## Two Lightweight MCP Tools\n\nMinimal surface area. Maximum utility. Every tool your agent needs.\n\n### save_context\n\nPersists a markdown context entry under .opencontext/ with the given topic name. Auto-creates the directory if it doesn't exist. Overwrites existing files with the same topic name.\n\n`topic`\n\nstringTopic name used as the filename. Use kebab-case or snake_case (e.g. \"architecture\" creates architecture.md).\n\n`content`\n\nstringFull markdown content to write. Supports headers, lists, code blocks, and all standard markdown.\n\n### read_context\n\nReads a specific topic file or discovers all available topics when called without arguments. Returns raw markdown content.\n\n`topic`\n\nstring (optional)Topic name to retrieve. Omit entirely to list all available topic filenames.\n\n## Agent Workflows & Ready Prompts\n\nOpenContext becomes useful when your agents are explicitly told when to read and write durable memory. Drop these prompts into your planning and implementation workflows.\n\n```\nAlways use read_context before modifying code. Use save_context when establishing durable rules or API contracts.\n```\n\n## Git Strategy\n\nChoose whether OpenContext becomes shared project memory or a purely local working layer.\n\n### Shared Team Memory\n\n`git add .opencontext`\n\nCommit plain markdown rules to the repository so architecture decisions, API contracts, and coding conventions stay visible to the whole team and can be reviewed in CI.\n\n### Local Private Notes\n\n`.opencontext/`\n\nKeep scratchpads, debugging notes, and developer-specific rules local by adding the directory to .gitignore. The workflow stays transparent without sharing personal context.", "url": "https://wpnews.pro/news/opencontext-persistent-project-local-memory-for-ai-coding-agents-via-mcp", "canonical_source": "https://www.opencntx.dev/", "published_at": "2026-08-29 23:24:44+00:00", "updated_at": "2026-08-29 23:48:20.109730+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents", "ai-infrastructure"], "entities": ["OpenContext", "Model Context Protocol (MCP)"], "alternates": {"html": "https://wpnews.pro/news/opencontext-persistent-project-local-memory-for-ai-coding-agents-via-mcp", "markdown": "https://wpnews.pro/news/opencontext-persistent-project-local-memory-for-ai-coding-agents-via-mcp.md", "text": "https://wpnews.pro/news/opencontext-persistent-project-local-memory-for-ai-coding-agents-via-mcp.txt", "jsonld": "https://wpnews.pro/news/opencontext-persistent-project-local-memory-for-ai-coding-agents-via-mcp.jsonld"}}