Model Context Protocol (MCP) memory server built with Azure Functions and TypeScript, providing persistent knowledge graph storage for AI assistants in VS Code.
Inspired by and forked from @modelcontextprotocol/server-memory
npm install
func start
- Install recommended extensions from
.vscode/extensions.json
- MCP configuration is ready in
.vscode/mcp.json
- Use
#memory-test
tools in VS Code Copilot chat
Note: All MCP tools now use object parameters instead of JSON strings for better type safety and ease of use.
# Health check
curl http://localhost:7071/api/health
# Use in VS Code Copilot with object parameters:
# #memory-test_create_entities
# #memory-test_read_graph
# #memory-test_search_entities
Recommended workflow for best results:
1. First, check existing data:
#memory-test_read_graph workspaceId="my-project"
2. Search for existing entities:
#memory-test_search_entities workspaceId="my-project" name="Alice"
3. Create entities (auto-updates existing ones):
#memory-test_create_entities workspaceId="my-project" entities={"name": "Alice", "entityType": "Person", "observations": ["Software engineer"]}
4. Create relationships (auto-creates missing entities):
#memory-test_create_relations workspaceId="my-project" relations={"from": "Alice", "to": "React Project", "relationType": "worksOn"}
5. Add observations (auto-creates entity if missing):
#memory-test_add_observation workspaceId="my-project" entityName="Alice" observation="Leads the frontend team" entityType="Person"
Key Features for Better LLM Usability:
- ✅ Auto-creation of missing entities when adding observations or relations
- ✅ Helpful error messages with examples when validation fails
- ✅ Workflow guidance to view graph first, then search, then create
- ✅ Clear parameter descriptions with expected formats
- ✅ Reduced friction - tools handle common edge cases automatically
Core Operations:
read_graph
- RECOMMENDED FIRST STEP: View the entire knowledge graph to understand existing datacreate_entities
- Create entities with auto-update of existing onescreate_relations
- Create relationships with auto-creation of missing entitiessearch_entities
/search_relations
- Search and verify existing dataadd_observation
- Add observations with auto-creation of missing entitiesupdate_entity
- Update entity observations and metadatadelete_entity
- Remove entity and all its relationsget_stats
- Get workspace statisticsclear_memory
- Clear all workspace data
Recommended Workflow:
- Use
read_graph
to understand existing data - Use
search_entities
to check for existing entities - Use
create_entities
to add new entities - Use
create_relations
to connect entities - Use
add_observation
to add new information
Advanced Features:
get_temporal_events
- Time-based activity trackingmerge_entities
- Merge duplicate entitiesdetect_duplicate_entities
- Find potential duplicatesexecute_batch_operations
- Batch multiple operationsget_user_stats
- Get user-specific statisticssearch_relations_by_user
- Find relations by user
Built with:
- Azure Functions v4 with TypeScript
- Azure Table Storage for persistent data (via Azurite locally)
- Model Context Protocol (MCP) for VS Code integration
- Workspace isolation - each project gets separate storage
src/
├── functions/ # Azure Functions endpoints
├── services/ # Business logic (storage, entities, relations)
├── types/ # TypeScript definitions
└── index.ts # Main entry point
For detailed information, see the .docs/
folder:
- Architecture Guide - Technical design and patterns
- API Reference - Complete endpoint documentation
- Storage Guide - Storage configuration and workspace management
- Deployment Guide - Production deployment options
- Uses Azure Table Storage with managed identity for security
- Workspace isolation prevents data leakage between projects
- Health endpoints for monitoring and container orchestration
- Automatic fallback to local storage for development
MIT License - see LICENSE file for details.