npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

pagespace-mcp

v2.0.3

Published

Model Context Protocol (MCP) server for PageSpace with complete workspace management, powerful search, task handling, sheet editing, and AI agent capabilities. Provides external access to all core PageSpace functionality.

Readme

PageSpace MCP Server

npm version License: MIT

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

  1. Set up MCP tokens in your PageSpace instance
  2. Configure Claude Desktop/Code with your tokens (no installation needed!)
  3. Start editing your PageSpace documents with Claude!

Features

  • 22 Powerful Tools: Complete workspace management with drive, page, search, and AI agent operations
  • Full CRUD Operations: Create, read, update, and delete pages of all types
  • Page Management: Move, reorder, trash, and restore pages with hierarchy support
  • Line-based editing: Replace specific lines with precision
  • Sheet editing: Edit spreadsheet cells with formulas support
  • Task management: Create and update tasks on TASK_LIST pages
  • Multi-page types: Support for FOLDER, DOCUMENT, CHANNEL, AI_CHAT, CANVAS, SHEET, TASK_LIST
  • Advanced Search: Regex and glob pattern search across drives and pages
  • AI Agent Integration: Create, configure, and communicate with AI agents
  • Trash system: Safe soft-delete with restore capabilities for pages and drives
  • HTML-aware: Automatic Prettier formatting for documents
  • Secure: User-specific authentication tokens
  • Real-time sync: Changes appear immediately in the web editor

Available Tools

📁 Core Drive & Page Operations (10 tools)

  • list_drives - List all available workspaces/drives with access permissions
  • list_pages - Explore page tree structure within a specific drive
  • read_page - Read any document content with line numbers and metadata
  • create_page - Create new pages (FOLDER, DOCUMENT, CHANNEL, AI_CHAT, CANVAS, SHEET, TASK_LIST)
  • rename_page - Rename existing pages with validation
  • rename_drive - Rename existing drives (owner only)
  • move_page - Move or reorder pages within drive hierarchy
  • list_trash - List all trashed pages in a drive
  • trash - Move pages or drives to trash (with safety confirmation for drives)
  • restore - Restore pages or drives from trash

✏️ Content Editing (3 tools)

  • replace_lines - Replace specific line(s) with new content (1-based indexing)
  • edit_sheet_cells - Edit cells in SHEET pages (supports values and formulas)
  • update_task - Create or update tasks on TASK_LIST pages

🚀 Drive Management (1 tool)

  • create_drive - Create new workspaces/drives

🔍 Search & Discovery (3 tools)

  • regex_search - Search page content using regular expressions
  • glob_search - Find pages using glob patterns for titles/paths
  • multi_drive_search - Search across multiple drives simultaneously

🤖 AI Agent System (5 tools)

  • create_agent - Create new AI agents with custom system prompts and tools
  • update_agent_config - Update agent configuration, prompts, and enabled tools
  • list_agents - List all AI agents in a specific drive
  • multi_drive_list_agents - List AI agents across all accessible drives
  • ask_agent - Consult AI agents for specialized assistance (supports tool usage)

Setup Instructions

1. Generate an MCP Token

  1. Start your PageSpace application
  2. Navigate to Dashboard > Settings > MCP Connection (or /dashboard/settings/mcp)
  3. Click Create New Token to generate a new MCP token
  4. Give your token a descriptive name (e.g., "Claude Desktop", "Development")
  5. 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

"Create a new task 'Review PR' on my task list [page-id]" "Update task [task-id] status to completed"

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 agent called 'Code Reviewer' with tools for reading and analyzing pages" "List all AI agents across my workspaces" "Ask the 'Documentation Writer' agent to help improve this page"

Workflow

The typical workflow is: drivespage treedocumentsediting/management.

For content editing: list_driveslist_pagesread_page (with pageId) → replace_lines (with same pageId) For sheet editing: list_driveslist_pagesread_page (SHEET type) → edit_sheet_cells (with pageId and cells) For task management: list_driveslist_pagesupdate_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 dev

This 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_TOKEN is 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

  1. Fork the repository
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Support

License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by the PageSpace Team