N.I.L.O. Docs

Core API

This document records the current Core capabilities under src/nilo/core/. Core is the only business logic layer. CLI and MCP tools call Core instead of calling the Notion SDK directly.

Configuration

Module: src/nilo/core/config.py

The default global file is ~/.notion_mcp/config.json, unless NOTION_MCP_CONFIG selects another file. Project configuration is the nearest .notion_mcp/config.json below the active search boundary, including workspaces outside the home tree. Project settings take precedence over global settings, but credentials remain global-only. Initializing a project creates the root .gitignore when needed and incrementally adds the exact .notion_mcp/ entry without replacing existing content.

Error Model

Module: src/nilo/core/errors.py

CLI JSON output and MCP tool responses should reuse these structures.

Notion SDK Client

Module: src/nilo/core/client.py

Authentication

Module: src/nilo/core/auth.py

Audit

Module: src/nilo/core/audit.py

Notion Domain Services

Directory: src/nilo/core/services/

Current service modules:

These services depend only on Core and a Notion SDK-compatible client. They do not import CLI or MCP layers.

Module src/nilo/core/services/provider.py is the canonical shared composition point for the client and domain services. CLI, MCP, and compatibility adapters import these Core providers instead of maintaining their own factories.

Shared Runtime API

Directory: src/nilo/runtime/

Runtime owns shared non-business execution behavior used by adapters:

Runtime may depend on Core contracts. Core and Runtime do not import CLI or MCP adapters, and CLI does not import MCP.

Raw API

Module: src/nilo/core/services/raw_api.py