diff --git a/examples/file-system-node/icon.png b/examples/file-system-node/icon.png new file mode 100644 index 0000000..c8064ab Binary files /dev/null and b/examples/file-system-node/icon.png differ 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