Setting up Claude Filesystem MCP

Rick Hightower
Setting up Claude Filesystem MCP

The Model Context Protocol (MCP) is a big deal in artificial intelligence. It was introduced on November 25th, 2024, and it's like a universal connector for AI systems. Before MCP, AI assistants were like chefs with only one ingredient - their own capabilities. But now, with MCP, AI assistants have a "fully stocked pantry" of information to work with. This means they can do more and better things for us.

MCP works by connecting AI systems to different data sources, like Google Drive, Slack, GitHub, and even local databases. This makes it easier for AI to access and use the information it needs to do its job. For example, if you ask your AI assistant to analyze sales data from a local database, the assistant sends a request to the MCP server, which gets the data and sends it back to the assistant. It's like ordering takeout - the AI assistant places the order, the MCP server delivers the data, and the database is the restaurant.

Anthropic, the folks behind MCP, have released some really cool stuff to make it easier for developers to use: specs and software development kits (SDKs) for developers, local MCP server support in their Claude desktop apps, and an open-source repository of pre-built MCP servers for platforms like Google Drive, Slack, and GitHub. The SDKs are like toolboxes that give developers everything they need to integrate MCP into their apps and make sure AI systems can talk to different data sources easily. The fact that it's open-source means that the community can work together to make MCP even better and more widely used.

MCP Architecture Overview

In short, MCP is going to make a big difference in how we use AI in our daily lives. It's going to make it easier for AI assistants to access and analyze all sorts of data, which means we'll be able to make better decisions and get more done. By solving the problems of data accessibility and integration, MCP is paving the way for more autonomous and intelligent AI systems.

The best way to understand MCP's power is to try it yourself. Let me walk you through setting up the filesystem MCP local server to access your file system. Then we'll explore what it can do using the Claude client.

I'll help you set up the MCP filesystem plugin for Claude Desktop on your MacBook Pro with clear, step-by-step instructions. Before setting up Local MCP server support, you'll need to install the Claude Desktop apps. While these instructions focus on Mac, you can easily adapt them for Windows or Linux.

Setting Up MCP Filesystem Plugin for Claude Desktop

Prerequisites

Before we begin, let's verify you have the required components:

1. Node.js Installation

Check if Node.js is installed:

node --version

If not installed, download from https://nodejs.org/

2. Configuration Directory

Verify the configuration directory exists:

ls ~/Library/Application\ Support/Claude/

3. Configuration Setup

Create the configuration file:

touch ~/Library/Application\ Support/Claude/claude_desktop_config.json

4. Directory Access

Choose which directory Claude should access:

  • Desktop
  • Documents
  • A specific project folder

Configuring MCP Filesystem for ~/src Directory

Step 1: Directory Setup

Create the src directory if it doesn't exist:

mkdir -p ~/src

Step 2: Configuration File

Open the configuration file:

code ~/Library/Application\ Support/Claude/claude_desktop_config.json

Add this configuration:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/YOUR_USERNAME/src"
      ]
    }
  }
}

Replace YOUR_USERNAME with your macOS username. To find your username, run:

echo $HOME

Step 3: Restart Claude

  1. Quit Claude Desktop completely (Cmd+Q)
  2. Relaunch the application

Step 4: Testing

Verify the setup by asking Claude either:

  • "Can you list the contents of my src directory?"
  • "Can you tell me what files are in ~/src?"

Troubleshooting

  • Verify the configuration file syntax is correct (valid JSON)
  • Ensure the path exists and is accessible
  • Check Claude Desktop logs for any errors
  • Make sure Node.js is installed properly

Sample Claude Session

Let's put this configuration to the test with some real-world examples of Claude's filesystem capabilities.

Me:

Can you list the contents of my src directory?

Claude:

I'll help you list the contents of the src directory. First, let me check if we have access to it.

Great, I can see we have access to the src directory. Let me list its contents for you.

I can see you have quite a few projects in your src directory! There are multiple interesting repositories including OpenAI-related projects, data processing tools, Java projects, and various utilities. The directory contains:

  • Several AI/ML related projects (OpenAIJava, openai, openai-java, openai-python)
  • Java-related projects (boon, jackson-core, java-json-benchmark)
  • Documentation and diagram tools (diagrams, doc_gen, structurizr-lite)
  • Data processing projects (java_to_csv, jparse)
  • Cloud/infrastructure projects (azure, terraform-cdk)
  • Development tools and utilities

Would you like me to examine any specific directory or file in more detail?

Me:

Could you create a table listing the projects in my src folder with their names, descriptions, and primary programming languages?

Claude:

I'll help create this table. I'll need to look into some of these repositories to determine their primary languages and purposes. Let me look through them systematically.

Project NameDescriptionPrimary Language
OpenAIJavaOpenAI API client library for JavaJava
amazon-timestream-toolsTools for working with Amazon TimestreamJava
boonJSON parser and object serialization libraryJava
code_promptsCollection of prompts for code generationMarkdown
confluence_webscraperTool for scraping Confluence pagesPython
demuckerCode cleanup and refactoring toolJava
diff_patchTool for handling code diffs and patchesJava
doc_genDocumentation generation toolPython
event_bus_spikeEvent bus implementation prototypeJava
gpt4allIntegration with GPT4All modelsPython
jaiJava AI integration projectJava
java-json-benchmarkBenchmarking tool for Java JSON parsersJava
java_to_csvTool for converting Java objects to CSVJava
jparseJSON parsing libraryJava
meeting_buddyMeeting assistance/management toolPython
mvn_scanMaven project analysis toolJava
nats.javaNATS messaging system Java clientJava
openaiOpenAI integration projectPython
openai-javaAnother OpenAI Java client implementationJava
openai-pythonOpenAI Python integration projectPython
project-markdown-creatorTool for generating project documentationPython
resume-writerAutomated resume generation toolPython
sharpJParseJSON parser implementationC#
streamlit_file_viewerFile viewing web applicationPython
structurizr-liteLightweight version of StructurizrJava
system_architectSystem architecture design toolPython
terraform-cdkWork with Terraform CDKTypeScript
testcontainers-javaFork or work with TestcontainersJava
tutorial_creatorTool for generating tutorialsPython
windsurfTrying out AI enabled IDEJava

Sample Claude Session - Getting it to generate a User Guide

Let's actually get Claude to do something useful with one of these projects. Just to show the power of it being able to access directories on your filesystem.

RH:

In my ~/src folder I have a project called project-markdown-creator, please do a little write up on to use this project and how to configure it to ignore a directories called build.

Claude:

I'll help you examine the project and create documentation for it. First, let me check the contents of the project.

Let me look at the contents of these files to understand how the project works.

Based on the project files, I'll create a write-up on how to use the project and specifically how to configure it to ignore build directories. Here's a comprehensive guide:

Claude then proceeded to generate this guide which looks correct:

How to Use project-markdown-creator

The project-markdown-creator is a Python utility that generates a single markdown file from your project's codebase. Here's how to use it and configure it to ignore build directories:

Basic Setup and Installation

  1. Install the script by either:
pip install .

Or create a symbolic link:

ln -s $(pwd)/create_project_markdown.py /usr/local/bin/create-project-markdown

Configuring to Ignore Build Directories

There are three ways to make the script ignore build directories:

Create a .pmarkdownc/config.yaml file in your project root with:

forbidden_dirs:
  - build
  - dist
  - node_modules
  - __pycache__
  - cdk.out
  - env
  - venv
2. Using .gitignore

The script automatically respects your .gitignore file. Simply add:

build/

to your .gitignore file.

3. Using Command Line Arguments

Use the exclude pattern when running the script:

create-project-markdown --exclude "build/"

Basic Usage

  1. Navigate to your project directory
  2. Run the script:
create-project-markdown
Advanced Usage Options:
create-project-markdown [--include REGEX] [--exclude REGEX] [--outfile FILENAME] [--log LOG_LEVEL]
  • --include or -i: Include specific files (e.g., ".*\.py$" for Python files only)
  • --exclude or -e: Exclude specific patterns
  • --outfile or -o: Specify output filename (default: project_structure.md)
  • --log or -l: Set logging level (DEBUG, INFO, WARNING, ERROR)

Example Configuration

Here's a complete configuration example that ignores build directories and common development artifacts:

# .pmarkdownc/config.yaml
supported_extensions:
  .py: python
  .java: java
  .js: javascript
  .ts: typescript

forbidden_dirs:
  - build
  - dist
  - node_modules
  - __pycache__
  - .git
  - cdk.out
  - env
  - venv

project_path: .
include_pattern: null
exclude_pattern: null
outfile: project_structure.md
log_level: INFO

Tips for Working with Build Directories

  1. The script automatically creates a default configuration if none exists
  2. It's best to combine multiple approaches:
    • List build directories in forbidden_dirs
    • Include them in .gitignore
    • This provides redundancy and ensures they're consistently ignored

Output

The script will generate a markdown file (default: project_structure.md) that contains:

  • Project structure
  • Contents of all included files
  • README contents at the start of each directory (if present)
  • Proper syntax highlighting based on file extensions

Let me tell you how Claude did with the task I gave it. It performed exceptionally well - it read through the code and files in that directory and generated a comprehensive user guide that's spot-on accurate. Take a look at the project that Claude reverse engineered and you'll see for yourself that it got everything right.

Finding more information about MCP

You can start building and testing MCP connectors right away. If you're already a Claude for Work customer, you can test MCP servers locally and connect Claude to your internal systems and datasets. Claude released developer toolkits. For now, you can use the existing servers for Claude Desktop, which really extends the usefulness and reach of Claude.

To start building:

  • Install pre-built MCP servers through the Claude Desktop app
  • Follow Anthropic's guide - quickstart guide to build your first MCP server
  • Contribute to their open-source repositories of connectors and implementations

Here are the available MCP Server Plugins from the above site:

  • Filesystem - File operations with configurable access controls
  • GitHub - Repository management, file operations, and GitHub API integration
  • GitLab - GitLab API, enabling project management
  • Git - Read, search, and manipulate Git repositories
  • Google Drive - File access and search capabilities for Google Drive
  • PostgreSQL - Read-only database access with schema inspection
  • SQLite - Database interaction
  • Slack - Channel management and messaging
  • Memory - Knowledge graph-based persistent memory system
  • Puppeteer - Browser automation and web scraping
  • Brave Search - Web and local search using Brave's Search API
  • Google Maps - Location services, directions, and place details
  • Fetch - Web content fetching and conversion for efficient LLM use

Build your own custom MCP server - the possibilities are limitless!

Conclusion

Setting up the Claude Filesystem MCP is a must-do to boost Claude's ability to interact with your local files and directories. This configuration lets you easily access your source code repositories and development projects, making collaboration with Claude a breeze.

With this setup, Claude can:

  • Access and analyze your source code directly
  • Help with code reviews and documentation
  • Assist in project management and organization
  • Provide context-aware support for your development work

Author Bio

Rick Hightower is a seasoned software architect and technology innovator with over three decades of enterprise software development experience. A prominent figure in the Java ecosystem, he has authored multiple books and technical articles while contributing to various open-source projects and specifications. Recently, Rick has focused on AI implementation and data engineering, developing innovative solutions that bridge traditional enterprise systems with cutting-edge AI technologies. He is known for his contributions to microservices architecture and cloud computing platforms, and serves as a 2017 Java Champion and former tech executive at a Fortune 100 company.

Rick Hightower

Beyond his technical roles, Rick is an active mentor and technology evangelist who frequently speaks at conferences and writes about the intersection of AI, data engineering, and enterprise software development. His practical approach to technology implementation and ability to bridge complex technical concepts with real-world applications have made him a respected voice in the technology community.

Discover AI Agent Skills

Browse our marketplace of 41,000+ Claude Code skills, agents, and tools. Find the perfect skill for your workflow or submit your own.