N.I.L.O. Docs

Configuration

This document explains how to prepare a Notion internal connection, save the global token, and create project-local .notion_mcp/ context.

Prepare Notion Access

Before configuring nilo, create a Notion internal connection and grant it access to the pages or databases you want to use.

  1. Create a Notion internal connection.
  1. Configure connection capabilities.
  1. Share the connection with target content.
  1. Get a page ID.
nilo page attach "https://www.notion.so/Example-3799a1afb97a80489bb0e7384f334958?source=copy_link"
nilo page retrieve "[Example](https://www.notion.so/Example-3799a1afb97a80489bb0e7384f334958?source=copy_link)"
  1. Get a database ID.
  1. Get a data source ID.
nilo database sources <database_id>
  1. Check the token identity.
nilo config --global user.token ntn_xxx
nilo auth whoami --json

Reference:

Global Configuration

Global configuration stores user-level runtime settings such as the Notion token, display name, Notion API version, timeout, and retry settings.

The default path is:

~/.notion_mcp/config.json

Use NOTION_MCP_CONFIG to point to another file:

NOTION_MCP_CONFIG=/path/to/config.json nilo config --global --show

Common commands:

nilo config --global user.token ntn_xxx
nilo config --global user.name "Ada"
nilo config --global --show
nilo config --global --show --json

nilo config --global --show reports whether a token is set, but it does not print the raw token.

Project-Local Configuration

Project-local configuration lets the CLI discover context by walking upward from the current directory, similar to Git. Inside a project directory, you can avoid repeatedly passing page IDs, database IDs, and data source IDs.

Project-local configuration lives at:

.notion_mcp/config.json

It does not store the token. Tokens stay in global configuration.

Initialize the current directory:

nilo init --project-name "Demo"
nilo init --workspace-hint "Team Workspace" --json

Inspect local context:

nilo config --local --show
nilo config --local --show --json
nilo pwd

Example local configuration:

{
  "schema_version": 1,
  "project_name": "Demo",
  "workspace_hint": "Team Workspace",
  "settings": {
    "prefer_attached_page": true,
    "prefer_attached_database": true,
    "json_output_default": false
  }
}

Page Attachment

page attach binds a default page for the current project. It does not upload files.

nilo page attach <page_id>
nilo page status
nilo page retrieve
nilo page blocks

Detach the default page:

nilo page detach

Refresh local page state:

nilo page refresh

page refresh pulls title, URL, and status from Notion and updates local state. It does not modify the remote page.

Database Attachment

A database is a container, and a data source is the concrete table under that container. Database attachment stores both the bound database and the active data source.

nilo database attach <database_id>
nilo database attach <database_id> --data-source <data_source_id_or_name>
nilo database status
nilo database query --payload '{"page_size": 10}'

Detach the database:

nilo database detach

Refresh local database state:

nilo database refresh

database refresh pulls database title, URL, data sources, and status from Notion. It does not modify the remote database.

Common Workflows

Set the global token and initialize the current repository:

nilo config --global user.token ntn_xxx
nilo config --global user.name "Ada"
nilo config --global --show
nilo init --project-name "Demo"
nilo config --local --show

Attach a page and read it:

nilo page attach <page_id>
nilo page retrieve
nilo page blocks --tree

Attach a database and query the active data source:

nilo database attach <database_id> --data-source Tasks
nilo database sources
nilo database query --payload '{"page_size": 10}'

Operate on a data source explicitly:

nilo data-source query <data_source_id> --payload '{"page_size": 10}'
nilo data-source property rename <data_source_id> Status State