OPC Memory MCP Server
Click on "Install 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., "@OPC Memory MCP Serverstore learning about database connection pooling with high confidence"
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.
OPC Memory MCP Server
MCP server that exposes OPC memory scripts as tools for Claude Code and Claude Desktop.
This project provides an MCP interface to the OPC (Opinionated Persistent Context) memory system from the OPC project. OPC enables semantic memory storage and retrieval, allowing Claude to learn from past sessions and maintain context across conversations.
Note: This server was originally built against Continuous-Claude-v3. As of v0.7.2, it targets the standalone OPC repository which contains the memory scripts, database schema, and pattern detection infrastructure.
Tools
Tool | Description |
| Store session learnings with embeddings for semantic recall |
| Semantic search over stored learnings |
| Scoped semantic search over ingested document collections (RAG) |
| List document collections and ingest stats |
| Ingest one collection or all (admin/ingest) |
| Register a new document collection (admin/ingest) |
| Search Context Graph for precedent from past sessions |
| Index handoffs, plans, and continuity ledgers |
| Mark handoff outcomes for tracking |
| Start the memory extraction daemon |
| Stop the memory extraction daemon |
| Check daemon status and view recent logs |
| Run on-demand pattern detection across stored learnings |
Related MCP server: Skillz
Prerequisites
This MCP server requires:
OPC project - The memory scripts and PostgreSQL database schema from the OPC repository
PostgreSQL database - Running with the OPC schema (sessions, file_claims, archival_memory tables)
Environment variables -
DATABASE_URLpointing to your PostgreSQL instance
See the OPC repository for setup instructions.
OPC Directory Configuration
The OPC directory path can be configured in two ways (in priority order):
1. Environment Variable (Override)
export CLAUDE_OPC_DIR="/path/to/your/opc"Use this for temporary overrides or CI/CD environments.
2. Config File (Persistent)
Create ~/.claude/opc.json:
{
"opc_dir": "/path/to/your/opc"
}This is the recommended approach for persistent user configuration.
Resolution Order
Hooks and scripts resolve OPC_DIR in this order:
Priority | Source | Use Case |
1 |
| Explicit override, CI/CD |
2 |
| Persistent user preference |
3 |
| Project-local setup |
4 |
| Global installation |
Hook Integration
If you're building hooks that need to reference OPC infrastructure, use the shared opc-path.ts module. See the examples/hooks/ directory for a complete example you can copy to your ~/.claude/hooks/src/shared/ directory.
MCP Server Resolution
The main.py MCP server uses the same resolution logic:
def get_opc_dir() -> str:
# 1. CLAUDE_OPC_DIR env var
# 2. ~/.claude/opc.json config file
# 3. Fallback defaultThis means the MCP server will automatically use your configured OPC path.
Note on Skills
If you have Claude Code skills that reference OPC memory tools (e.g., /recall, /remember), you may need to update them to use the MCP tool names:
Skill Reference | MCP Tool Name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Installation
cd /Users/stephenfeather/Tools/opc-memory-mcp
uv syncUsage
Run directly
uv run opc-memory-serverClaude Desktop Configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"opc-memory": {
"command": "uv",
"args": ["--directory", "/Users/stephenfeather/Tools/opc-memory-mcp", "run", "opc-memory-server"]
}
}
}Claude Code Configuration
Add to .claude/settings.json or global settings:
{
"mcpServers": {
"opc-memory": {
"command": "uv",
"args": ["--directory", "/Users/stephenfeather/Tools/opc-memory-mcp", "run", "opc-memory-server"]
}
}
}Tool Examples
store_learning
Store a learning about hook development patterns.
Parameters:
- content: "TypeScript hooks require npm install before they work"
- learning_type: "WORKING_SOLUTION"
- context: "hook development"
- tags: "hooks,typescript"
- confidence: "high"recall_learnings
Search for past learnings about authentication.
Parameters:
- query: "authentication patterns"
- k: 5
- text_only: false (use embeddings)Observability: MCP recalls are logged to the OPC
recall_logtable withsource = "mcp"(since v0.7.5), distinguishing them fromhook- andcli-driven recalls for cross-project mis-scope analysis.
query_documents
Scoped RAG search over ingested document collections (wraps opc-docs query).
Search the documents for a topic.
Parameters:
- text: "what does the contract say about termination"
- collection: "" (default; searches global-scope collections only)
- limit: 8 (max 100)Scope is a security boundary: the default search is global-only. A
restrictedcollection (e.g. medical/legal docs) surfaces only when its name is passed viacollection. There is no "all scopes" option — pass a collection name solely when the caller explicitly targets it. The companionlist_document_collectionsis read-only;scan_document_collectionandcreate_document_collectionare admin/ingest operations.
index_artifacts
Index all artifacts:
- mode: "all"
Index specific file:
- mode: "file"
- file_path: "/path/to/handoff.md"mark_handoff
Mark the latest handoff as successful:
- outcome: "SUCCEEDED"
- notes: "All tasks completed"detect_patterns
Dry run to preview patterns:
- dry_run: true
Run detection and write to database:
- min_confidence: 0.3
- use_llm: false
View last run's report:
- report: trueDaemon Management
Check daemon status:
daemon_status()
# Returns: running status, PID, recent log entries
Start the daemon:
start_daemon()
# Starts memory extraction daemon if not running
Stop the daemon:
stop_daemon()
# Stops the running daemonDevelopment
Test the server:
# Check it starts without errors
uv run opc-memory-server &
PID=$!
sleep 2
kill $PID
# Test individual tools via subprocess
uv run python -c "
from main import store_learning, recall_learnings
result = recall_learnings(query='test', k=1)
print(result)
"This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/stephenfeather/opc-memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server