The MCP Context Manager is a collection of servers that implement the Model Context Protocol (MCP), enabling AI models to maintain persistent context across work sessions. It stores context in domain-specific knowledge graphs managed through a central interface or as standalone servers for different domains like development, project management, education, and research.
Run directly with npx without installation:
npx github:tejpalvirk/contextmanager
Install globally to access all servers as commands:
npm install -g github:tejpalvirk/contextmanager
Then run either the main context manager:
mcp-server-contextmanager
Or run a specific domain server directly:
contextmanager-developer
contextmanager-project
contextmanager-student
contextmanager-qualitativeresearch
contextmanager-quantitativeresearch
Clone and build the source code:
git clone https://github.com/tejpalvirk/contextmanager.git
cd contextmanager
npm install
npm run build
node main/index.js
Customize the server's behavior with command-line arguments:
# Run on a specific port (default is 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
Configure where data is stored using these environment variables:
# Store data in the current directory
MEMORY_FILE_PATH="./my-dev-memory.json" SESSIONS_FILE_PATH="./my-dev-sessions.json" npx github:tejpalvirk/contextmanager
# Use an absolute path
MEMORY_FILE_PATH="/path/to/data/developer-memory.json" npx github:tejpalvirk/contextmanager
# Store in user's home directory
MEMORY_FILE_PATH="$HOME/contextmanager/memory.json" npx github:tejpalvirk/contextmanager
Set which domain you want to work with:
setActiveDomain(domain="developer")
Start a new work session:
startsession(domain="developer")
End a session when you're done:
endsession(sessionId="session_id_here", stage="assembly", stageNumber=6, totalStages=6, nextStageNeeded=false)
Build new context information:
buildcontext(type="entities", data={...})
Load context for a specific entity:
loadcontext(entityName="MyProject", entityType="project")
Delete context:
deletecontext(type="entities", data={...})
Assign status to entities:
buildcontext(type="relations", data=[
{ from: "LoginFeature", to: "active", relationType: "has_status" }
])
Set entity priorities:
buildcontext(type="relations", data=[
{ from: "BugFix", to: "high", relationType: "has_priority" }
])
Define sequential relationships:
buildcontext(type="relations", data=[
{ from: "DataModel", to: "UserInterface", relationType: "precedes" }
])
// Set the active domain
setActiveDomain(domain="developer")
// Start a new session
startsession(domain="developer")
// Create a new project entity
buildcontext(type="entities", data={
"entityType": "project",
"name": "MyProject",
"description": "A sample project",
"language": "TypeScript",
"framework": "React"
})
// Load context for the project
loadcontext(entityName="MyProject", entityType="project")
// Create a component and set its status
buildcontext(type="entities", data={
"entityType": "component",
"name": "AuthService",
"project": "MyProject",
"description": "Authentication service component",
"dependencies": ["UserService"]
})
buildcontext(type="relations", data=[
{ from: "AuthService", to: "active", relationType: "has_status" },
{ from: "AuthService", to: "high", relationType: "has_priority" }
])
Create relationships between entities in different domains:
// Link a developer project to a project management task
relateCrossDomain(
fromDomain="developer",
fromEntity="MyProject",
toDomain="project",
toEntity="ProjectX",
relationType="manages"
)
Configure the Context Manager in Claude Desktop settings:
{
"mcpServers": {
"contextmanager": {
"command": "npx",
"args": [
"-y",
"github:tejpalvirk/contextmanager"
],
"options": {
"port": 3000,
"domains": ["developer", "project", "student"]
}
}
}
}
--port
to specify a different portdomains
arrayTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "contextmanager" '{"command":"npx","args":["-y","github:tejpalvirk/contextmanager"],"options":{"port":3000,"domains":["developer","project","student"]}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"contextmanager": {
"command": "npx",
"args": [
"-y",
"github:tejpalvirk/contextmanager"
],
"options": {
"port": 3000,
"domains": [
"developer",
"project",
"student"
]
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"contextmanager": {
"command": "npx",
"args": [
"-y",
"github:tejpalvirk/contextmanager"
],
"options": {
"port": 3000,
"domains": [
"developer",
"project",
"student"
]
}
}
}
}
3. Restart Claude Desktop for the changes to take effect