← Back to Claude Code
Claude Code / Lesson 05

Connect Claude Code to an external service

Add a real MCP endpoint, authenticate, and verify one read-only tool.

Before you begin

Choose a service you use and read its MCP documentation. A REST URL is not automatically an MCP server. This example uses the Notion endpoint shown in the official Claude Code docs; you need your own Notion account and permission to the chosen content.

  1. CLIClaude Code

    Your session in the project.

  2. MCPMCP server

    Configured with claude mcp add; checked with /mcp.

  3. APIExternal service

    Signs you in and grants only the access you approve.

DiagramEach layer can fail separately: configuration, authentication, or the service itself.

1. Register the server

Run the command below from the intended project. By default this creates a local-scoped configuration for this project. Use --scope project only when you deliberately want a reviewed .mcp.json shared with the repository. Keep tokens out of committed configuration.

shell
claude mcp add --transport http notion https://mcp.notion.com/mcp
claude mcp list
claude
Terminal output of claude mcp add for the Notion server saved to local config, followed by claude mcp list reporting that the server needs authentication.
Screenshot“Added … to local config” only means the configuration was saved; claude mcp list still reports that authentication is needed. The home folder path is shown as ~ in this image. Captured Oct 19, 2026 · Claude Code 2.1.223 · macOS

2. Authenticate and inspect the tools

Inside the Claude Code session, run /mcp. Follow the service sign-in flow if authentication is required, review the access requested, and confirm connection status. An “Added” message only means configuration was saved; it does not prove successful authentication.

text
/mcp
The /mcp panel for the Notion MCP server showing status needs authentication, auth not authenticated, the server URL, the config location, and the options Authenticate and Disable.
ScreenshotInside a session, /mcp shows each server’s status and where it is configured. Choose Authenticate only when you are ready to review the access the service requests. The home folder path is shown as ~ in this image. Captured Oct 19, 2026 · Claude Code 2.1.223 · macOS

3. Prove a small read-only request

Choose a page you are allowed to access. Ask for its title and a short summary with a source link. Confirm the tool name and returned content. Permission to read is different from permission to create or edit. Do not test a connection by making a destructive change.

text
Use the connected Notion tool to read the page I specify.
Return its title, three factual bullets, and its URL.
Do not create, edit, or delete anything.

4. Diagnose or remove the connection

A 401 usually points to authentication; a 403 to access or policy; no tools may mean a wrong endpoint or disabled integration. Check /mcp and server logs, then the service documentation. Remove an unused connection with the same scope you used to add it.

shell
claude mcp get notion
claude mcp remove notion

Practice & self-check

YOUR TURN / PRACTICE

Connect one service, verify a read-only result against its original page, then identify how you would disconnect it.

When you’re done, take a moment to check:

Read the official sources

CLI instructions checked against official documentation; API examples tested with simulated responses. Product-account walkthroughs were not performed.

Was this lesson useful?

Start with a question