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
- 01Search and filter Notion pages
- 02Retrieve page content as Markdown
- 03Create pages with content
- 04Update pages and retrieve blocks
- 05Access workspaces with an integration token
Use cases
- 01Find relevant pages in a workspace
- 02Provide page content to an AI assistant
- 03Create Notion pages from Markdown
- 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.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMENotionBae
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
NotionBaeRestClientto 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:
-
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.
-
Readability: Markdown is inherently human-readable, making the content more accessible for both humans and AI agents.
-
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 Name | Description | Parameters |
|---|---|---|
| nb_search | Searches Notion pages and returns their titles and public URLs | query: String - The search query to find matching pages in Notion |
| nb_create_page | Creates a new Notion page with the given title, description, and content | parentId: String - ID of the parent pagetitle: String - Title of the new pagedescription: String - Description for the pagecontent: String - Markdown content for the page |
| nb_get_page_content | Retrieves a Notion page with its metadata and full content in markdown format | pageId: String - ID of the page to retrieve |
| nb_get_block | Retrieves a specific block and its children from Notion | blockId: String - ID of the block to retrieve |
| nb_search_page | Advanced page search with filtering capabilities | query: String - The search queryfilter: Object - Optional filter parameters |
| nb_update_page | Updates an existing Notion page | pageId: String - ID of the page to updatecontent: String - New markdown content for the page |
Getting Started
1. Notion Account Setup
-
Create a Notion Account: If you don't already have one, sign up for a Notion account at notion.so.
-
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
-
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
-
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
-
Clone the repository:
git clone https://github.com/mrcunninghamz/NotionBae.git /path/to/your/directory cd /path/to/your/directoryReplace
/path/to/your/directorywith the actual directory path where you want to clone the repository (e.g.,~/projects/NotionBaeor/Users/username/Documents/Projects/NotionBae). -
Build the project:
dotnet build -
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:AuthTokenwith your Notion API key. -
Run the project:
dotnet run --project PATH_TO_NOTIONBAE_PROJECT/src/NotionBae.csprojReplace
PATH_TO_NOTIONBAE_PROJECTwith 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
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.