Use the MCP connector correctly.

Connectors are the least discussed part of Routines. The original documentation only devoted a few paragraphs to them. All guides skipped the Notion MCP installation step. Meanwhile, incorrect connector configuration accounted for the majority of errors in the first week.

Why is this lesson more important than it seems?

Connectors are the least discussed part of Routines. The initial documentation only devoted a few paragraphs to them. All guides skipped the "setting up Notion MCP" step. Meanwhile, incorrect connector configuration accounted for the majority of errors in the first week: Routines failing to find data, routines with excessive access permissions, and routines automatically ceasing operation when the OAuth token expired.

 

In this lesson, you will learn the standard operating model for all MCP connectors supported by OAuth. Once you understand the workflow of one connector (we will use Notation), you will understand it for all other connectors.

What exactly is an MCP connector?

The Model Context Protocol (MCP) is how Claude Code communicates with external services. A connector is an MCP "server"—a small, hosted process or endpoint that acts as an intermediary between Claude and the service on the other side.

When you see "Notion MCP" in the list of connectors, what's actually happening is:

  • There is a Notion MCP server somewhere (hosted or local).
  • Claude Code sends MCP-formatted messages to that server.
  • The authentication server uses Notion on your behalf.
  • The server displays Notion's operations to Claude as "tools" (searching for pages, reading the database, creating pages, etc.).

For routines, Anthropic's cloud calls connectors on behalf of your routine, then exposes those tools within the routine's Claude Code session.

Standard OAuth flow (e.g., Notion)

Setting up Notion MCP is one of the most straightforward setups and directly corresponds to Gmail, Slack, Linear, and most other OAuth-supported connectors. Here's the process, step by step:

 

Step 1: Create a toolkit

In the MCP provider's console (for hosted MCP), create a toolkit. This is a package of named operations that you are ready to expose to Claude.

For Notion, a starter kit might include:

  • search_pages- Full-text search across your entire workspace
  • read_page- retrieve the content of a page
  • read_database- database query Notion
  • create_page- Create a new page (optional - consider carefully)

Deliberately exclude operations you don't need: delete_page, update_permissions, create_database. The toolkit is your first scope limiting gateway.

Step 2: Add registered users

The user has registered on behalf of Claude Code as an identity. Treat it as a service account.

When you create it, you'll get a unique MCP URL – this is how Claude Code finds the connector. Keep this URL private; it's essentially an authentication tool.

Step 3: Verify the target service

From the registered user page, start the OAuth flow for Notion. This will open Notion's authentication screen.

Important step : When the notification asks which pages and databases you want to share, be very specific. Don't click "share entire workspace" unless the routine absolutely requires it. Share only:

  • The specific database that the routine reads from.
  • The specific page or folder that the routine writes to.

If the Notification allows you to select "Sub-pages included: no", select that option. If you are sharing a database, only share that database, not its parent database.

This is the most important security decision you'll make with MCP connectors. A compromised routine can do exactly what its OAuth scope allows—nothing more, nothing less.

Step 4: Gather verification information

Now you have two things:

  • MCP URL - where Claude Code sends the request
  • API key - how Claude Code authenticates with the MCP server

Store both in your secret manager or 1Password. You will paste them into Claude Code once.

 

Step 5: Add connectors to Claude Code

In your local Claude Code, run:

claude mcp add notion  --url "https://your-mcp-url.example.com"  --key "$NOTION_MCP_KEY" 

Check if it's working:

claude mcp list

You will see it notionin the list with the status connected.

Step 6: Activate Routines

Open Claude web or desktop → Settings → Connectors . Your connector notification is now listed. It's available for any routine you use.

When you create a new routine, the Notation connector will appear in the routine form. Remember from Lesson 2: it's enabled by default. Turn it off unless the routine actually needs it.

Same flow, but with different connectors.

The exact steps may vary slightly depending on the service, but the general pattern is the same. Here's how it's mapped:

Step Notion Gmail Slack Linear Postgres
1. Tool kit Select an action Select range (for drafts.create only) Select channel + activity Select workspace + type of incident Select table (read-only)
2. Registered users In the MCP dashboard Google Cloud OAuth application Configure the Slack application. Linear API token DB User Accounts
3. Authentication OAuth, scope to database OAuth, scope to label OAuth, scope to channels API token DB password, SSL
4. Collect credits MCP URL + key OAuth client secret Bot token API token Chain of connections
5. Add Claude claude mcp add claude mcp add claude mcp add claude mcp add claude mcp add
6. Activate each routine In the usual way According to routine According to routine According to routine According to routine

Principle : Create a group of operations, authenticate Claude with the service with the narrowest possible permissions, collect login information, add it to the Claude Code, and attach it to each routine.

Postgres: Database Case

Postgres is slightly different because the authentication model is username + password, not OAuth. The principle still applies - minimum privileges - but the implementation is:

  1. Create a dedicated database user with a clear name like this:claude_routines_readonly
  2. Grant SELECT permissions only to the specific tables that the routine needs:sql GRANT SELECT ON orders, customers, subscriptions TO claude_routines_readonly;
  3. Never grant permissions to INSERT, UPDATE, DELETEorALL PRIVILEGES
  4. Use SSL - do not connect via regular TCP.
  5. Add the Claude Code with the connection string in your secret manager.

A routine that can only read specific tables is much safer than a routine that has full access to the database. It's also easier to debug ("why was this row modified?") because you know the routine isn't the cause.

 

3 common pitfalls

From the early days of receiving feedback from the community, the three most common types of errors were:

Trap 1: Setting up OAuth with too wide a scope.

Someone clicks "Share entire workspace" in Notion, "Full mailbox" in Gmail, "All channels" in Slack. The routine works – but it's 10 times more dangerous than necessary. If the prompt has an error (or the API key is leaked), the impact will be on the entire workspace.

Solution : At the time of OAuth, limit the scope to specific resources. If you cannot limit the scope more narrowly, use a separate account with access only to what the routine needs.

Trap 2: Tokens expire after approximately 30 days.

Your OAuth token has expired. If your routine worked fine for two weeks and then silently stopped producing output, the token may have expired. The routine is still running, but the connector is silently failing.

Troubleshooting : Check your run history for connector errors. Re-authenticate as needed. For highly trusted routines, set calendar reminders to rotate validation credentials monthly. Anthropic is developing an auto-refresh feature, but don't expect too much at this point.

Trap 3: Overloaded connector lists in new routines

You set up 7 connectors within a month. You create a new routine. All 7 are enabled by default. The routine only needs one connector. Now, Claude has 7 times the tool surface area, a longer context per run, and 7 potential error locations.

Solution : Make the "disable unused connectors" action the second step you take when creating a new routine, right after setting up the trigger.

Exercise: Connect a connector end-to-end.

Choose a service you use daily – Notion, Linear, Slack, Gmail, or a small Postgres database. Follow the 6 steps above. Specifically:

  1. Create toolkits or sets of narrow permissions.
  2. Create credentials
  3. Run the command claude mcp addwith the minimum range.
  4. Verify by commandclaude mcp list
  5. Open a new routine → confirm the connector appears in the form.
  6. Then disable it (we won't be using it yet - just to demonstrate that the flow works).

Finally, you will have a working, limited-range connector, ready to incorporate into your end-of-course routines in Lesson 8.

Key points to remember

  • Standard process: Toolkit → Registered user → Scope-based OAuth → Authentication information claude mcp add→ Activation for each routine
  • Always set the scope at the time of OAuth, not afterward - a narrow scope is better than a wide one.
  • Postgres follows similar principles for DB users: Read-only, dedicated, table-specific.
  • Three pitfalls: Wide scope, token expiration, and overloaded connector lists in new routines.
  • Disable unused connectors when creating each new routine.
  • Question 1:

    You want a routine to read data from a Postgres database. What is the safest permission strategy?

    EXPLAIN:

    Dedicated database users have minimum permissions as per the standard model. Read-only access is limited to the exact tables that the routine queries. If the routine is compromised, the scope of impact is precisely what you allowed it to touch—no more.

  • Question 2:

    What is the correct way to understand 'registered users' in the MCP OAuth flow?

    EXPLAIN:

    Registered users are how Claude is identified by external services. This user's permissions—the pages, channels, databases, or tables the user can access—determine what your routine can see and change. Limit permissions tightly.

  • Question 3:

    Which of the following statements about MCP connectors and routines is TRUE?

    EXPLAIN:

    This is a direct quote from Anthropic's documentation. The default behavior is 'all enabled,' meaning new routines have overly broad tool access unless you explicitly trim the list. Make this a habit.

 

Training results

You have completed 0 questions.

-- / --

Related posts
Other Program articles
  • Cost Engineering: Keep costs below daily limits.

    ngoài giới hạn mỗi lần chạy, các routine cũng tiêu tốn tài nguyên đăng ký của bạn giống như những phiên tương tác. vì vậy, một lần chạy tiêu tốn 50.000 token sẽ được tính vào token và số lần chạy của bạn.
  • Comparing Routines with GitHub Actions, Zapier, n8n, and Cron

    routines nằm trong một hệ sinh thái đã có github actions, zapier, n8n, make, cron và hàng tá công cụ quản lý workflow khác. không công cụ nào trong số đó sẽ biến mất.
  • Set up your first routine in 10 minutes.

    xây dựng một routine phân loại công việc tồn đọng theo lịch trình, chạy vào các ngày trong tuần lúc 9 giờ sáng. bài học này bao gồm giao diện người dùng của routine, cách lên lịch và lỗi lớn nhất mà người mới bắt đầu thường mắc phải.
  • GitHub Event Routine: A PR Evaluation Tool

    hầu hết những gì bạn thực sự muốn ai thực hiện - xem xét code, phân loại vấn đề, kiểm tra tài liệu - đều mang tính phản ứng, chứ không phải định kỳ.
  • API Trigger: Stripe Webhook for email composition

    api trigger là linh hoạt nhất: bất kỳ hệ thống nào có thể gửi yêu cầu post đến một url đều có thể kích hoạt routine của bạn.
  • Install and run OpenClaw for the first time on any platform.

    cài đặt openclaw trên macos, linux hoặc windows và hoàn thành tác vụ hỗ trợ ai đầu tiên của bạn trong vòng chưa đầy 5 phút
Category

System

Windows XP

Windows Server 2012

Windows 8

Windows 7

Windows 10

Wifi tips

Virus Removal - Spyware

Speed ​​up the computer

Server

Security solution

Mail Server

LAN - WAN

Ghost - Install Win

Fix computer error

Configure Router Switch

Computer wallpaper

Computer security

Mac OS X

Mac OS System software

Mac OS Security

Mac OS Office application

Mac OS Email Management

Mac OS Data - File

Mac hardware

Hardware

USB - Flash Drive

Speaker headset

Printer

PC hardware

Network equipment

Laptop hardware

Computer components

Advice Computer

Game

PC game

Online game

Mobile Game

Pokemon GO

information

Technology story

Technology comments

Quiz technology

New technology

British talent technology

Attack the network

Artificial intelligence

Technology

Smart watches

Raspberry Pi

Linux

Camera

Basic knowledge

Banking services

SEO tips

Science

Strange story

Space Science

Scientific invention

Science Story

Science photo

Science and technology

Medicine

Health Care

Fun science

Environment

Discover science

Discover nature

Archeology

Life

Travel Experience

Tips

Raise up child

Make up

Life skills

Home Care

Entertainment

DIY Handmade

Cuisine

Christmas

Application

Web Email

Website - Blog

Web browser

Support Download - Upload

Software conversion

Social Network

Simulator software

Online payment

Office information

Music Software

Map and Positioning

Installation - Uninstall

Graphic design

Free - Discount

Email reader

Edit video

Edit photo

Compress and Decompress

Chat, Text, Call

Archive - Share

Electric

Water heater

Washing machine

Television

Machine tool

Fridge

Fans

Air conditioning

Program

Unix and Linux

SQL Server

SQL

Python

Programming C

PHP

NodeJS

MongoDB

jQuery

JavaScript

HTTP

HTML

Git

Database

Data structure and algorithm

CSS and CSS3

C ++

C #

AngularJS

Mobile

Wallpapers and Ringtones

Tricks application

Take and process photos

Storage - Sync

Security and Virus Removal

Personalized

Online Social Network

Map

Manage and edit Video

Data

Chat - Call - Text

Browser and Add-on

Basic setup