Repository navigation
Conversation
New CLI surfaces for MCP tools that had none:
page move <page> --parent <page> | --parent-db <db> notion-move-pages
page duplicate <page> [--json] notion-duplicate-page
user list [--query] [--limit] [--json] notion-get-users
user me [--json] notion-get-users user_id=self
Client.MovePage, Client.DuplicatePage and Client.ListUsers live in
internal/mcp/pages.go, with the tool-argument building and response parsing
split into pure functions covered by unit tests. Commands resolve pages and
databases by URL, name, or ID like the rest of the CLI. user list follows the
server cursor to the end so large workspaces return every member rather than
only the first page; --query pushes the filter to the server and --limit bounds
the result.
Two response shapes differ from what the client assumed, so --json returned an
empty id and url where a script needs them to chain calls:
* notion-create-pages answers with a {"pages":[...]} wrapper, not a flat
object
* notion-duplicate-page answers with page_id and page_url, not id and url
* the server returns app.notion.com URLs, while URL extraction matched only
www.notion.so; it now matches either host
* when the server answers in prose, the duplicated page id is recovered from
the URL
README.md and skills/notion/SKILL.md document the new commands. SKILL.md also
records that page edit -P key=value already handles property edits, and that
the official API fallback needs an internal integration secret from
notion.so/profile/integrations/internal (the MCP OAuth token is rejected by
api.notion.com with 401), which only reaches pages explicitly connected to it.
mariotsi
marked this pull request as ready for review
September 8, 2026 07:51
Author
|
@lox any chance this can be reviewed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The MCP layer already reaches
notion-move-pages,notion-duplicate-page, andnotion-get-users, but none of them have a CLI surface.Separately,
page create --jsonreturns an emptyidandurl: it reads aflat object, but the server wraps the created page in a
{"pages":[...]}envelope and returns an
app.notion.comURL that the extractor, which onlymatches
www.notion.so, misses. A script cannot pick up the new page.What
New commands:
page move <page> --parent <page>/--parent-db <db>notion-move-pagespage duplicate <page> [--json]notion-duplicate-pageuser list [--query] [--limit] [--json]notion-get-usersuser me [--json]notion-get-userswithuser_id=selfClient.MovePage,Client.DuplicatePage, andClient.ListUsersland ininternal/mcp/pages.go, with argument building and response parsing as purefunctions under unit test. Commands resolve pages and databases by URL, name, or
ID like the rest of the CLI.
user listfollows the server cursor to the end solarge workspaces return every member instead of only the first page;
--querypushes the filter server-side and
--limitbounds the result.page duplicate --jsonreadspage_id/page_urlfrom the response and recovers the id fromthe URL when the server replies in prose.
page create --jsonnow reads thepagesenvelope and accepts a page URL oneither
www.notion.soorapp.notion.com, soidandurlare populated.README.mdandskills/notion/SKILL.mddocument the new commands.SKILL.mdalso notes that
page edit -P key=valuealready handles property edits, andthat the official API fallback needs an internal integration secret from
notion.so/profile/integrations/internal(the MCP OAuth token is rejected byapi.notion.comwith 401), reaching only pages explicitly connected to it.Testing
go build ./...,go vet ./..., andgo test ./...pass. New unit tests covermove-argument building, create/duplicate response parsing, the multi-host URL
match, and user-list cursor handling.