How to use MCP server tools in the Claude App?

How to use MCP server tools in the Claude App?

What is MCP?

MCP stands for Model Context Protocol. It is an open-source project run by Anthropic and is open to contributions from the entire community. It lets Claude and other AI models directly interact with your tools and data. Instead of copying and pasting between applications, the AI can:

  • Search the web and summarize the findings
  • Read and write files on your computer
  • Access your GitHub repositories
  • Pull data from Google Drive
  • Search through Slack messages
  • Interact with maps

...and much much more!


This brief tutorial assumes that:

  • You use Windows OS
  • You have the Claude Desktop App installed.
  • You have NodeJS, including npx and node installed


So what do you need to do?

  • Create or update claude_desktop_config.json in the folder where your Claude is installed.

Mine is here c:\Users\<username>\AppData\Roaming\Claude

but look for your <username>


  • Add the configuration depending on which MCP server tools you want to use.

You will find all the information here:

https://github.com/modelcontextprotocol/servers

Here is my file (of course, without the user name and the Brave API key):

WARNING: I am using node.exe as there is an issue with npx when it comes to MCP!

{
  "mcpServers": {
    "brave-search": {
      "command": "C:\\Program Files\\nodejs\\node.exe",
      "args": [
        "c:\\Users\\<username>\\AppData\\Roaming\\npm\\node_modules\\@modelcontextprotocol\\server-brave-search\\dist\\index.js"
      ],
      "env": {
        "BRAVE_API_KEY": "<brave_api_key>"
      }
    },
    "filesystem": {
      "command": "C:\\Program Files\\nodejs\\node.exe",
      "args": [
        "c:\\Users\\<username>\\AppData\\Roaming\\npm\\node_modules\\@modelcontextprotocol\\server-filesystem\\dist\\index.js",
        "c:\\Users\\<username>\\myfolder"
      ]
    }
  }
}        

The docs assume you use npx and I am pretty sure they will fix it!

{
  "mcpServers": {
    "brave-search": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-brave-search"
      ],
      "env": {
        "BRAVE_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}        

  • Install the relevant MCP packages. In my case it's Brave Search and Filesystem.

npm install -g @modelcontextprotocol/server-brave-search 
npm install -g @modelcontextprotocol/server-filesystem         

  • If you proceeded correctly and restart Claude, the MCP server tools should be indicated in the Claude Desktop App:

It even shows you what MCP tools are specifically available to you :)

  • Give it a try using a prompt of your choice:

In my example, I am looking for the latest Champions League results and goal scorers, and I want the results to be dumped in the file in the predefined folder.

Claude communicates with the MCP Server, gets information on the tools (capabilities), runs the given query, and the MCP Server does the job: searching the web or database, managing local files, or carrying out other actions.

There are some predefined servers:

You can create a custom one yourself!

So the flow goes like per this sequence diagram

(from https://modelcontextprotocol.io/quickstart)

So, what does it look like in the App? Claude gets the results, and the scorers, and then it dumps them into a file:

And my sample output file looks like this:

This feature opens many possibilities to enhance Claude's default capabilities.

Of course, this is a beta version, so you should expect some glitches:

  • The non-working npx call of the MCP servers (as of now - November 27th, 2024)
  • There are annoying confirmation request windows every time an MCP tool is called:

  • For some reason, Claude tries to use the Claude App folder to save the file (but it realises it can't, so it jumps to the location I defined in my JSON config.

But now, I can use Claude as a search engine, too. I will invent new, cunning ways of connecting the MCP tools!

And I am pretty sure I will create my own MCP Server at some point :)


Happy experimenting! Contact me if you have any remarks or questions!


Seva Dolgopolov

Storytelling Engineer

6 天前

Hey Mariusz, great insights on using MCP server tools with the Claude App! Quick question: What are the best practices for securing MCP server integrations to protect data and prevent unauthorized access?

回复
Rakesh Goyal

Founder & CEO | Ex-CTO @ Eltropy | CFI Expert | SaaS Startup Expert | Technical Leadership

3 个月

Nicely explained. I have also created a REST and CLI Client to test this out: https://github.com/rakesh-eltropy/mcp-client

要查看或添加评论,请登录

Mariusz Misiek的更多文章

  • Fenomen.ai - wspólna iskra geniuszu?

    Fenomen.ai - wspólna iskra geniuszu?

    Historia George’a Malley’a, bohatera filmu Fenomen (ang. Phenomenon; w roli g?ównej John Travolta; https://m.

  • The DNA of Revolutionary Tech

    The DNA of Revolutionary Tech

    Back in 1995, I remember dismissing the Internet as "just a better way to send messages" - a faster alternative to fax…

    1 条评论
  • AAA....Zabior? prac? AI. Szybko i bez k?opotu. Tylko powa?ne oferty.

    AAA....Zabior? prac? AI. Szybko i bez k?opotu. Tylko powa?ne oferty.

    Dlaczego nie boj? si?, ?e AI zabierze mi prac?, kreatywno?? i b?dzie my?le? za mnie? A mo?e lepiej zapyta? - dlaczego…

    1 条评论
  • How to rethink AI?

    How to rethink AI?

    I've been deeply considering a fundamental question in AI development: Why are we so fixated on replicating human…

  • AI project delivery: what's all about?

    AI project delivery: what's all about?

    Introduction The landscape of project delivery is undergoing a seismic shift. As artificial intelligence moves from…

    1 条评论
  • Congratulations, you've passed the robot test ??

    Congratulations, you've passed the robot test ??

    You're officially predictable enough to be human Click all the traffic lights. Click all the crosswalks.

    1 条评论
  • There and Back Again: An AI’s Journey to Outthink Us All

    There and Back Again: An AI’s Journey to Outthink Us All

    As we approach 2025, the landscape of artificial intelligence is on the cusp of a transformation that could redefine…

  • AI: Obcy w?ród nas?

    AI: Obcy w?ród nas?

    Quis es, AI? Stoimy u progu rewolucji poznawczej, której skali nie jeste?my w stanie ogarn??. Sztuczna inteligencja…

  • Czy sztuczna inteligencja dorówna psiemu sprytowi? :)

    Czy sztuczna inteligencja dorówna psiemu sprytowi? :)

    Na styku dwóch ?wiatów W erze, gdy sztuczna inteligencja (AI) zdaje si? przekracza? kolejne granice mo?liwo?ci, coraz…

  • Jak zbudowa? prostego asystenta AI (krok po kroku w Python + API)?

    Jak zbudowa? prostego asystenta AI (krok po kroku w Python + API)?

    Sztuczna inteligencja to gor?cy temat w ?wiecie technologii i biznesu. Jednym z najbardziej ekscytuj?cych zastosowań AI…

    2 条评论

社区洞察

其他会员也浏览了