CogMemory MCP Server
CogMemory MCP Server
AI 코딩 에이전트를 위한 4가지 컨텍스트 하위 시스템을 제공하는 Model Context Protocol 통합 서버입니다:
Memory — 결정, 규칙, 오류, 활성 컨텍스트, 변경 로그, 계획, 작업, 세션
Knowledge Graph — 엔티티, 관계, 관찰
Specs — 장문 문서(PRD/SRS), 선택적으로 KG 엔티티와 연결
Code Graph — 정적 구조 그래프(심볼/엣지) + 명명된 실행 추적 + AI 생성 주석
저장소: SQLite (better-sqlite3 사용). 범위(scope)당 하나의 .db 파일.
빠른 시작
설치
git clone <repo> && cd cogmemory-mcp
pnpm install
pnpm run buildVS Code에서 구성
.vscode/mcp.json에 추가합니다(워크스페이스 범위):
{
"servers": {
"cogmemory": {
"command": "node",
"args": ["/absolute/path/to/cogmemory-mcp/dist/index.js"]
}
}
}또는 전역에서 사용하려면 사용자 mcp.json에 추가합니다.
MCP Inspector로 실행(개발)
pnpm run inspectRelated MCP server: LumenCore
범위 구성 (Scope Configuration)
CogMemory는 다음 우선순위에 따라 범위를 결정합니다.
.cogmemory/config.json(워크스페이스 루트):{ "scope": "global" }환경 변수:
COGMEMORY_SCOPE=global기본값:
workspace
경로
범위 | 데이터베이스 경로 |
workspace |
|
global |
|
워크스페이스 결정 및 멀티 루트 지원
CogMemory는 다음 우선순위로 워크스페이스 루트(.cogmemory/memory.db가 위치하는 곳)를 결정합니다.
--workspace <path>CLI 인자 (최우선순위)COGMEMORY_WORKSPACE환경 변수CWD에서 위로 이동하면서
.cogmemory/디렉터리를 포함하는 가장 가까운 상위 폴더를 찾습니다.CWD로 대체
멀티 루트 VS Code 워크스페이스
VS Code 멀티 루트 워크스페이스에서는 각 폴더가 개별 워크스페이스 루트입니다. CogMemory는 이를 이렇게 처리합니다:
단일 루트 — 자동으로 동작합니다. VS Code가 CWD를 워크스페이스 폴더로 설정하고,
--workspace가mcp.json을 통해 전달됩니다.멀티 루트 — 각 워크스페이스 폴더는 고유한
.cogmemory/를 가질 수 있습니다. 각각 다른--workspace경로로 CogMemory를 지정하거나, 상위 디렉터리에 공용.cogmemory/를 둡니다.
권장 멀티 루트 mcp.json (폴더별):
{
"servers": {
"cogmemory-frontend": {
"command": "node",
"args": [
"/path/to/cogmemory-mcp/dist/index.js",
"--workspace",
"/path/to/frontend"
]
},
"cogmemory-backend": {
"command": "node",
"args": [
"/path/to/cogmemory-mcp/dist/index.js",
"--workspace",
"/path/to/backend"
]
}
}
}또는 공용 데이터베이스 사용 (모든 루트를 한곳에):
{
"servers": {
"cogmemory": {
"command": "node",
"args": [
"/path/to/cogmemory-mcp/dist/index.js",
"--workspace",
"/shared/root"
]
}
}
}또는 전역 범위 사용 (모든 워크스페이스에서 공유):
{
"servers": {
"cogmemory": {
"command": "node",
"args": ["/path/to/cogmemory-mcp/dist/index.js"]
}
}
}export COGMEMORY_SCOPE=global도구 참조
메모리 도구
도구 | 설명 |
| 작업 세션 시작 (세션 ID 반환) |
| 세션 종료, 요약 저장 |
| 결정, 오류, 변경 로그를 포함한 세션 세부 내용 조회 |
| 근거와 태그와 함께 결정 기록 |
| 규약 기록/업데이트 (디자인 토큰, 패턴, 스타일, 명명) |
| 시그니처와 해결 방법과 함께 오류 기록 |
| 키로 현재 초점/작업 upsert |
| 키로 현재 초점 읽기 |
| 변경 로그 항목 추가 |
| 로드맵 항목 추가 |
| 플랜 상태 변경 |
| 작업 생성 (선택적으로 플랜과 연결) |
| 작업 상태 변경 |
| 결정/규칙/오류/변경 로그에 대한 통합 검색 |
지식 그래프 도구
도구 | 설명 |
| 엔티티 추가 (name+type 기준 중복 제거) |
| 유형이 지정된 관계로 두 엔티티 연결 |
| 엔티티에 사실 첨부 |
| 엔티티, 관계, 관찰 내용 검색 |
션 도구
도구 | 설명 |
| 장문 문서 저장 |
| ID 또는 정확한 제목으로 조회 |
| 내용/제목 업데이트, 버전 자동 상향 |
Code Graph 도구
도구 | 설명 |
| 워크스페이스를 탐색하며 ts-morph(JS/TS)로 심볼+엣지 추출 |
| 심볼의 호출자/호출 대상/임포트 조회(1-hop) |
| 진입 심볼부터 BFS, 추적/주석 추가 가능한 부분 그래프 생성 |
| 심볼 또는 추적에 내러티브 텍스트 첨부 |
아키텍처
cogmemory-mcp/
├── src/
│ ├── index.ts # entry point, server bootstrap
│ ├── config.ts # scope resolution, path resolution
│ ├── types.ts # shared TS types mirroring schema
│ ├── db/
│ │ ├── connection.ts # DB open/close, pragma setup
│ │ ├── schema.sql # full schema (reference)
│ │ └── migrate.ts # idempotent schema application
│ ├── tools/
│ │ ├── memory.ts # decisions/conventions/errors/context/changelog/recall
│ │ ├── plan-tasks.ts # plan + tasks tools
│ │ ├── sessions.ts # start/end session, summary
│ │ ├── knowledge-graph.ts # entities/relations/observations
│ │ ├── specs.ts # spec CRUD
│ │ ├── code-graph.ts # index_codebase, query_code_graph
│ │ └── codemap.ts # generate_codemap, annotate_symbol
│ └── indexing/
│ ├── ts-analyzer.ts # ts-morph symbol/edge extraction
│ └── walker.ts # file discovery, gitignore respect
├── schema.sql # reference copy
├── package.json
├── tsconfig.json
└── README.md스키마 (15개 테이블)
Memory (8):
sessions,decisions,conventions,errors,context,changelog,plan,tasksKnowledge Graph (3):
entities,relations,observationsSpecs (1):
specsCode Graph (4):
symbols,edges,execution_traces,codemap_annotations
프레그마 (Pragmas)
커넥션이 열릴 때마다 설정:
PRAGMA journal_mode = WAL;
PRAGMA foreign_keys = ON;개발
pnpm run dev # Run with tsx (no build step)
pnpm run build # Compile TypeScript
pnpm run start # Run compiled output
pnpm run inspect # Launch MCP Inspector
pnpm run smoke-test # Run smoke test script라이선스
MIT
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.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with persistent, searchable memory using a knowledge graph stored in SQLite. Features semantic search, temporal awareness, and workflow-aware prompts for development projects.13MIT
- AlicenseNot gradedqualityCmaintenanceProvides AI coding assistants with persistent project memory to retain architectural decisions, code patterns, and domain knowledge across sessions. It stores data locally in a SQLite database, allowing agents to remember, recall, and manage project-specific context using full-text search.8Apache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to maintain persistent, cross-session memory of codebase architecture, naming conventions, and decisions through MCP tools. Eliminates repetitive project re-explanation by automatically injecting stored context into every session with local-first SQLite storage and optional team sharing capabilities.4MIT
- AlicenseAqualityBmaintenanceProvides persistent cross-session memory and full-text search for AI coding assistants, storing project context, decisions, and preferences while enabling searchable access to conversation history via local SQLite.81MIT
Related MCP Connectors
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/skylarng89/cogmemory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server