The AI Model Context Manager is a collection of Model Context Protocol (MCP) servers designed to enhance AI models with persistent context across work sessions throughout the project lifecycle. It uses domain-specific knowledge graphs to store context, managed by a central Context Manager for unified access.
buildcontext
, loadcontext
, and deletecontext
as you progress from idea to production/publication/completion.startsession
and endsession
help manage and analyze work sessions.Knowledge graphs free up the context window (performance) and minimize token cost (efficiency).
The Context Manager orchestrates several domain-specific MCP servers:
1. Developer MCP Server: Software development context.
2. Project MCP Server: Project management context.
3. Student MCP Server: Educational context.
4. Qualitative Research MCP Server: Qualitative research context.
5. Quantitative Research MCP Server: Quantitative research context.
The Context Manager uses the MCP Client SDK to communicate with domain-specific MCP servers. It maintains a registry of domain servers, creates MCP clients, routes requests, and provides cross-domain functionality.
The Context Manager uses absolute paths constructed at runtime to locate domain servers. Modify paths by updating the domains
array in main/index.ts
.
npx github:tejpalvirk/contextmanager
npm install -g github:tejpalvirk/contextmanager
Then run:
mcp-server-contextmanager
git clone https://github.com/tejpalvirk/contextmanager.git
cd contextmanager
npm install
npm run build
Then run:
node main/index.js
# Run on a specific port (default: 3000)
npx github:tejpalvirk/contextmanager --port 3001
# Enable debug logging
npx github:tejpalvirk/contextmanager --debug
# Specify a config file
npx github:tejpalvirk/contextmanager --config ./my-config.json
# Run only specific domain servers
npx github:tejpalvirk/contextmanager --domains developer,project
Customize where data is stored using:
- MEMORY_FILE_PATH: Path where the knowledge graph data will be stored.
- SESSIONS_FILE_PATH: Path where session data will be stored.
setActiveDomain(domain="developer")
startsession(domain="developer")
endsession(sessionId="session_id_here", stage="assembly", stageNumber=6, totalStages=6, nextStageNeeded=false)
buildcontext(type="entities", data={...})
loadcontext(entityName="MyProject", entityType="project")
deletecontext(type="entities", data={...})
relateCrossDomain(fromDomain="developer", fromEntity="ProjectX", toDomain="project", toEntity="ProjectX", relationType="manages")
In Claude Desktop, configure the Context Manager in settings:
{
"mcpServers": {
"contextmanager": {
"command": "npx",
"args": ["-y", "github:tejpalvirk/contextmanager"],
"options": {
"port": 3000,
"domains": ["developer", "project", "student"]
}
}
}
}
--port
option to specify a different port.main/index.ts
are correct.npx github:tejpalvirk/contextmanager --debug
Follows Semantic Versioning. Current version: 1.0.0.
npm install
npm run build
npm test
MIT
This project builds on the Model Context Protocol created by Anthropic for Claude.