A Model Context Protocol (MCP) server that allows you to access files from multiple repositories without changing your current working directory.
Built with Go for simplicity and performance.
- Access multiple repositories from a single location
- Four powerful tools:
list_repos: List all configured repositories and their pathslist_files: List files in any configured repositoryread_file: Read files from any repositorysearch_files: Search for files using wildcards (* and ?)
- Resource protocol: Access files via
repo://repo-name/path/to/fileURIs - Auto-reload: Configuration automatically reloads when
config.jsonchanges - no restart needed! - Security built-in:
- Path traversal protection
- Automatic skipping of hidden files (starting with .)
- Automatic skipping of node_modules directories
-
Install the binary:
go install github.com/vimalk78/fs-mcp@latest
Or build locally:
go build -o fs-mcp sudo mv fs-mcp /usr/local/bin/ # Optional: install to system path -
Create your config directory and file:
# Create config directory mkdir -p ~/.config/fs-mcp # Copy the example config cp config.example.json ~/.config/fs-mcp/config.json # Edit with your actual repository paths vim ~/.config/fs-mcp/config.json
Example
~/.config/fs-mcp/config.json:{ "repositories": { "frontend": "/home/yourusername/projects/frontend", "backend": "/home/yourusername/projects/backend", "infrastructure": "/home/yourusername/projects/infrastructure" } }Important:
- Use absolute paths for your repositories
- The default config location is
~/.config/fs-mcp/config.json(automatically detected) - You can change repository paths anytime without rebuilding - changes auto-reload!
That's it! You now have a single executable with configurable repositories.
Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"multi-repo": {
"command": "fs-mcp"
}
}
}Or if you need to specify a custom config location:
{
"mcpServers": {
"multi-repo": {
"command": "fs-mcp",
"args": ["-config", "/path/to/your/config.json"]
}
}
}Note:
- If using
go install, ensure$GOPATH/binor$GOBINis in your PATH - Config auto-detected at
~/.config/fs-mcp/config.jsonif-confignot specified
Add this to your MCP settings file:
macOS/Linux: ~/.config/claude-code/mcp_settings.json
Windows: %APPDATA%\claude-code\mcp_settings.json
{
"mcpServers": {
"multi-repo": {
"command": "fs-mcp"
}
}
}Or if you need to specify a custom config location:
{
"mcpServers": {
"multi-repo": {
"command": "fs-mcp",
"args": ["-config", "/path/to/your/config.json"]
}
}
}Note:
- If using
go install, ensure$GOPATH/binor$GOBINis in your PATH - Config auto-detected at
~/.config/fs-mcp/config.jsonif-confignot specified - For Claude CLI: Use
claude --mcp-config ~/.config/claude-code/mcp_settings.jsonto load MCP servers
Important:
- Config file default location:
~/.config/fs-mcp/config.json(automatically detected) - Use absolute paths for repository locations in your config file
- If
fs-mcpcommand not found, ensure Go's bin directory is in your PATH
Once configured, you can use the MCP server through Claude:
What repositories do you have access to?
Claude will call:
list_repos()Show me the files in the backend repository
Claude will call:
list_files(repo="backend", path=".", recursive=False)Show me the file backend/src/api.py
Claude will call:
read_file(repo="backend", file="src/api.py")List all TypeScript files in the frontend repository
Claude will call:
search_files(repo="frontend", pattern="*.ts")You can also access files using the resource URI format:
Read the file at repo://backend/src/api.py
Lists all configured repositories and their paths.
Parameters: None
Returns: JSON object with list of repositories and count
Example:
{
"repositories": [
{
"name": "frontend",
"path": "/home/user/projects/frontend"
},
{
"name": "backend",
"path": "/home/user/projects/backend"
}
],
"count": 2
}Lists files in a repository directory.
Parameters:
repo(required): Repository name from your REPOS configurationpath(optional): Path within the repository (default: ".")recursive(optional): Whether to list files recursively (default: false)
Returns: JSON object with repository, path, and list of files
Example:
{
"repository": "frontend",
"path": "src",
"files": [
"App.tsx",
"index.ts",
"components/"
]
}Reads a file from a repository.
Parameters:
repo(required): Repository namefile(required): Path to the file within the repository
Returns: Plain text with header showing file location and contents
Example:
File: backend/src/api.py
from flask import Flask
app = Flask(__name__)
...
Searches for files matching a pattern.
Parameters:
repo(required): Repository namepattern(required): File name pattern with wildcards (* and ?)
Returns: JSON object with repository, pattern, and matching files
Example:
{
"repository": "frontend",
"pattern": "*.ts",
"matches": [
"src/index.ts",
"src/types/user.ts",
"src/utils/helper.ts"
]
}The server implements several security measures:
- Path Traversal Protection: All paths are validated to ensure they stay within configured repository bounds
- Hidden File Filtering: Files and directories starting with
.are automatically skipped - node_modules Filtering: The
node_modulesdirectory is automatically skipped - Read-only Access: The server only provides read access to files
- Check that the configuration file is in the correct location
- Verify the
fs-mcpbinary is accessible (check PATH or use absolute path) - For Claude CLI: Ensure you're using the
--mcp-configflag - Restart Claude Desktop/Code after configuration changes
- Check the logs for error messages
- Ensure the paths in your config file are absolute paths
- Verify the directories exist and are accessible
- Check file permissions
- Ensure the
-configflag points to the correct config file path (if specified)
- Ensure the file is a text file (binary files are not supported)
- Check that the file is not in a hidden directory or node_modules
- Verify the file path is correct relative to the repository root
To modify or extend the server:
- Edit
multi_repo_server.py - Add or modify tools in the
@app.call_tool()handler - Update the tool schemas in
@app.list_tools() - Test your changes by restarting Claude
This project is provided as-is for use with Claude.