mcpField
N
NotionBae

NotionBae

Local
github.com/mrcunninghamzProductivity0Updated 74w ago

About NotionBae

NotionBae is a .NET C# MCP server that connects AI assistants to Notion workspaces through the Notion API. It uses Markdown as an intermediary for content and supports page search, retrieval, creation, and updates.

Key features

  1. 01Search and filter Notion pages
  2. 02Retrieve page content as Markdown
  3. 03Create pages with content
  4. 04Update pages and retrieve blocks
  5. 05Access workspaces with an integration token

Use cases

  1. 01Find relevant pages in a workspace
  2. 02Provide page content to an AI assistant
  3. 03Create Notion pages from Markdown
  4. 04Update existing page content

MCP support

NotionBae implements an MCP server that offers clients tools to search, retrieve, create, and update Notion pages and blocks. Access to a Notion workspace requires an integration API key.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

NotionBae

A Model Context Protocol (MCP) Server for Notion.com integration, built with .NET C# using ModelContextProtocol. NotionBae leverages the Notion API to provide seamless interaction between AI assistants and Notion workspaces.

Overview

NotionBae provides a bridge between Large Language Models and Notion.com through the Model Context Protocol framework. This allows AI assistants to interact with Notion databases, pages, and content in a seamless and structured way.

Features

  • Integration with Notion API
  • MCP-compliant server implementation
  • Structured data handling for Notion content
  • Authentication and secure access to Notion workspaces

Technologies

  • Notion SDK for .NET: A comprehensive .NET client for the Notion API. While we use this SDK as a foundation, we've implemented our own NotionBaeRestClient to address several limitations:
    • The original SDK's REST client implementation was tightly coupled and didn't follow .NET best practices for dependency injection
    • Our custom client properly utilizes HttpClientFactory, which is crucial for proper handling of connection pooling and lifetime management
    • This redesign allows for better testability and enables polymorphic behavior in our test suites
    • The solution provides true dependency injection rather than the pseudo-DI implementation in the original SDK
  • Markdig: A fast, powerful, and extensible Markdown processor for .NET used for converting between Notion's block structure and Markdown
Why Markdown?

NotionBae uses Markdown as an intermediary format between Notion's complex block structure and AI agents for several reasons:

  1. Token Efficiency: Notion's API returns data in a verbose block structure with many properties. By converting to Markdown, we significantly reduce the number of tokens processed by AI models, potentially improving performance and reducing costs.

  2. Readability: Markdown is inherently human-readable, making the content more accessible for both humans and AI agents.

  3. Simplicity: Working with Markdown is much simpler than handling Notion's nested block structure directly, especially when generating content.

While there's no comprehensive data comparing token usage between raw Notion API responses and Markdown, anecdotal evidence suggests notable efficiency gains when using Markdown as an intermediary format.

Available Tools

NotionBae provides the following tools for interacting with Notion:

Tool NameDescriptionParameters
nb_searchSearches Notion pages and returns their titles and public URLsquery: String - The search query to find matching pages in Notion
nb_create_pageCreates a new Notion page with the given title, description, and contentparentId: String - ID of the parent page
title: String - Title of the new page
description: String - Description for the page
content: String - Markdown content for the page
nb_get_page_contentRetrieves a Notion page with its metadata and full content in markdown formatpageId: String - ID of the page to retrieve
nb_get_blockRetrieves a specific block and its children from NotionblockId: String - ID of the block to retrieve
nb_search_pageAdvanced page search with filtering capabilitiesquery: String - The search query
filter: Object - Optional filter parameters
nb_update_pageUpdates an existing Notion pagepageId: String - ID of the page to update
content: String - New markdown content for the page

Getting Started

1. Notion Account Setup
  1. Create a Notion Account: If you don't already have one, sign up for a Notion account at notion.so.

  2. Create a Notion Integration:

    • Go to Notion Developers
    • Click "New integration"
    • Give your integration a name (e.g., "NotionBae")
    • Select the workspace where you want to use the integration
    • Set appropriate capabilities (at minimum, select "Read content" and "Update content")
    • Click "Submit" to create your integration
  3. Get your API Key:

    • After creating the integration, you'll see your "Internal Integration Secret" (API key)
    • Copy this key as you'll need it for configuring NotionBae
  4. Share Pages with your Integration:

    • Open a Notion page you want to access through NotionBae
    • Click "Share" in the top right
    • In the "Add people, groups, or integrations" field, search for your integration name
    • Select your integration to grant it access to the page
2. Clone and Setup NotionBae
  1. Clone the repository:

    git clone https://github.com/mrcunninghamz/NotionBae.git /path/to/your/directory
    cd /path/to/your/directory
    

    Replace /path/to/your/directory with the actual directory path where you want to clone the repository (e.g., ~/projects/NotionBae or /Users/username/Documents/Projects/NotionBae).

  2. Build the project:

    dotnet build
    
  3. Set up Environment Variables:

    The NotionBae server requires the following environment variables:

    • Notion:AuthToken: Your Notion API key for authentication with Notion's API

    You can obtain a Notion API key by creating an integration in your Notion workspace settings. Visit the Notion API documentation for more information on creating an integration and obtaining an API key. Copy appsettings.template.json to appsettings.json and fill in the value for Notion:AuthToken with your Notion API key.

  4. Run the project:

    dotnet run --project PATH_TO_NOTIONBAE_PROJECT/src/NotionBae.csproj
    

    Replace PATH_TO_NOTIONBAE_PROJECT with the path to your NotionBae project folder (the folder containing the NotionBae.csproj file).

3. MCP Server Configuration

To use NotionBae as an MCP server in VS Code, add the following configuration to your VS Code settings.json file:

"mcp": {
  "servers": {
      "NotionBae": {
        "url": "http://localhost:5001/mcp"
      }
  }
}

Related Projects

This project is part of the "Bae" collection of tools:

  • TestBae - A .NET testing utility library that simplifies test setup with fixtures, mocks, and common testing patterns for more efficient and maintainable test suites.
  • AzBae - Azure DevOps tooling that provides both CLI and GUI interfaces to streamline Azure resource management, deployments, and DevOps workflows.

License

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.