From de7e5b415db8060bf35442c94dc5e0df4910cea5 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Tue, 8 Jul 2025 10:59:41 -0700 Subject: [PATCH] feat: Add filesystem as an example --- examples/file-system-node/icon.png | Bin 0 -> 679 bytes examples/file-system-node/manifest.json | 97 ++++++++++++++++++++++ examples/file-system-node/package.json | 10 +++ examples/file-system-node/server/index.js | 32 +++++++ 4 files changed, 139 insertions(+) create mode 100644 examples/file-system-node/icon.png create mode 100644 examples/file-system-node/manifest.json create mode 100644 examples/file-system-node/package.json create mode 100644 examples/file-system-node/server/index.js diff --git a/examples/file-system-node/icon.png b/examples/file-system-node/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c8064abaa8b944b4b6338c133aebfc53ab226916 GIT binary patch literal 679 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r51|<6gKdl8)oCO|{#S9EO-XP4l)OOlRpde#$ zkh>GZx^prwfgF}}M_)$E)e-c?47?^B4T^vIy7~kG;^lNqyIrh=qZ}%!Sm5f6| z`3ux9+&ds0;lE&>Lw>^E#(6HbjdG2uo{DDMu4Y(ErmqQ1+QL&S#JK;y7e~S`|Am*2 zY6}9*2Z96tl~yP=DR4}kB`fsOcCF?TRSv~>XMR3!cC30>!)My?{`YUEfct-5Ueq_Z z-nAsB{INw}QUB6e)&1p;`_H(&DY>?7v4)hMm0wWrRMGcyzkmAl=g*HHC3{~i5W9Ni z{Kq4OlT>Q8G&pQN^Gsd-?B~w;JFofOtK7P$wZ1Do?vLZFUG)q#PbJq*+jIV%_oR}< z#iFZbZh92y+|0Eq^nlT0-P1oMCE6C6%h}H;op!@?_U;hDddc%eTp8jkC!c(A>InBr zr+-%So|bTHo9>M&D~+F~b!2l9b6(Dmy(_wee?Zvf9_|2{clRHOpIJ0 z{_jYZQhRhne(LrmAF?qlGSXCGX*AaQkhs;;9$Mcg*TPGYlT94 z!y~KRrZaoaP5bE{ntorx%h!L??`QUm8)lqdah*3c?eUgn_j1hMu3i88ipt}UFJ|xk zW%GQ?pUOmQ=i7OwZ?EdDntHbH4?o+>w0ng+w{MucaB5KLTh^EJXZ(NB^2$oqoAu1| wXZPIpZ(A|(-n{STt5Rk2K2WeO7UboFyt=akR{0BeLMC;$Ke literal 0 HcmV?d00001 diff --git a/examples/file-system-node/manifest.json b/examples/file-system-node/manifest.json new file mode 100644 index 0000000..7929542 --- /dev/null +++ b/examples/file-system-node/manifest.json @@ -0,0 +1,97 @@ +{ + "dxt_version": "0.1", + "id": "anthropic.demo.filesystem", + "name": "Filesystem", + "display_name": "Filesystem", + "version": "0.1.3", + "description": "Let Claude access your filesystem to read and write files.", + "long_description": "This extension allows Claude to interact with your local filesystem, enabling it to read and write files directly. This can be useful for tasks such as file management, data processing, and automation of repetitive tasks. The extension provides a set of tools that can be used to navigate directories, read file contents, and write new files or modify existing ones.\n\nUnderneath the hood, it uses @modelcontextprotocol/server-filesystem.", + "author": { + "name": "Anthropic", + "url": "https://www.claude.ai" + }, + "homepage": "https://www.claude.ai", + "documentation": "https://support.anthropic.com/en/collections/4078531-claude-ai", + "support": "https://support.anthropic.com/en/collections/4078531-claude-ai", + "icon": "icon.png", + "tools": [ + { + "name": "read_file", + "description": "Read the contents of a file" + }, + { + "name": "read_multiple_files", + "description": "Read the contents of multiple files" + }, + { + "name": "write_file", + "description": "Write content to a file" + }, + { + "name": "edit_file", + "description": "Edit the contents of a file" + }, + { + "name": "create_directory", + "description": "Create a new directory" + }, + { + "name": "list_directory", + "description": "List contents of a directory" + }, + { + "name": "directory_tree", + "description": "Display directory structure as a tree" + }, + { + "name": "move_file", + "description": "Move or rename a file" + }, + { + "name": "search_files", + "description": "Search for files by name or content" + }, + { + "name": "get_file_info", + "description": "Get information about a file" + }, + { + "name": "list_allowed_directories", + "description": "List directories that can be accessed" + } + ], + "server": { + "type": "node", + "entry_point": "server/index.js", + "mcp_config": { + "command": "node", + "args": [ + "${__dirname}/server/index.js", + "${user_config.allowed_directories}" + ] + } + }, + "keywords": [ + "api", + "automation", + "productivity" + ], + "license": "MIT", + "compatibility": { + "claude_desktop": ">=0.10.0", + "platforms": ["darwin", "win32", "linux"], + "runtimes": { + "node": ">=16.0.0" + } + }, + "user_config": { + "allowed_directories": { + "type": "directory", + "title": "Allowed Directories", + "description": "Select directories the filesystem server can access", + "multiple": true, + "required": true, + "default": [] + } + } +} \ No newline at end of file diff --git a/examples/file-system-node/package.json b/examples/file-system-node/package.json new file mode 100644 index 0000000..f7f818a --- /dev/null +++ b/examples/file-system-node/package.json @@ -0,0 +1,10 @@ +{ + "name": "ant.dir.ant.anthropic.filesystem", + "version": "0.1.3", + "type": "module", + "private": true, + "main": "server/index.js", + "dependencies": { + "@modelcontextprotocol/server-filesystem": "2025.1.14" + } +} \ No newline at end of file diff --git a/examples/file-system-node/server/index.js b/examples/file-system-node/server/index.js new file mode 100644 index 0000000..e7aa762 --- /dev/null +++ b/examples/file-system-node/server/index.js @@ -0,0 +1,32 @@ +#!/usr/bin/env node + +/** + * Entry point for the Filesystem MCP server extension + * This wraps the @modelcontextprotocol/server-filesystem package + */ + +// Get allowed directories from command line arguments +const args = process.argv.slice(2); + +// Use dynamic require since we need CommonJS compatibility +const loadServer = async () => { + try { + // Save original argv + const originalArgv = process.argv; + + // The filesystem server expects directories as command line arguments + process.argv = [process.argv[0], process.argv[1], ...args]; + + // Dynamically import the ESM module + await import('@modelcontextprotocol/server-filesystem/dist/index.js'); + + // Restore original argv + process.argv = originalArgv; + } catch (error) { + console.error('Failed to load @modelcontextprotocol/server-filesystem:', error); + process.exit(1); + } +}; + +// Execute the async function +loadServer(); \ No newline at end of file