pagespace-mcp
v4.0.1
Published
Model Context Protocol (MCP) server for PageSpace. Conformant tool surface mirroring the web app's pageSpaceTools registry — drive management, page operations, content search, sheet editing, combined task management (create/update/delete/reorder via updat
Downloads
460
Maintainers
Readme
PageSpace MCP Server
A Model Context Protocol (MCP) server that enables Claude Code and Claude Desktop to directly read, edit, create, manage, and organize your PageSpace documents with full CRUD operations and line-level precision.
Quick Start
- Set up MCP tokens in your PageSpace instance
- Configure Claude Desktop/Code with your tokens (no installation needed!)
- Start editing your PageSpace documents with Claude!
Features
- 37 tools, full parity with the web app's
pageSpaceToolsregistry — drive, page, search, task, agent, calendar, conversations, channel, and activity coverage - Combined task surface: a single
update_tasktool covers create, update, delete, and reorder - Custom status discovery:
read_pageon TASK_LIST pages returnsavailableStatuses(slug, label, group) and dynamic progress counts keyed by status group - Page management: move, reorder, trash, and restore with hierarchy support
- Line-based editing: replace specific lines with precision
- Sheet editing: edit spreadsheet cells with formula support
- Multi-page types: FOLDER, DOCUMENT, CHANNEL, AI_CHAT, CANVAS, SHEET, TASK_LIST
- Search: regex and glob patterns, single-drive or multi-drive
- AI agents: create via
create_page(type=AI_CHAT) +update_agent_config; list and consult agents - Calendar: list / get / availability / create / update / delete events; RSVP and attendee management
- Conversations & channels: list / read AI agent conversations, send channel messages, fetch activity feeds
- Trash system: safe soft-delete with restore for pages and drives
- Secure: per-user MCP tokens
Available Tools
📁 Drive Management (4 tools)
list_drives— list all available workspaces/drivescreate_drive— create a new workspace/driverename_drive— rename an existing drive (owner only)update_drive_context— set the AI context/system prompt for a drive
📄 Page Operations (8 tools)
list_pages— explore the page tree within a drivelist_trash— list trashed pagesread_page— read any page (TASK_LIST output includesavailableStatusesand dynamic progress)get_page_details— full metadata for a pagecreate_page— create FOLDER, DOCUMENT, CHANNEL, AI_CHAT, CANVAS, SHEET, or TASK_LISTrename_page— rename a pagemove_page— move/reorder a page within the drivereplace_lines— replace specific line(s) in a document
🗑️ Trash & Restore (2 tools)
trash— move a page or drive to trash (drives require name confirmation)restore— restore a trashed page or drive
📊 Sheet Editing (1 tool)
edit_sheet_cells— edit SHEET cells with A1 addressing and formulas
✅ Task Management (2 tools)
update_task— combined create/update/delete/reorder for tasks on a TASK_LIST page- Create:
pageId+title - Update:
pageId+taskId+ fields to change - Delete:
pageId+taskId+delete: true(hard-removes the task and trashes its linked DOCUMENT page; field updates in the same call are ignored) - Reorder:
pageId+taskId+position(re-densifies peer positions; combine with field updates freely)
- Create:
get_assigned_tasks— tasks assigned to a user, optionally filtered by drive
🔍 Search & Discovery (3 tools)
regex_search— regular-expression search across page contentglob_search— glob-pattern search over titles/pathsmulti_drive_search— text or regex search across multiple drives
🤖 AI Agents (4 tools)
update_agent_config— update an agent's system prompt, enabled tools, provider, model (use aftercreate_pagewith type=AI_CHAT to set up a new agent)list_agents— list AI agents in a specific drivemulti_drive_list_agents— list AI agents across all accessible drivesask_agent— consult another AI agent for specialized knowledge
📅 Calendar (9 tools)
list_calendar_events— list events betweenstartDateandendDateget_calendar_event— full details of a single eventcheck_calendar_availability— find free slots betweenstartDateandendDatecreate_calendar_event— create an event (startAt,endAt; invitees viauserIds)update_calendar_event— update fields on an existing event (startAt/endAt)delete_calendar_event— delete an eventrsvp_calendar_event— respondACCEPTED/DECLINED/TENTATIVE(uppercase)invite_calendar_attendees— invite attendees byuserIdsremove_calendar_attendee— remove an attendee bytargetUserId
💬 Conversations, Channels & Activity (4 tools)
list_conversations— list conversations for an AI agentread_conversation— read a full conversation transcriptsend_channel_message— post to a CHANNEL page (session auth only — see note below)get_activity— fetch activity feed (workspace/drive/page scope)
Setup Instructions
1. Generate an MCP Token
- Start your PageSpace application
- Navigate to Dashboard > Settings > MCP Connection (or
/dashboard/settings/mcp) - Click Create New Token to generate a new MCP token
- Give your token a descriptive name (e.g., "Claude Desktop", "Development")
- Copy and save the token immediately - it's only shown once for security
2. Configure Claude Desktop
Add this to your Claude Desktop MCP configuration file:
For PageSpace Beta (most common):
{
"mcpServers": {
"pagespace": {
"command": "npx",
"args": [
"-y",
"pagespace-mcp@latest"
],
"env": {
"PAGESPACE_API_URL": "https://beta.pagespace.ai",
"PAGESPACE_AUTH_TOKEN": "<YOUR_PAGESPACE_MCP_TOKEN_HERE>"
}
}
}
}For self-hosted PageSpace:
{
"mcpServers": {
"pagespace": {
"command": "npx",
"args": [
"-y",
"pagespace-mcp@latest"
],
"env": {
"PAGESPACE_API_URL": "https://your-pagespace-domain.com",
"PAGESPACE_AUTH_TOKEN": "<YOUR_PAGESPACE_MCP_TOKEN_HERE>"
}
}
}
}3. Test the Connection
Restart Claude Desktop and try:
"Show me my drives"
Claude should list your available drives, then you can:
"Show me the page tree in [drive-name]"
"Read the [document-name] document"
Claude will guide you through the workflow: drives → page tree → documents → editing!
Usage Examples
Getting Started
"Show me my drives" "Show me the page tree in my-drive" (use driveSlug and driveId from list_drives) "Read the document [page-id]" (use pageId from list_pages)
Line Replacement
"Replace line 15 in [page-id] with a new heading:
<h2>New Section</h2>" (use pageId from list_pages) "Replace lines 8-10 in [page-id] with a code block showing the API example"
Sheet Editing
"Set cell A1 to 100 and B1 to a formula =A1*2 in sheet [page-id]" "Update the budget spreadsheet with new values in cells A1:C5"
Task Management (combined update_task)
"Create a new task 'Review PR' on task list [page-id]" "Update task [task-id] on page [page-id] — set status to completed" "Delete task [task-id] on page [page-id]" (passes
delete: true; trashes the linked DOCUMENT page) "Move task [task-id] on page [page-id] to position 0" (reorders and re-densifies peers) "Read task list [page-id] and tell me which custom statuses are available" (usesavailableStatuses)
Page Management
"Create a new folder called 'Meeting Notes' in drive [drive-id]" "Create a document called 'Project Plan' under parent [parent-id] with some initial content" "Create a new spreadsheet called 'Budget' in drive [drive-id]" "Rename page [page-id] to 'Q4 Project Plan'" "Move page [page-id] to be under parent [parent-id] at position 2"
Trash and Restore
"Move page [page-id] to trash" "Show me what's in the trash for drive [drive-id]" "Restore page [page-id] from trash"
Search Operations
"Search for all pages containing 'TODO' using regex in drive [drive-id]" "Find all pages matching '*.md' pattern" "Search across all my drives for 'API documentation'"
AI Agent Operations
"Create an AI_CHAT page called 'Code Reviewer' in drive [drive-id]" (uses
create_page) "Update agent [agent-id] config — set systemPrompt and enable read_page + regex_search" (usesupdate_agent_config) "List all AI agents across my workspaces" "Ask the 'Documentation Writer' agent to help improve this page"
Calendar
"List my calendar events between [startDate] and [endDate] in ISO 8601" "Create a calendar event 'Standup' from [startAt] to [endAt] and invite users [userIds]" "RSVP ACCEPTED to event [event-id]" "Remove user [targetUserId] from event [event-id]"
Workflow
The typical workflow is: drives → page tree → documents → editing/management.
For content editing: list_drives → list_pages → read_page (with pageId) → replace_lines (with same pageId) For sheet editing: list_drives → list_pages → read_page (SHEET type) → edit_sheet_cells (with pageId and cells) For task management: list_drives → list_pages → update_task (with pageId of TASK_LIST)
Note: The system uses IDs for operations. When you use list_pages, you'll see both the path (for easy reading) and the ID (for operations).
Claude will guide you through each step!
Security Notes
- Each MCP token is scoped to your specific user account
- Tokens can be revoked at any time from the web interface
- The server only accesses your documents, not other users'
- All changes go through the same validation as the web editor
Development
To run the MCP server in development mode:
pnpm run devThis enables file watching for automatic restarts during development.
Troubleshooting
Authentication Errors
- Verify your MCP token is correct and hasn't been revoked
- Check that
PAGESPACE_AUTH_TOKENis set in your MCP configuration
Connection Issues
- Ensure your PageSpace app is running on the specified URL
- Check that the API URL in the MCP config matches your app's URL
Line Number Issues
- Line numbers are 1-based (first line is line 1)
- After operations, Prettier may reformat and change line numbers
- Always read the document first to see current line numbers
API Reference
The MCP server communicates with these PageSpace endpoints:
/api/mcp/drives- Drive discovery and listing/api/mcp/documents- Document operations (GET for reading, POST for write operations)/api/mcp/detect-paths- Path validation and normalization/api/auth/mcp-tokens- MCP token management (GET to list, POST to create)/api/auth/mcp-tokens/[tokenId]- Revoke MCP token (DELETE)
Requirements
- Node.js: >= 18.0.0
- PageSpace: Any version with MCP support
- Claude Desktop or Claude Code with MCP enabled
Contributing
- Fork the repository
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request
Support
- 💬 Discord: Join our Discord for support questions
- 📖 Documentation: PageSpace Docs
License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by the PageSpace Team
