- Home
- MCP servers
- MCP Session Closer
MCP Session Closer
- typescript
0
GitHub Stars
typescript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"tylarcam-mcp-session-closer": {
"command": "node",
"args": [
"/path/to/mcp-session-closer/dist/index.js"
],
"env": {
"NOTION_PAGE_ID": "0a1b2c3d4e5f6g7h8i9j",
"CURSOR_WORKSPACE": "${workspaceFolder}",
"NOTION_API_TOKEN": "ntn_your_token_here",
"NOTION_DATABASE_ID": "1234abcd-5678-efgh-ijkl-9012mnopqrst"
}
}
}
}The MCP Session Closer is a server that gracefully ends Cursor work sessions, synchronizes context files, updates a session summary, and optionally creates Notion entries. It seamlessly commits changes to your git workspace, ensuring context continuity and traceable history across sessions and projects.
How to use
You operate this MCP server from the Cursor client by triggering dedicated actions. Use the end_session action to close the current session, sync all context files across claude.md, gemini.md, agents.md, and the main context file, and optionally create a Notion entry for the completed work. You can also run targeted tools to update only the session summary or to sync context files without closing the session.
Typical usage patterns you can perform from Cursor or via the MCP client include the following:
- End the session and sync everything: close the session, generate a structured session summary, update agent OS artifacts if present, create a Notion entry, merge context files, and commit changes to git.
- Sync only the context files without ending the session: update claude.md, gemini.md, agents.md, and the central cursor context file, then commit as needed.
- Update the session summary without closing: append details to the session summary without ending the session.
- Create Notion entries directly from markdown: convert markdown to Notion blocks and append to an existing page or create a new page in a database, with an optional custom title and date.
When you call end_session, the server automatically collects session details (accomplishments, decisions, blockers, next steps), updates the session summary, updates the Agent OS roadmap and decisions if present, syncs all context files, and commits everything with a descriptive message.
How to install
Prerequisites: ensure you have Node.js and npm installed on your system.
# 1. Install dependencies
npm install
# 2. Build the server
npm run build
Configure Cursor to load the MCP server at runtime by adding a server entry to your Cursor MCP settings. The example assumes you will run the server with Node and point to the built entry file.
{
"mcpServers": {
"session-closer": {
"command": "node",
"args": [
"/path/to/mcp-session-closer/dist/index.js"
],
"env": {
"CURSOR_WORKSPACE": "${workspaceFolder}"
}
}
}
}
Replace /path/to/mcp-session-closer with the actual path to your built server. On Windows, you may use forward slashes or double backslashes in the path.
Finally, restart Cursor so it loads the MCP server you configured.
Configuration
Required environment variables and the MCP server context are defined here to enable automated session management and Notion integration.
Environment variables shown in this setup include the workspace and Notion credentials. You can see these variables in the runtime configuration you provide to the MCP server.
Notion integration is optional and relies on a Notion token. If you configure Notion, the MCP server will create entries automatically when closing sessions, or you can create entries manually using the create_notion_entry tool.
Notion integration and manual entry creation
The server can automatically create Notion entries when closing sessions and also supports creating entries directly from markdown content through a dedicated tool. You can append to an existing Notion page or create a new page in a Notion database.
Key capabilities include converting Markdown to Notion blocks, chunking large content to respect Notion’s block limits, and extracting the title and date from markdown if not explicitly provided.
If MCP tools are unavailable, the server falls back to direct Notion API calls to ensure the entry is created.
How it works in practice
End-session flow: the server gathers session details, updates the session summary file, synchronizes all context files, and commits changes to git with a timestamped message.
Troubleshooting
If the MCP server cannot be found or loaded, verify the path in your Cursor configuration and ensure the built index.js exists at the specified location. On Windows, use forward slashes or escaped backslashes in paths.
Project structure and notes
The setup works with or without optional files like the session summary and product roadmaps or decisions. Notion integration relies on environment configuration, and changes are tracked via git.
Available tools
end_session
Close Cursor sessions with automatic context sync, Notion entry creation, and git commit.
sync_context_files
Synchronize context files across claude.md, gemini.md, agents.md, and .cursor/context.md.
update_session_summary
Update session summaries without closing the session.
create_notion_entry
Create Notion entries from markdown content, either appending to an existing page or creating a new database page. Handles large content by chunking and can extract title/date from markdown.
Notion integration
Automatically creates Notion entries via MCP tools with a Python fallback if needed.