Notion Terminal MCP
Enables Notion Custom Agents to execute terminal commands and manage files on a Windows host via MCP, with restricted mode for safety.
README
Notion Terminal MCP
Give a Notion Custom Agent authenticated access to a Windows terminal and filesystem through the Model Context Protocol (MCP).
No domain? No Cloudflare account? The included one-command launcher creates a temporary HTTPS URL for you.
[!CAUTION] This server can execute commands and modify files on its host. Start in restricted mode, use a dedicated Windows account, keep the API key private, and enable full access only when you understand the consequences.
Why this project?
- Native MCP Streamable HTTP endpoint at
/mcp - PowerShell and Command Prompt execution
- Read, write, list, inspect, move, create, and delete filesystem entries
- Constant-time Bearer token or
X-API-Keyauthentication - Restricted workspace mode by default
- Explicit opt-in full host access
- Command timeouts and configurable output/file limits
- Host-header allowlist and filesystem-root deletion protection
- Free, zero-account HTTPS quick tunnel for testing with Notion
- Windows-first setup with Node.js 20+
Quick start
Requirements: Windows, Node.js 20 or newer, and npm.
git clone https://github.com/Speedstu/notion-terminal-mcp.git
cd notion-terminal-mcp
npm install
.\setup.ps1
.\start-public.ps1
The launcher verifies the official Cloudflare binary signature, starts the MCP server, and prints:
- The public URL to paste into Notion, such as
https://random-name.trycloudflare.com/mcp. - The authentication header name:
Authorization. - The value:
Bearer <your generated key>.
Keep the PowerShell window open. A Quick Tunnel URL is temporary and changes after a restart.
Connect it to Notion
In your Notion Custom Agent settings:
- Open Tools & Access.
- Choose Add connection → Custom MCP server.
- Paste the
/mcpURL printed bystart-public.ps1. - Select header-based authentication.
- Add
Authorization: Bearer <your MCP_API_KEY>. - Review every exposed tool and its confirmation policy before enabling it.
Notion Custom MCP connections require a publicly reachable hosted URL and support OAuth or header-based authentication. See the Notion documentation.
Local development
npm install
.\setup.ps1
npm run check
npm run build
npm start
Health check: http://127.0.0.1:3000/health
MCP endpoint: http://127.0.0.1:3000/mcp
Tools
| Tool | Purpose |
|---|---|
terminal_execute |
Run a PowerShell or cmd command with a working directory and timeout |
file_read |
Read UTF-8 or base64 file data with offsets and size limits |
file_write |
Create, overwrite, or append UTF-8/base64 data |
file_list |
List a directory, optionally recursively |
file_stat |
Inspect file or directory metadata |
file_mkdir |
Create a directory and missing parents |
file_move |
Move or rename a filesystem entry |
file_delete |
Permanently delete a file or explicitly recursive directory |
Configuration
setup.ps1 generates an ignored .env file with a random 256-bit key.
| Variable | Default | Description |
|---|---|---|
MCP_API_KEY |
generated | Bearer/API key; minimum 32 characters |
HOST |
127.0.0.1 |
Listening interface |
PORT |
3000 |
Listening port |
FULL_ACCESS |
false |
Allow terminal and file tools outside FILES_ROOT |
FILES_ROOT |
./workspace |
Allowed root in restricted mode |
ALLOWED_HOSTS |
localhost + Quick Tunnels | Semicolon-separated Host patterns |
COMMAND_TIMEOUT_MS |
120000 |
Default command timeout |
MAX_OUTPUT_BYTES |
1048576 |
Maximum captured stdout/stderr per stream |
MAX_FILE_BYTES |
10485760 |
Maximum bytes per file read/write |
To deliberately grant the server the Windows account's full permissions:
FULL_ACCESS=true
Security model
- Requests to
/mcprequire a valid API key. - The API key is compared in constant time and never committed by default.
- Restricted mode prevents paths outside
FILES_ROOT. - Full access means exactly that: commands may read secrets, install software, or destroy data accessible to the Windows account.
- Quick Tunnels are intended for development, have no uptime guarantee, and expose the endpoint to the public Internet. Authentication remains mandatory.
- Never paste an API key, GitHub token,
.env, or tunnel logs into an issue.
Please report vulnerabilities according to SECURITY.md, not through a public issue.
Roadmap
- Linux and macOS shell adapters
- Fine-grained per-tool allow/deny policies
- Audit log with secret redaction
- Long-running job management
- Optional OAuth authorization server
- Automated MCP protocol compatibility tests and CI
Contributions are welcome. See CONTRIBUTING.md.
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。