MCP Memory Server
Universal Model Context Protocol Architecture.
TL;DR
The Memwyre MCP Memory Server provides a universal context gateway conforming strictly to Anthropic's open Model Context Protocol. It exposes standardized tool primitives (search_memwyre, save_memory, get_inbox, approve_memory, delete_memory) to equip any compliant AI coding client with durable long-term memory.
Answer: The Model Context Protocol (MCP) eliminates brittle, custom vendor plugins by establishing an open JSON-RPC standard for AI agents to interact with external tools. The Memwyre MCP Memory Server implements this standard across both Stdio and remote HTTP/SSE transports. By exposing a declarative 5-tool schema, any agent (Cursor Composer, Claude Desktop, Roo-Code, Windsurf) can autonomously retrieve relevant architectural decisions on demand and record insights with zero local disk footprint.
The Problem: Fragmentation in AI Agent Memory
As developer AI tooling rapidly proliferated through 2025 and 2026, software engineers faced extreme fragmentation:
- Cursor implemented its own internal codebase vector embeddings and local
.cursorrules. - Claude Code CLI developed a local Markdown store in
src/memdir/capped at 200 lines. - VS Code agents (Cline, Roo-Code, Continue) invented independent, incompatible storage formats.
The result was total memory isolation. Knowledge gained while debugging in Cursor was invisible when running Claude Code in the terminal. The Model Context Protocol (MCP) solves this by standardizing the interface between models, tools, and persistent memory stores.
The Model Context Protocol Specification: Architecture & Lifecycle
Announced by Anthropic in late 2024, the Model Context Protocol (MCP) establishes an open standard for connecting AI models to external data sources, developer tools, and operational environments. Rather than requiring developers to write brittle, bespoke integrations for each IDE, MCP operates identically to the Language Server Protocol (LSP): write one MCP server, and it works natively across Cursor, Claude, VS Code, and Windsurf.
Protocol Lifecycle: Handshake, Negotiation & Teardown
Every MCP connection progresses through three formal phases defined in the JSON-RPC 2.0 specification:
- Initialization & Handshake: The client sends an
initializerequest indicating its protocol version and supported capabilities (e.g. roots, sampling, notifications). The server responds with its own capabilities (tools, resources, prompts) and server identification metadata. - Initialized Notification: Once the client validates the server's protocol response, it issues an
notifications/initializedmessage. The session is now officially established. - Active Operation & Tool Invocations: The client sends
tools/listto discover available tools and parameter JSON schemas. When the LLM decides to execute an action, the client transmitstools/callwith structured arguments and waits for the JSON-RPC response.
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {
"roots": { "listChanged": true },
"sampling": {}
},
"clientInfo": {
"name": "Cursor-Composer",
"version": "0.45.0"
}
}
} Client sends initialize with supported features. Server verifies protocol compliance (2024-11-05) and returns tool capabilities. Client responds with notifications/initialized.
Client requests available tools. Server exposes JSON Schemas for search_memwyre, save_memory, and management endpoints so the LLM knows exact argument types.
The model issues a tool call. The server executes vector retrieval and entity graph re-ranking, returning synthesized context back into the agent's active prompt.
Transport Architecture: Stdio vs Remote HTTP/SSE
The Model Context Protocol decouples application logic from message transportation. Two primary transport protocols are defined in the specification:
| Dimension | Stdio Transport | HTTP + SSE Transport |
|---|---|---|
| Process Model | Spawns local sub-process (child process of IDE). | Connects to remote persistent cloud MCP server via HTTPS. |
| Communication Channel | Standard input (stdin) & standard output (stdout). | HTTP POST for requests; Server-Sent Events (SSE) for streams. |
| Authentication | OS-level environment variables (env block). | HTTP headers (Authorization: Bearer <token>). |
| Multi-Machine Sync | Locked to host filesystem; requires manual disk sync. | Instantaneous across all workstations, laptops, and CI/CD runners. |
| Best Used For | Air-gapped VPCs, local git inspection, and offline tooling. | Centralized engineering knowledge graphs, team memory vaults. |
1. Local Stdio Transport Architecture
In Stdio mode, the client IDE launches the server executable directly. The client writes newline-delimited JSON-RPC messages to the process's stdin and reads responses from stdout. Any logging messages must strictly output to stderr to avoid corrupting protocol framing.
2. Remote HTTP with Server-Sent Events (SSE)
Remote transport decouples agent execution from server hosting. Using lightweight bridging utilities like mcp-remote, clients establish an outbound SSE connection to receive streaming notifications and send RPC commands over secure HTTP POST endpoints:
npx -y mcp-remote https://server.memwyre.tech/mcp --header "Authorization:Bearer YOUR_MEMWYRE_API_KEY"Technical Tool Specification: JSON-RPC Schema Reference
The Memwyre MCP Server exposes five declarative tool primitives adhering strictly to the JSON Schema Draft 7 specification. Below are the exact parameter definitions and response payloads:
search_memwyre (Semantic Context Discovery)
Queries the knowledge graph for relevant architectural facts, database schemas, and conventions. Returns top-k entities ranked by vector similarity and temporal decay:
{
"name": "search_memwyre",
"description": "Searches the persistent memory vault for architectural decisions, schemas, and coding conventions.",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Natural language question or technical concept to retrieve (e.g. 'auth token rotation', 'Drizzle schema conventions')."
},
"limit": {
"type": "integer",
"description": "Maximum number of memory items to return (default: 5, max: 20).",
"default": 5
}
},
"required": ["query"]
}
}save_memory (Dynamic Knowledge Persistence)
Persists an architectural constraint, convention, or debugging insight. Memwyre automatically extracts named entities and updates relational links:
{
"name": "save_memory",
"description": "Persists an architectural rule, decision, or debugging breakthrough to long-term memory.",
"inputSchema": {
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "The synthesized rule or fact to record. Must be concise and self-contained."
},
"tags": {
"type": "array",
"items": { "type": "string" },
"description": "Categorical tags for filtering (e.g. ['database', 'security', 'auth'])."
}
},
"required": ["content"]
}
}MCP Security, Sandboxing & Governance
Because MCP grants language models the ability to execute tools on behalf of users, security governance is paramount. Connecting an unverified or poorly configured MCP server introduces serious attack vectors:
- Prompt Injection via Stored Memory: If an agent scrapes untrusted web content and stores it via
save_memory, malicious prompt injections could alter subsequent agent behavior. Memwyre mitigates this by passing candidate memories through an extraction sandbox that strips active instructions and isolates factual assertions. - Zero Source Code Transmission: Memwyre never scans or uploads full repository trees. Only synthesized architectural rules explicitly queried or committed by the developer or agent cross the wire.
- Scoped Access Tokens: When using remote HTTP/SSE transport, tokens can be restricted by IP range, read-only permissions, or repository project boundaries.
Client Configuration Snippets
Because Memwyre conforms strictly to the Model Context Protocol, connecting your preferred AI coding environment requires just a simple JSON block:
1. Claude Desktop Configuration (claude_desktop_config.json)
Open ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) and add:
{
"mcpServers": {
"memwyre": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://server.memwyre.tech/mcp",
"--header",
"Authorization:Bearer YOUR_MEMWYRE_API_KEY"
]
}
}
}2. Cursor AI IDE MCP Setup
Navigate to Cursor Settings → Features → MCP → Add New MCP Server. Choose Type: command and input:
npx -y mcp-remote https://server.memwyre.tech/mcp --header "Authorization:Bearer YOUR_MEMWYRE_API_KEY"3. Windsurf & Roo-Code Integration
In Windsurf's mcp_config.json or Roo-Code's MCP settings panel, paste the exact same command configuration. Both agents will immediately gain the ability to search your architectural memory vault.
Explore Specialized Agent Integrations
Overcome CLAUDE.md limits with automated CLI session ingestion.
Eliminate Composer chat amnesia with persistent project memory.
118MB lightweight memory layer for terminal-native coding agents.
Why vector databases fall short as autonomous agent memory systems.
Frequently Asked Questions
What is the Model Context Protocol (MCP)?
What is the difference between Stdio transport and HTTP/SSE transport in MCP?
How does Memwyre prevent prompt injection attacks through MCP memory tools?
Which IDEs and tools support the Memwyre MCP Memory Server?
What is the difference between this page (/mcp-memory) and /mcp?
/mcp page provides high-level step-by-step installation guides tailored for specific IDE clients.How do agents authenticate with the MCP server?
Authorization:Bearer YOUR_API_KEY) or via local configuration environment variables.Can I self-host the Memwyre MCP server on my own infrastructure?
What is the latency of MCP tool calls in Memwyre?
How does Memwyre compare to SQLite or ChromaDB local MCP memory servers?
Does Memwyre support MCP resource subscriptions?
Connect Any MCP Client to Memwyre
Deploy the universal Model Context Protocol memory server and equip Cursor, Claude Code, and VS Code with unified long-term context.
Start Free