About Claude Local Files
Claude Local Files is an MCP server in the Files category: serve local files to Claude Desktop via HTTPS for use in code artifacts.
Install
git clone https://github.com/runekaagaard/claude-local-filesThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Claude Local Files
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
Claude Local Files
Artifacts in Claude Desktop can only access cdn.jsdelivr.net/pyodide/* due to Content Security Policy restrictions. This app bypasses that restriction and allows Claude Desktop artifact and analysis tools to fetch local files and use them for calculations, UI's, etc.
I use it with mcp-alchemy to have Claude Desktop generate UI reports for database result sets that are way too large for an LLM to read.
How it works
- Adds a line in /etc/hosts that points cdn.jsdelivr.net to 127.0.0.1
- Uses mkcert to generate a valid local SSL certificate for cdn.jsdelivr.net
- Starts a caddy server that proxies all other requests than to a specfic url folder to Fastly
- Files in the
./filesdirectory are served athttps://cdn.jsdelivr.net/pyodide/claude-local-files/[FILENAME] - Removes the line in /etc/hosts on exit
Installation
Ubuntu/Debian
# Install dependencies
sudo apt update
sudo apt install mkcert caddy
macOS
# Install dependencies
brew install mkcert caddy
Windows
Run in an elevated powershell (as administrator):
# Install dependencies
winget install CaddyServer.Caddy
winget install FiloSottile.mkcert
# Run the script
./claude-local-files.ps1
Usage
- Clone and enter the repository:
git clone https://github.com/runekaagaard/claude-local-files.git
cd claude-local-files
- Start the server:
./claude-local-files.sh
-
Add your files to the
files/directory -
Ask Claude Desktop to use the content of the file in a code artifact, e.g. https://cdn.jsdelivr.net/pyodide/claude-local-files/test.json
Testing
Test that the local server works:
curl -v https://cdn.jsdelivr.net/pyodide/claude-local-files/test.json
Test that CDN passthrough works:
curl -v https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js
Generating URLs
To serve a file:
- Place it in the
files/directory - Access it at
https://cdn.jsdelivr.net/pyodide/claude-local-files/[FILENAME]
Example:
- File:
files/test.json - URL:
https://cdn.jsdelivr.net/pyodide/claude-local-files/test.json
Security Notes
- Only runs locally - the cdn.jsdelivr.net interception is only on your machine
- Uses proper HTTPS with valid certificates via mkcert
- Scripts cleans up /etc/hosts modifications on exit
- Certificates are stored in the git root directory
Development
Pull requests welcome! Areas for improvement:
- Windows support
- Better logging options
License
Mozilla Public License 2.0
My Other LLM Projects
- MCP Alchemy - Connect Claude Desktop to databases for exploring schema and running SQL.
- MCP Redmine - Let Claude Desktop manage your Redmine projects and issues.
- MCP Notmuch Sendmail - Email assistant for Claude Desktop using notmuch.
- Diffpilot - Multi-column git diff viewer with file grouping and tagging.
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.