Notion MCP serverand Python AI tasks
qbash hosts a Notion MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse.
Developers use qbash Tasks to write cloud-hosted Python functions that pair Notion with models such as Claude and GPT.
MCP server
Build a Notion MCP server
Give ChatGPT, Claude and your other AI tools access to Notion through one server. You pick which Notion tools it shares, and you can add other connectors, memory folders and Tasks to the same server.
How to set it up
- Connect Notion on the qbash Connectors page.
- Create an MCP server and add the Notion tools you want to share.
- Paste the server URL into your client. It connects with OAuth or an access token.
Python AI task
Write a Notion task in Python
A qbash Task is a hosted Python function that calls Notion and AI models.
Plan the next items from a content calendar
Query a Notion database for rows marked Ready, sorted by due date, then ask an inline prompt to draft a publishing order with links.
rows = qbash.integrations.notion.query_data_source(
database_id="1f2e3d4c5b6a47988776655443322110",
filter={"property": "Status", "status": {"equals": "Ready"}},
sorts=[{"property": "Due", "direction": "ascending"}],
page_size=20,
)
pages = rows.get("pages", [])
if pages:
plan = qbash.ai.run_prompt(
slug="notion-calendar-plan",
variables={"pages": json.dumps(pages)},
)
qbash.output(plan)
else:
qbash.output("Nothing is marked Ready.")
Sample query_data_source response
{
"status": "success",
"data_source_id": "2a3b4c5d-6e7f-4081-92a3-b4c5d6e7f809",
"pages": [
{
"id": "3b4c5d6e-7f80-4192-a3b4-c5d6e7f8091a",
"title": "Python scheduling guide",
"url": "https://www.notion.so/Python-scheduling-guide-3b4c5d6e7f804192a3b4c5d6e7f8091a",
"properties": {
"Status": "Ready",
"Due": "2026-10-06"
}
}
],
"count": 1,
"next_cursor": null,
"has_more": false
}
What the Notion connector can do
- Search the pages and databases shared with the integration by title. Results are pages and data sources (a data source holds a database's rows and schema, and its id is what query_data_source takes)
- Get a database's title, URL and the data sources it contains. Use a data source id from it with query_data_source and create_page
- Get a data source's schema: each property's id, type and, for select, multi_select and status, the option names
- Query the rows of a Notion database (a data source), with optional Notion filter and sorts dicts. Each row comes back with simple property values keyed by property name
- Get a page's title, URL, parent and properties as simple values keyed by property name
- Get a page's body as Notion-flavored markdown, ready to pass to a model or write into a report
- List the direct child blocks of a page or block, each with its type and plain text. Use it to find block ids or walk nested blocks
- List the people and bots in the Notion workspace, with ids to use in people properties. Needs a connection token with user information turned on. Personal access tokens cannot list users
- Create a page as a new row in a database (pass data_source_id or database_id) or as a child of a page (pass parent_page_id), with a title, simple property values and a markdown body
- Update a page's title, property values or icon. Properties take the same simple values as create_page and unlisted properties are left alone
- Append markdown to the end of a page's body, such as a report section or a run log entry
- Append Notion block objects to the end of a page or block. A plain str in the list becomes a paragraph
- Move a page or database row to the Notion trash, or restore it with restore=True
qbash Tasks: AI applications in Python
A Task is a Python function that calls Notion, your other connectors and models such as Claude, GPT, Gemini and Grok. qbash hosts and runs it.
Run Tasks on a schedule or from your team's tools
- Deterministic where it counts Write the logic in Python and call a model only for the steps that need judgement, so the rest runs the same way every time.
- Version controlled Every save is a revision you can compare and roll back.
- Logged Each run records its inputs, output, errors and what started it.
- Shared credentials Connections belong to your organization, so a Task keeps working when its author is away.
Notion MCP questions
Does Notion have an official MCP server?
Yes. Notion runs a remote MCP server at mcp.notion.com/mcp that signs in with OAuth. The qbash server puts Notion on the same URL as your other connectors, and Python tasks can write to the same databases.
Which pages can the Notion MCP server reach?
That depends on the token. A personal access token reaches everything your Notion account can open, and a connection token reaches only the pages and databases shared with that connection.
Related productivity connectors
Build a Notion task
Write it in Python with AI steps, and qbash hosts it with versions and run logs.
Build a Notion MCP server
Pick the Notion tools to share and connect ChatGPT, Claude or Grok Bot.