38. Model Context Protocol (MCP)#
MCP, is an open standard designed to enable seamless, secure, and structured communication between AI-powered applications—most notably large language models (LLMs)—and external data sources or tools.
MCP works by defining a universal client-server architecture: AI applications (acting as MCP clients) interact with various external systems (MCP servers), which expose specific tools, data resources, or reusable prompts. [1] [3] [5] [6] [7]
The protocol, built on JSON-RPC 2.0, acts as a common “language” allowing AI assistants to call functions, fetch real-time data, or use predefined templates from any connected service in a standardized way. This makes it far easier for LLM-based agents to access up-to-date information and capabilities without custom coding for each integration, similar to how USB provides a universal connector for computer peripherals. MCP has quickly gained traction in both open-source and commercial AI ecosystems and is a foundational technology for modern agentic AI systems and enhanced LLM deployments. [4] [5] [6] [7]
See also this podcast.
from google.colab import drive
drive.mount('/content/drive') # Add My Drive/<>
import os
os.chdir('drive/My Drive')
os.chdir('Books_Writings/NLPBook/')
Mounted at /content/drive
%%capture
%pylab inline
import pandas as pd
import os
%load_ext rpy2.ipython
from IPython.display import Image
import textwrap
def p80(text):
print(textwrap.fill(text, 80))
return None
Example MCP JSON-RPC messages for invoking a tool, following the MCP protocol’s structured request-response flow for tool calls.
Tool Invocation Request (tools/call)
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "echo",
"arguments": {
"message": "Testing 123"
}
}
}
This request asks the server to execute the tool named echo with the argument message: "Testing 123".
Successful Invocation Response
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"content": [
{ "type": "text", "text": "Echo: Testing 123" }
]
}
}
The server replies with the results of the tool execution. The output structure is determined by the tool’s API definition.
Error Response Example
{
"jsonrpc": "2.0",
"id": 3,
"error": {
"code": 404,
"message": "Tool not found"
}
}
38.1. MCP components#
MCP (Model Context Protocol) has a modular architecture built around three main components: the Host, Client, and Server. Each has a distinct role for enabling secure and structured communication between AI applications and external resources or tools. [1] [2] [3]
Host
The Host is the user-facing AI application or environment, such as Claude Desktop, an AI-powered IDE, or a custom agent application. Its responsibilities include managing user interactions, orchestrating the flow between LLM processing and tool calls, initiating client-server connections, and enforcing security boundaries. The Host coordinates the entire protocol lifecycle and ensures the user experience remains seamless. [4] [3] [1]. See mcp/github for hosts such as VSCode.
Client
The Client resides within the Host application and is responsible for implementing the MCP protocol and handling one-to-one communication with a specific MCP Server. It manages session states, negotiates capabilities, handles secure data exchange, and routes requests or responses between the Host and Server. Each Client connects to a single Server, and Hosts can spawn multiple Clients to interface with multiple Servers. [5] [6] [3]
Server
The Server is an independent process, service, or API that exposes functionality, data, or resources to AI models via the MCP protocol. Servers can provide tools (actions the AI can perform), resources (context or data), or prompts (reusable templates), and are responsible for processing incoming requests, executing external actions, and returning results to Clients. Servers work in isolation—focused on specific capabilities—and are designed to be simple, composable, and secure. [7] [3] [4] [1]
Additional Layers: Data and Transport
Data Layer: Handles JSON-RPC-based protocol messaging, including tool/resource/prompt definitions, session management, and notifications. [5]
Transport Layer: Manages how data is exchanged (e.g., via stdio for local or HTTP+SSE for remote), including connection, framing, and authentication. [4] [5]
This clear separation of labor ensures that AI Hosts focus on reasoning, Clients manage secure and stateful interactions, and Servers provide modular, reusable extensions to the AI’s capabilities. [3] [7]
38.2. A list of MCP servers#
A centralized, official source for discovering MCP servers is the MCP Registry, launched in 2025 as an open catalog and API dedicated to publicly available MCP servers. It acts like an app store for MCP servers, providing a single authoritative repository for server metadata, including endpoints, capabilities, and versions. [1] [2]
The MCP Registry is hosted at
registry.modelcontextprotocol.ioand is community-owned with contributions from major organizations like Anthropic, GitHub, and Microsoft. It supports federated discovery through public and private sub-registries, allowing curated marketplaces and enterprise-specific registries to build on top of the shared core metadata. [2] [4]Anyone can browse the registry via its API to list MCP servers with pagination and search functionality, or developers can publish new servers following the registry’s open API specification. The registry emphasizes trust and moderation, featuring community mechanisms for flagging and removing malicious or spammy entries to maintain ecosystem integrity. [4] [1]
See: https://registry.modelcontextprotocol.io
A huge list of MCP servers is here: https://mcpmarket.com/server
From the GitHub page there is also a list of servers: modelcontextprotocol/servers
The GitHub MCP registry is at: mcp
38.3. Example: YouTube#
https://mcpmarket.com/server/youtube-transcript-6
!pip install youtube_transcript_api
Collecting youtube_transcript_api
Downloading youtube_transcript_api-1.2.3-py3-none-any.whl.metadata (24 kB)
Requirement already satisfied: defusedxml<0.8.0,>=0.7.1 in /usr/local/lib/python3.12/dist-packages (from youtube_transcript_api) (0.7.1)
Requirement already satisfied: requests in /usr/local/lib/python3.12/dist-packages (from youtube_transcript_api) (2.32.4)
Requirement already satisfied: charset_normalizer<4,>=2 in /usr/local/lib/python3.12/dist-packages (from requests->youtube_transcript_api) (3.4.4)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.12/dist-packages (from requests->youtube_transcript_api) (3.11)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.12/dist-packages (from requests->youtube_transcript_api) (2.5.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.12/dist-packages (from requests->youtube_transcript_api) (2025.10.5)
Downloading youtube_transcript_api-1.2.3-py3-none-any.whl (485 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 485.1/485.1 kB 11.1 MB/s eta 0:00:00
?25hInstalling collected packages: youtube_transcript_api
Successfully installed youtube_transcript_api-1.2.3
from youtube_transcript_api import YouTubeTranscriptApi
ytt_api = YouTubeTranscriptApi()
# retrieve the available transcript
video_id = 'cn3tuy1GBpQ'
transcript_list = ytt_api.list(video_id)
tscript = transcript_list.find_transcript(['en']).fetch()
merged_text = ' '.join([snippet.text for snippet in tscript])
p80(merged_text)
Welcome to the late show. I'm your host, Stephen Colbear. Folks, it looked like
I don't know if you've seen I don't know if you see in the the newspapers today.
It looks like the government shutdown is coming to an end. Our long national
nightmare is different. At what how many days? 41 days so far. It is the longest
shutdown in US history. Democrats have been holding the line, demanding
Republicans compromise to keep Affordable Care Act subsidies available for
millions of Americans. Well, last night, eight Democratic senators voted with
Republicans to fund the government through January without any Affordable Care
Act guarantees. [Applause] So, yes. So, yes, yes, the shutdown may have been
long and painful for millions of Americans, but at least it achieved jack squat.
That is, and we know why Jack is squatting. But these Democratic defectors did
get one concession. Senate Majority Leader John Thun promised them a vote on the
ACA in December, cuz that's when people get down to serious work. December. You
work about six days and half of that is spent doing a mandatory office door
decorating contest. Welcome to accounting or should I say the Polar Express. Now
you got hot chocolate lot. No, no surprise. The vast majority of Democrats do
not want this. None of those eight Senate Democrats are up for re reelection
next year and two have announced they are retiring from the Senate. What a
disappointing way to end your career. Reminds me of when Journey released their
last single, We Stopped Believing, did they? I don't know. One of the Democrats
who crumbled like a granola bar in your backpack is New Hampshire Senator and
the Joker's proud aunt, Jean Shaheen. Shaheen was asked about her decision and
she said, "When I talk to my constituents in New Hampshire, you know what they
say to me? Uh, are we Vermont or the other one? Are we which one? One of us is
we're upside down us or are we upside down them?" She continued, "They say why
can't you all just work together to address the problems that are facing this
country? Cuz the country is being run by insane people. My constituents want to
know why we can't work with the methaddled chimps who broke into the cockpit and
are now flying the plane. Some of their ideas are reasonable, although
admittedly some are bananas. This weekend, while airports were in utter chaos
and thousands without food benefits across America, Trump showed sensitive
leadership and attended his second extravagant party at Mara Lago in a week.
[Applause] Come on, Mr. President. Read the room. I'm sorry. I forgot who I was
talking to. Have someone summarize the room for you. The party The party was co-
hosted by the conservative political action conference or spatchcock. The the
esteemed guests included far-right British politician Nigel Farage, disgraced
butter junkie Paulyine, and Hercules star Kevin Sorbo. I think I think it's
pretty incredible. Sorbo found the time considering production of Hercules
wrapped only 26 years ago. Guests fun show gave a Zenus. Guests were treated to
some entertainment including this opera singer. >> Okay, she has a lovely voice.
But does Mara Lago have a mandatory bare midrift policy? Tonight we're doing wet
t-shirt opera. Okay, then gentlemen, get out your singles cuz they're dancing
the G-string Nutcracker. I'm going to I'm going to tuck Mr. Washington I'm going
to tuck Mr. Washington right into the old sugar plums. Hey, it's fun. Speaking
of pure MAGA elegance, there were also two ladies in flag swimsuits doing
synchronized swimming to Lee Greenwood [Music] >> and I had to start again with
just my children and my wife. that I'm proud to be an American. >> You know,
hearing that song also makes me want to dive into the water, but only after I
first filled my pockets with rocks. Not to nitpick, but they're only two of
them. Two. Two is really the bare minimum for for synchronized swimming. And I'm
told we have Kevin Sorbo's review. >> Disappointed. >> He's not happy. >> He's
not happy. He did not like it. This party makes it seem like it's really easy to
get into Mara Lago as long as your talent shows some skin and is vaguely
patriotic. Thank you, swimmer ladies. Now, please welcome Tina, who's going to
take off her top and eat a flag. A flag cake? No, just the flag. She's going to
eat the flag. Of course, after uh two ladies same time swimming, Trump's second
favorite sport would be football. And over the weekend, we learned Trump wants
the Washington Commander new DC stadium named for him. But that's no, that's not
that's not how any of this works. You're you're name you name things after
people once they're out of office. The president doesn't just ask for it. Ex
except when Reagan said this, >> Mr. the garbage of give big Ron Ron an airport.
Look how happy the people are. People are so happy. Now Trump Trump doesn't just
want this. He is pushing to make it happen. The White House says there have been
back channel communications with the commander ownership group to express
Trump's desire to have the stadium bear his name and his press secretary
basically confirmed it saying that would be a beautiful name. Yes, it's a very
No. Hey, no, it is it would be beautiful. After all, everyone knows that Trump
is a lovely portmanto of the words tremendous and dump. Yesterday, maybe we
should have done the animation. Maybe we should have done the animation. Who
cares? Yesterday, Trump went to go see a commander game in person, and the fans
were not happy to see him. [Music] [Applause] Fun fact for the folks at home,
for the broadcast of our show, our editor, Brian, had to go through that clip uh
frame by frame and blur out every single uh middle finger that was raised. How
are How are you feeling after all that work, Brian? Okay. All right. Just one
more. Thank you. That's enough. That's good. A long time. >> Okay. Just Just one
more. You'll have to blur. >> Now, a little booing from a crowd didn't stop
Trump from joining the announcers and trying his best call play. >> Well, let's
see what happens here. This is a big >> big down. All right. They're they're
calling a timeout here. President Trump. They're trying to regroup. It's a
fourth and goal. Oh, no, excuse me. fourth and short. >> But you can't equate
sports with life. You know, you have the triumph and you have the the problems
and you got to get through the problems to hit the triumphs. And you can never
quit. You can never give up. Was a little rough. Was a little rough. That marks
the first time the guys in the booth got brain damage. >> Now, yeah. more
evidence of Trump's uh troubling spiral into last week. You'll recall the Trump
held a presser where one of the attendees passed out uh while he was talking.
Guy was fine. Uh and it turns out he wasn't the only one catching a little shut
eyee. According to video analysis by the Washington Post, at that same meeting,
the president spent nearly 20 minutes apparently battling to keep his eyes open.
Great. Our president is an old man who can't stay awake like that classic folk
tale, Rip Vancle. Here's just we have this, right? We have this. Okay. Rip
Vancle. Here's just some of the commander-in-chief dozing off. What about the
people in urban areas who live in food deserts and are suffering from obesity?
President Trump has also instructed us to address and and the root causes of
chronic disease. In the meantime, there's nothing more important than we can do
than lower this price. >> Do you know how hard it is to fall asleep to RFK Jr.'s
voice? >> That is not the easiest. Not the most Ooh. Ooh. Bedtime. Setting my
white noise machine to handful of gravel and a neutral bullet. Photographers on
the scene in the Oval Office there nab some pretty good shots of Trump snooze.
And uh there's this one. Uh he's out. Uh this one. Bye-bye. And my favorite,
this one, where in fairness, in fairness, he looks less asleep and more just
miserable like he's watching Eric in his High School Musical. Oh god. When When
the hell does the fiddler jump off the stupid roof? Sunrise, sunset, sunrise,
sunset. If I were a rich man. Yeah. Madame Madam, [Applause] a cool vata. Come
on. We got a great show for you tonight. My guest is more when we come back.
Science. Come on. [Applause] [Music] [Applause] [Music] Yeah.
38.4. Example: Calling a MCP Server to get YouTube Transcripts#
import requests
import json
def call_mcp_server_for_youtube_transcript(video_id, server_url="http://localhost:8080/mcp-youtube-transcript"):
"""Simulates calling an MCP server to get a YouTube transcript."""
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_youtube_transcript",
"arguments": {
"video_id": video_id,
"language": "en" # Assuming English transcript is requested
}
}
}
try:
print(f"Attempting to call MCP server at {server_url} with video ID: {video_id}")
# In a real scenario, you would send this to a live MCP server
# response = requests.post(server_url, json=payload)
# response.raise_for_status() # Raise HTTPError for bad responses (4xx or 5xx)
# result = response.json()
# For this example, we'll simulate a successful response
# using the data we already fetched with youtube_transcript_api
global merged_text # Assuming merged_text is available from previous execution
if 'merged_text' in globals():
mock_result = {
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{"type": "text", "text": merged_text}
]
}
}
print("Simulated MCP server response:")
p80(json.dumps(mock_result, indent=2))
return mock_result
else:
print("Error: 'merged_text' not found. Please run previous cells to fetch a transcript first.")
return {
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "No transcript data available for simulation."
}
}
except requests.exceptions.RequestException as e:
print(f"MCP Server call failed: {e}")
return {
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": f"Failed to connect to MCP server: {e}"
}
}
# Example usage with the video_id we used before:
# Note: This is a simulated call as the MCP server URL is hypothetical.
mcp_response = call_mcp_server_for_youtube_transcript(video_id)
# You would then process mcp_response['result']['content'][0]['text']
# if the call was successful and contained text.
Attempting to call MCP server at http://localhost:8080/mcp-youtube-transcript with video ID: cn3tuy1GBpQ
Simulated MCP server response:
{ "jsonrpc": "2.0", "id": 1, "result": { "content": [ {
"type": "text", "text": "Welcome to the late show. I'm your host,
Stephen Colbear. Folks, it looked like I don't know if you've seen I don't know
if you see in the the newspapers today. It looks like the government shutdown is
coming to an end. Our long national nightmare is different. At what how many
days? 41 days so far. It is the longest shutdown in US history. Democrats have
been holding the line, demanding Republicans compromise to keep Affordable Care
Act subsidies available for millions of Americans. Well, last night, eight
Democratic senators voted with Republicans to fund the government through
January without any Affordable Care Act guarantees. [Applause] So, yes. So, yes,
yes, the shutdown may have been long and painful for millions of Americans, but
at least it achieved jack squat. That is, and we know why Jack is squatting. But
these Democratic defectors did get one concession. Senate Majority Leader John
Thun promised them a vote on the ACA in December, cuz that's when people get
down to serious work. December. You work about six days and half of that is
spent doing a mandatory office door decorating contest. Welcome to accounting or
should I say the Polar Express. Now you got hot chocolate lot. No, no surprise.
The vast majority of Democrats do not want this. None of those eight Senate
Democrats are up for re reelection next year and two have announced they are
retiring from the Senate. What a disappointing way to end your career. Reminds
me of when Journey released their last single, We Stopped Believing, did they? I
don't know. One of the Democrats who crumbled like a granola bar in your
backpack is New Hampshire Senator and the Joker's proud aunt, Jean Shaheen.
Shaheen was asked about her decision and she said, \"When I talk to my
constituents in New Hampshire, you know what they say to me? Uh, are we Vermont
or the other one? Are we which one? One of us is we're upside down us or are we
upside down them?\" She continued, \"They say why can't you all just work
together to address the problems that are facing this country? Cuz the country
is being run by insane people. My constituents want to know why we can't work
with the methaddled chimps who broke into the cockpit and are now flying the
plane. Some of their ideas are reasonable, although admittedly some are bananas.
This weekend, while airports were in utter chaos and thousands without food
benefits across America, Trump showed sensitive leadership and attended his
second extravagant party at Mara Lago in a week. [Applause] Come on, Mr.
President. Read the room. I'm sorry. I forgot who I was talking to. Have someone
summarize the room for you. The party The party was co-hosted by the
conservative political action conference or spatchcock. The the esteemed guests
included far-right British politician Nigel Farage, disgraced butter junkie
Paulyine, and Hercules star Kevin Sorbo. I think I think it's pretty incredible.
Sorbo found the time considering production of Hercules wrapped only 26 years
ago. Guests fun show gave a Zenus. Guests were treated to some entertainment
including this opera singer. >> Okay, she has a lovely voice. But does Mara Lago
have a mandatory bare midrift policy? Tonight we're doing wet t-shirt opera.
Okay, then gentlemen, get out your singles cuz they're dancing the G-string
Nutcracker. I'm going to I'm going to tuck Mr. Washington I'm going to tuck Mr.
Washington right into the old sugar plums. Hey, it's fun. Speaking of pure MAGA
elegance, there were also two ladies in flag swimsuits doing synchronized
swimming to Lee Greenwood [Music] >> and I had to start again with just my
children and my wife. that I'm proud to be an American. >> You know, hearing
that song also makes me want to dive into the water, but only after I first
filled my pockets with rocks. Not to nitpick, but they're only two of them. Two.
Two is really the bare minimum for for synchronized swimming. And I'm told we
have Kevin Sorbo's review. >> Disappointed. >> He's not happy. >> He's not
happy. He did not like it. This party makes it seem like it's really easy to get
into Mara Lago as long as your talent shows some skin and is vaguely patriotic.
Thank you, swimmer ladies. Now, please welcome Tina, who's going to take off her
top and eat a flag. A flag cake? No, just the flag. She's going to eat the flag.
Of course, after uh two ladies same time swimming, Trump's second favorite sport
would be football. And over the weekend, we learned Trump wants the Washington
Commander new DC stadium named for him. But that's no, that's not that's not how
any of this works. You're you're name you name things after people once they're
out of office. The president doesn't just ask for it. Ex except when Reagan said
this, >> Mr. the garbage of give big Ron Ron an airport. Look how happy the
people are. People are so happy. Now Trump Trump doesn't just want this. He is
pushing to make it happen. The White House says there have been back channel
communications with the commander ownership group to express Trump's desire to
have the stadium bear his name and his press secretary basically confirmed it
saying that would be a beautiful name. Yes, it's a very No. Hey, no, it is it
would be beautiful. After all, everyone knows that Trump is a lovely portmanto
of the words tremendous and dump. Yesterday, maybe we should have done the
animation. Maybe we should have done the animation. Who cares? Yesterday, Trump
went to go see a commander game in person, and the fans were not happy to see
him. [Music] [Applause] Fun fact for the folks at home, for the broadcast of our
show, our editor, Brian, had to go through that clip uh frame by frame and blur
out every single uh middle finger that was raised. How are How are you feeling
after all that work, Brian? Okay. All right. Just one more. Thank you. That's
enough. That's good. A long time. >> Okay. Just Just one more. You'll have to
blur. >> Now, a little booing from a crowd didn't stop Trump from joining the
announcers and trying his best call play. >> Well, let's see what happens here.
This is a big >> big down. All right. They're they're calling a timeout here.
President Trump. They're trying to regroup. It's a fourth and goal. Oh, no,
excuse me. fourth and short. >> But you can't equate sports with life. You know,
you have the triumph and you have the the problems and you got to get through
the problems to hit the triumphs. And you can never quit. You can never give up.
Was a little rough. Was a little rough. That marks the first time the guys in
the booth got brain damage. >> Now, yeah. more evidence of Trump's uh troubling
spiral into last week. You'll recall the Trump held a presser where one of the
attendees passed out uh while he was talking. Guy was fine. Uh and it turns out
he wasn't the only one catching a little shut eyee. According to video analysis
by the Washington Post, at that same meeting, the president spent nearly 20
minutes apparently battling to keep his eyes open. Great. Our president is an
old man who can't stay awake like that classic folk tale, Rip Vancle. Here's
just we have this, right? We have this. Okay. Rip Vancle. Here's just some of
the commander-in-chief dozing off. What about the people in urban areas who live
in food deserts and are suffering from obesity? President Trump has also
instructed us to address and and the root causes of chronic disease. In the
meantime, there's nothing more important than we can do than lower this price.
>> Do you know how hard it is to fall asleep to RFK Jr.'s voice? >> That is not
the easiest. Not the most Ooh. Ooh. Bedtime. Setting my white noise machine to
handful of gravel and a neutral bullet. Photographers on the scene in the Oval
Office there nab some pretty good shots of Trump snooze. And uh there's this
one. Uh he's out. Uh this one. Bye-bye. And my favorite, this one, where in
fairness, in fairness, he looks less asleep and more just miserable like he's
watching Eric in his High School Musical. Oh god. When When the hell does the
fiddler jump off the stupid roof? Sunrise, sunset, sunrise, sunset. If I were a
rich man. Yeah. Madame Madam, [Applause] a cool vata. Come on. We got a great
show for you tonight. My guest is more when we come back. Science. Come on.
[Applause] [Music] [Applause] [Music] Yeah." } ] } }
38.5. Setting up a local MCP Server#
Python SDK with examples: modelcontextprotocol/python-sdk
To try this out follow the instructions at https://pypi.org/project/mcp
Let’s use Claude Code to call a MCP server that we run on our local machine. The detailed steps you can use on your laptop are as follows:
Set up the env from the CLI:
conda create -n mcp python=3.13
conda activate mcp
pip install uv
pip install "mcp[cli]"
Now, create an initial project by using the following instantiation:
uv init demo
cd demo
Copy the code from here into a file called basic_tools.py in the demo folder: modelcontextprotocol/python-sdk
The file looks like this:
from mcp.server.fastmcp import FastMCP
mcp = FastMCP(name="Tool Example")
@mcp.tool()
def sum(a: int, b: int) -> int:
"""Add two numbers together."""
return a + b
@mcp.tool()
def get_weather(city: str, unit: str = "celsius") -> str:
"""Get weather for a city."""
# This would normally call a weather API
return f"Weather in {city}: 22degrees{unit[0].upper()}"
The mcp.tool decorator in Python is all you need to specify a function as a tool.
Now run the MCP server:
uv run mcp install basic_tools.py
Now, everything is ready for use by Claude Desktop.
38.6. Use Claude Desktop as MCP Host & Client#
Install Claude Desktop by downloading it from here: https://www.claude.com/download
Then run it!
First, go to User -> Settings
Then choose Developer to see the running MCP servers.
Then open New Chat to get the following:
See that the tool T is used when apt:
Take a look at the other servers that may show you other usage patterns: modelcontextprotocol/python-sdk
38.7. Installing the MCP Server for using the File System#
The approach to doing this is to use the filesystem MCP server from here: modelcontextprotocol/servers
Copy the NPX config into the claude_desktop_config.json file. This file (on a Mac) is in this folder: /Users/sanjivda/Library/Application Support/Claude
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}
Update the paths to the folder above to the actual local folders you want to give access to.
Then restart Claude Desktop and you can issue commands to add files, delete files, etc.