Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Configuration and Testing | Setting Up and Configuration
Creating Custom AI Agents with Anthropic Claude

bookConfiguration and Testing

Once your script is ready, the next step is to connect it to Claude. This step only needs to be done once, even if you later update your script with new features. To begin, open Claude Desktop and go to the Settings tab. There are several ways to get there:

How to Open Settings
expand arrow
  • Click the hamburger menu in the top-left corner, then go to File > Settings
  • Use the shortcut Ctrl + ,
  • Or click your profile icon in the bottom-left corner and choose Settings

Once the Settings panel is open, scroll all the way down. You’ll see a Desktop App section with three tabs that are only available in the desktop version: General, Extensions, and Developer. To set up the MCP server connection, select the Developer tab. Inside the Developer tab, click Edit Config. This opens the folder where Claude's configuration files are stored, and highlights the file claude-desktop-config.json. Inside of it you'll see something like this:

claude-desktop-config.json

claude-desktop-config.json

copy

This is just a simple JSON file. The "mcpServers" key is where Claude looks for information about what servers it should connect to. Right now, it's empty. To add a server, insert a new key-value pair inside the curly brackets. The key can be any name you like and it will be used to label your server inside Claude. Then add an object {} that will hold your server's setup.

claude-desktop-config.json

claude-desktop-config.json

copy
Note
Note

If you want to learn more about JSON format you can check outUnderstanding and Working with JSON Data article.

If you open Claude now, you'll get a warning. That's normal it means Claude found your server, but it’s missing required information. Specifically, Claude is looking for the "command" key, which tells it how to run the server. To make Claude actually run your script, you need to provide the same command you'd use in your terminal. For Python scripts, that's usually python.

The last step will be adding the "args" key. This is a list of extra inputs Claude will use with the command — in most cases, it’s just the full path to your script:

file1

file1

copy
Note
Note

Make sure the path and filename are correct, or Claude won't be able to run your script. If you'd rather not write it all yourself, you can copy and paste this as a template.

Once the file is saved, reopen Claude and go back to the Developer tab. This time, your server should be marked as Running. You can now try out it by prompting something like.

Claude will ask for permission to use your MCP server. You can click Allow once to test it safely, or Allow always if it's your own server and you trust it. If everything is set up properly, Claude will call your tool and return the result — in this case, the current time.

question mark

What is the purpose of the command key in the claude-desktop-config.json file?

Select the correct answer

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 4

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

Suggested prompts:

Can you explain what MCP servers are and why I would use them with Claude?

What should I do if my server doesn't show up as running in the Developer tab?

How do I add more tools or connect Claude to other apps using the MCP server?

Awesome!

Completion rate improved to 11.11

bookConfiguration and Testing

Svep för att visa menyn

Once your script is ready, the next step is to connect it to Claude. This step only needs to be done once, even if you later update your script with new features. To begin, open Claude Desktop and go to the Settings tab. There are several ways to get there:

How to Open Settings
expand arrow
  • Click the hamburger menu in the top-left corner, then go to File > Settings
  • Use the shortcut Ctrl + ,
  • Or click your profile icon in the bottom-left corner and choose Settings

Once the Settings panel is open, scroll all the way down. You’ll see a Desktop App section with three tabs that are only available in the desktop version: General, Extensions, and Developer. To set up the MCP server connection, select the Developer tab. Inside the Developer tab, click Edit Config. This opens the folder where Claude's configuration files are stored, and highlights the file claude-desktop-config.json. Inside of it you'll see something like this:

claude-desktop-config.json

claude-desktop-config.json

copy

This is just a simple JSON file. The "mcpServers" key is where Claude looks for information about what servers it should connect to. Right now, it's empty. To add a server, insert a new key-value pair inside the curly brackets. The key can be any name you like and it will be used to label your server inside Claude. Then add an object {} that will hold your server's setup.

claude-desktop-config.json

claude-desktop-config.json

copy
Note
Note

If you want to learn more about JSON format you can check outUnderstanding and Working with JSON Data article.

If you open Claude now, you'll get a warning. That's normal it means Claude found your server, but it’s missing required information. Specifically, Claude is looking for the "command" key, which tells it how to run the server. To make Claude actually run your script, you need to provide the same command you'd use in your terminal. For Python scripts, that's usually python.

The last step will be adding the "args" key. This is a list of extra inputs Claude will use with the command — in most cases, it’s just the full path to your script:

file1

file1

copy
Note
Note

Make sure the path and filename are correct, or Claude won't be able to run your script. If you'd rather not write it all yourself, you can copy and paste this as a template.

Once the file is saved, reopen Claude and go back to the Developer tab. This time, your server should be marked as Running. You can now try out it by prompting something like.

Claude will ask for permission to use your MCP server. You can click Allow once to test it safely, or Allow always if it's your own server and you trust it. If everything is set up properly, Claude will call your tool and return the result — in this case, the current time.

question mark

What is the purpose of the command key in the claude-desktop-config.json file?

Select the correct answer

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 4
some-alt