5. Connecting Claude
5m

Overview

Time to loop in Claude. We're going to equip our assistant with its first helpful tool!

In this lesson, we will:

  • Connect Claude to our MCP server
  • Inspect how tools are represented in Claude
  • Ask a question that prompts Claude to invoke our tool

Enabling MCP in Claude

Let's return to our Claude application. In the Application tool bar, open up Settings. (On MacOS, this is accessible through the main Claude menu dropdown.)

Selecting Settings from the Claude application menu

Next, we'll select the Developer option from the left-hand menu. In this window we'll see a short overview about Claude's compatibility with servers that use MCP.

To equip Claude with a connection to our MCP server, we'll click the button that says Edit Config.

The Developer tab in Claude's settings, highlighting the Edit Config button

This will open a new file system window, opened to a particular file in the Claude application folder called claude_desktop_config.json. Right-click on this file, and let's open it up in our code editor.

What we'll see is a pretty simple setup to start! If you're running a fresh installation of Claude, you'll probably see an empty mcpServers config:

claude_desktop_config.json
{
"mcpServers": {}
}

Let's make some space inside that mcpServers object. First off, we'll specify the name we want to use to identify our MCP server: airlock. For its value, we'll open up a new object.

{
"mcpServers": {
"airlock": {}
}
}

There are two properties we need to define in this next object: "command" and "args".

The "command" property should be set to what starts the MCP server. We'll connect using npx as the command, with a variety of to configure exactly where the MCP server is running.

{
"mcpServers": {
"airlock": {
"command": "npx"
}
}
}

For "args", we'll define an array that contains several strings, one for each parameter and value we want to be included in the command. We need to pass two (mcp-remote and --transport), along with their corresponding values (where the MCP server is running, and what transport to use specifically). Here's what that looks like:

"args": [
"mcp-remote",
"http://127.0.0.1:5000/mcp",
"--transport",
"http-first"
]

With this configuration, we're asking Claude to execute a specific NPM package, mcp-remote, to connect to an MCP server that's already running. We've provided the URL where our own MCP server is running, and specified that we want to use the transport http-first.

Here's what your full claude_desktop_config.json should look like.

{
"mcpServers": {
"airlock": {
"command": "npx",
"args": [
"mcp-remote",
"http://127.0.0.1:5000/mcp",
"--transport",
"http-first"
]
}
}
}

Save the file, and return to Claude. We won't see anything right away, so let's restart the application.

Task!

Time to chat!

When we reopen Claude, we might not see anything different right away. But the terminal where our server's running should have some new output:

And looking closely in Claude, we'll find a new button in the interface.

The Claude interface, highlighting the new Search & Tools button, with the dropdown open and the "airlock" item highlighted

At the bottom of the menu we should see an item called airlock, and when we click into this, we'll see a specific tool called GetFeaturedListings. This should be enabled.

The Claude interface, showing the one GetFeaturedListings tool available in the airlock category

Now let's chat with Claude and see if we can get it to invoke the tool. Here's the message we're using:

A (hopefully) successful prompt for Claude
What are the featured listings today?

After just a moment of chat processing time, we should see our conversation interrupted by a new modal appearing.

The Claude interface, showing a modal asking us to allow it to use an external integration

This shows us exactly what tool Claude wants to invoke. Since this involves a 3rd party connection to our MCP server, we need to approve it before the assistant will proceed. Let's click Allow once so we can continue seeing this modal whenever Claude tries out this tool.

We'll see a breakdown of what that request looks like: Claude invokes the tool, but we can see from the Request body that it's not actually executing the or sending parameters. All it has done is tell the MCP server that the GetFeaturedListings tool should be executed. In response, we see all the data return—and very quickly, Claude turns it into something a bit more conversation, with better styling too!

The breakdown of the Request and Response with the tool, along with Claude's formatted answer

Practice

Which of the following are true statements about Claude's interaction with tools?

Key takeaways

  • To enable an MCP server connection in Claude, we can edit the claude_desktop_config.json file.
  • In this file, we provide the name of the MCP server, along with the command to start it and any args that should be included.
  • Before using external integrations (like connections to an MCP server), Claude asks for permission.

Up next

We've equipped our assistant with a handy "featured listings" tool it can invoke to help answer user's questions. What other kinds of functionality can we wrap up behind assistant-facing tools? Let's give Claude a way to be more specific about each listing in the next lesson.


Share your questions and comments about this lesson

This course is currently in

beta
. Your feedback helps us improve! If you're stuck or confused, let us know and we'll help you out. All comments are public and must follow the Apollo Code of Conduct. Note that comments that have been resolved or addressed may be removed.

You'll need a GitHub account to post below. Don't have one? Post in our Odyssey forum instead.