Skip to content

Add comprehensive file operations tool to MCP everything server and new test files#3338

Closed
hamzaMissewi wants to merge 2 commits intomodelcontextprotocol:mainfrom
hamzaMissewi:main
Closed

Add comprehensive file operations tool to MCP everything server and new test files#3338
hamzaMissewi wants to merge 2 commits intomodelcontextprotocol:mainfrom
hamzaMissewi:main

Conversation

@hamzaMissewi
Copy link

@hamzaMissewi hamzaMissewi commented Feb 15, 2026

  • New file-operations.ts tool with read, write, delete, list, create-dir operations
  • Comprehensive error handling with proper MCP annotations
  • Added complete test suite with 15 test cases covering all operations
  • Updated tools/index.ts to register new tool
  • Enhanced server capabilities with production-ready file operations

Features:

  • Input validation with Zod schemas
  • Security annotations for different audiences (user/assistant)
  • Proper error handling and edge case coverage
  • Modern async/await with fs/promises
  • MCP-compliant response formatting

This addresses the missing file operations capability in the everything server and provides a foundation for more advanced file management features.

Description

Publishing Your Server

Note: We are no longer accepting PRs to add servers to the README. Instead, please publish your server to the MCP Server Registry to make it discoverable to the MCP ecosystem.

To publish your server, follow the quickstart guide. You can browse published servers at https://registry.modelcontextprotocol.io/.

Server Details

  • Server:
  • Changes to:

Motivation and Context

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

- New file-operations.ts tool with read, write, delete, list, create-dir operations
- Comprehensive error handling with proper MCP annotations
- Added complete test suite with 15 test cases covering all operations
- Updated tools/index.ts to register new tool
- Enhanced server capabilities with production-ready file operations

Features:
- Input validation with Zod schemas
- Security annotations for different audiences (user/assistant)
- Proper error handling and edge case coverage
- Modern async/await with fs/promises
- MCP-compliant response formatting

This addresses the missing file operations capability in the everything server
and provides a foundation for more advanced file management features.
### **Changes Made:**

**New Tool ([file-operations.ts](cci:7://file:///f:/projects/contribution-forks/mcp-servers/src/everything/tools/file-operations.ts:0:0-0:0)):**
- Read, write, delete, list, create-dir operations
- Comprehensive error handling with proper annotations
- Input validation and security checks
- MCP-compliant response formatting

**Enhanced Test Coverage:**
- Added [file-operations.test.ts](cci:7://file:///f:/projects/contribution-forks/mcp-servers/src/everything/__tests__/file-operations.test.ts:0:0-0:0) with 15 test cases
- Covers all operations, error scenarios, and input validation
- Mocked file system operations for isolated testing

**Integration:**
- Updated [tools/index.ts](cci:7://file:///f:/projects/contribution-forks/mcp-servers/src/everything/tools/index.ts:0:0-0:0) to register new tool
- Tool available as `file-operations` in MCP server

### **Benefits:**
1. **Enhanced Functionality** - Provides missing file operations capability
2. **Production Ready** - Proper error handling and validation
3. **Well Tested** - Comprehensive test coverage for reliability
4. **MCP Compliant** - Follows protocol standards with annotations
5. **Security Focused** - Input validation and safe operations

### **Technical Details:**
- Uses modern `fs/promises` with proper async/await
- Implements Zod schema validation
- Provides audience-specific annotations (user/assistant)
- Handles edge cases like empty paths and permission errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant