PHPackages                             rajurayhan/laravel-notion-mcp-server - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. rajurayhan/laravel-notion-mcp-server

ActiveLibrary[API Development](/categories/api)

rajurayhan/laravel-notion-mcp-server
====================================

Notion MCP server for Laravel — expose Notion REST API as AI-callable MCP tools

00PHP

Since Apr 23Pushed 1mo agoCompare

[ Source](https://github.com/rajurayhan/laravel-notion-mcp-server)[ Packagist](https://packagist.org/packages/rajurayhan/laravel-notion-mcp-server)[ RSS](/packages/rajurayhan-laravel-notion-mcp-server/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Notion MCP Server
=========================

[](#laravel-notion-mcp-server)

A Laravel package that exposes the Notion REST API as Model Context Protocol (MCP) tools — making common Notion actions available to AI agents and coding assistants.

Built on top of `laravel/mcp` for the MCP server infrastructure.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12
- `laravel/mcp` &gt;= 0.1.0

Installation
------------

[](#installation)

### 1. Require the package

[](#1-require-the-package)

```
composer require rajurayhan/laravel-notion-mcp-server
```

If you're developing locally, add it as a path repository:

```
// composer.json (host app)
{
  "repositories": [
    {
      "type": "path",
      "url": "../laravel-notion-mcp-server"
    }
  ]
}
```

### 2. Publish the config

[](#2-publish-the-config)

```
php artisan vendor:publish --tag=notion-mcp-config
```

### 3. Set environment variables

[](#3-set-environment-variables)

```
# Notion API connection (required)
NOTION_API_TOKEN=your_notion_integration_token

# API base URL (optional)
NOTION_API_BASE_URL=https://api.notion.com

# Notion API version (optional; use >= 2025-09-03 for data_sources endpoints)
NOTION_API_VERSION=2022-06-28

# MCP route (optional, defaults shown)
NOTION_MCP_ROUTE_PREFIX=mcp/notion

# Optional: register a local MCP handle for `php artisan mcp:start`
NOTION_MCP_REGISTER_LOCAL=false
NOTION_MCP_LOCAL_HANDLE=notion
```

The MCP server will be available at `https://yourapp.com/mcp/notion`.

Configuration
-------------

[](#configuration)

```
// config/notion-mcp.php
return [
    'route_prefix'     => env('NOTION_MCP_ROUTE_PREFIX', 'mcp/notion'),
    'route_middleware' => ['web'], // add 'auth:sanctum' to restrict access
    'register_local'   => env('NOTION_MCP_REGISTER_LOCAL', false),
    'local_handle'     => env('NOTION_MCP_LOCAL_HANDLE', 'notion'),

    'api' => [
        'base_url'        => env('NOTION_API_BASE_URL', 'https://api.notion.com'),
        'token'           => env('NOTION_API_TOKEN'),
        'version'         => env('NOTION_API_VERSION', '2022-06-28'),
        'timeout_seconds' => env('NOTION_API_TIMEOUT_SECONDS', 15),
    ],
];
```

Tools Reference
---------------

[](#tools-reference)

This package registers **14 tools**:

- `notion-search`
- `notion-fetch`
- `notion-create-pages`
- `notion-update-page`
- `notion-move-pages`
- `notion-duplicate-page`
- `notion-create-database`
- `notion-update-data-source` (requires `NOTION_API_VERSION` &gt;= `2025-09-03`)
- `notion-create-comment`
- `notion-get-comments`
- `notion-get-teams`
- `notion-get-users`
- `notion-create-view`
- `notion-update-view`

How it’s registered
-------------------

[](#how-its-registered)

The service provider auto-registers an MCP endpoint using:

- **route**: `NOTION_MCP_ROUTE_PREFIX` (default `mcp/notion`)
- **middleware**: `notion-mcp.route_middleware` (default `['web']`)

No changes are required in your host app’s `routes/*.php`.

Middleware / Authentication
---------------------------

[](#middleware--authentication)

By default, the route uses the `web` middleware group. To restrict MCP access, set:

```
// config/notion-mcp.php
'route_middleware' => ['web', 'auth:sanctum'],
```

Local (stdio) server (optional)
-------------------------------

[](#local-stdio-server-optional)

If you set `NOTION_MCP_REGISTER_LOCAL=true`, you can run:

```
php artisan mcp:start notion
```

Notes
-----

[](#notes)

- Notion’s MCP endpoint is **POST-only** by design (`laravel/mcp`); browsers hitting `GET /mcp/notion` will receive **405**.
- Prefer smaller `page_size` values for Notion list/search endpoints.
- For data source tools, set `NOTION_API_VERSION` to **`2025-09-03`** or newer.

Troubleshooting
---------------

[](#troubleshooting)

- **401 / "Notion API is not configured."**: ensure `NOTION_API_TOKEN` is set and the integration is shared with the target pages/databases.
- **403**: the integration token lacks access to that page/database (share it in Notion).
- **400 on data\_sources**: you likely need `NOTION_API_VERSION=2025-09-03` (or newer).

License
-------

[](#license)

MIT — see `LICENSE`.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance60

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6824950?v=4)[Raju Rayhan](/maintainers/rajurayhan)[@rajurayhan](https://github.com/rajurayhan)

---

Top Contributors

[![rajurayhan](https://avatars.githubusercontent.com/u/6824950?v=4)](https://github.com/rajurayhan "rajurayhan (2 commits)")

### Embed Badge

![Health badge](/badges/rajurayhan-laravel-notion-mcp-server/health.svg)

```
[![Health](https://phpackages.com/badges/rajurayhan-laravel-notion-mcp-server/health.svg)](https://phpackages.com/packages/rajurayhan-laravel-notion-mcp-server)
```

###  Alternatives

[facebook/php-business-sdk

PHP SDK for Facebook Business

90923.5M35](/packages/facebook-php-business-sdk)[exsyst/swagger

A php library to manipulate Swagger specifications

35916.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
