DEV Community

Cover image for Cortex: The AI-Powered Notion CLI That Builds Your Entire Startup Workspace in 30 Seconds
Raman Sharma
Raman Sharma

Posted on

Cortex: The AI-Powered Notion CLI That Builds Your Entire Startup Workspace in 30 Seconds

Notion MCP Challenge Submission 🧠

This is a submission for the Notion MCP Challenge

"The best way to predict the future is to build it. The fastest way to build it is with Cortex." β€” Modern Founder Proverb πŸ§˜β€β™‚οΈ

What I Built

Cortex is a state-of-the-art CLI agent designed to eliminate the "Organization Tax" that kills startup momentum. Instead of spending hours manually setting up Notion pages, roadmaps, and competitor analyses, Cortex turns a single idea prompt into a fully structured, modular empire in Notion in under 30 seconds.

πŸš€ Key Features:

  • πŸ’‘ Premium Strategy Briefs (idea:): Generates high-end strategy documents using native Notion Callouts, Quotes, and structured Hierarchies.
  • πŸ“‹ Jira-Style Roadmap (tasks:): Creates a native Notion Database with AI-calculated Priority, Status, and Deadlines.
  • 🎭 User Persona Stories (stories:): Maps personas to actions and business value in a dedicated database.
  • πŸ—οΈ Full-Stack Startup Build (build:): Launches a complete "Enterprise Workspace" including both databases and 5 strategy pages in one unified hierarchy.

Video Demo


(See Cortex in action: From an empty terminal to a 7-page populated Notion ecosystem with dual databases!)

Show us the code

The entire project is open-source and built with TypeScript, Node.js, and the Model Context Protocol.

GitHub Repository: https://github.com/RamanSharma100/cortex-notion

How I Used Notion MCP

Cortex isn't just a simple API wrapper; it's a sophisticated orchestration of the Model Context Protocol (MCP).

The Implementation

We use @modelcontextprotocol/sdk/client to manage a live stdio transport connection with the @notionhq/notion-mcp-server. This allows the AI to execute high-level tools via the same protocol used by tools like Claude Desktop and Cursor.

// Spawn the Notion MCP server as a subprocess
const transport = new StdioClientTransport({
    command: 'npx',
    args: ['@notionhq/notion-mcp-server'],
    env: {
      OPENAPI_MCP_HEADERS: JSON.stringify({
        Authorization: `Bearer ${token}`,
        'Notion-Version': '2022-06-28',
      }),
    },
  });

const client = new Client(
  { name: 'notion-cortex', version: '1.0.0' },
  { capabilities: {} },
);

await client.connect(transport);

// Write to Notion via MCP tool calls, NOT a direct REST API
await client.callTool({ 
  name: "API-post-page", 
  arguments: { 
    parent: { workspace: true },
    properties: { title: { title: [{ text: { content: "New Startup" } }] } }
  } 
});
Enter fullscreen mode Exit fullscreen mode

What it Unlocks

  1. Rich Structural Integrity: By using MCP tool calls, we can reliably convert Markdown (headers, quotes, callouts) into native Notion block objects on-the-fly.
  2. Resilient Multi-Model Architecture: Cortex cycles through a Gemini Array (3.1 Pro, 3 Flash, 2.5 Flash) with GPT-4.1 as a fail-safe. If one model hits a rate limit, the MCP connection remains stable while the CLI intelligently pivots to the next model.
  3. Complex Data Relations: MCP makes it trivial to inject complex database properties like Status, Select, and Date without manually constructing massive JSON payloads for the REST API.

β€œWhy did the startup founder cross the road?”
β€œTo find a more sustainable way to disrupt the other side.” πŸ˜‚ πŸš€

Seriously, the goal of Cortex is to eliminate the friction of starting. Stop clicking, start building.

notion #startup #ai #cli #typescript #automation #devchallenge #gemini #mcp

Top comments (0)