octofs-0.2.0 is not a library.
Octofs - Standalone MCP Filesystem Tools Server
Standalone Model Context Protocol (MCP) server providing comprehensive filesystem operations, code analysis, and shell execution tools for AI assistants and development workflows.
Features
- File Operations: View, read, create, edit, and manage files with intelligent truncation
- Directory Navigation: List, search, and traverse directories with glob patterns
- Text Editing: Batch edits, line-based operations, and atomic multi-file updates
- Code Analysis: AST-based pattern matching and refactoring with ast-grep
- Shell Execution: Execute commands with background process support
- Working Directory Management: Context-aware file operations with workdir switching
- Gitignore Awareness: Respects
.gitignorepatterns for clean file discovery - MCP Server: Exposes all tools via Model Context Protocol for AI integration
Installation
From Source
# Build the project
# Run the binary
Usage
CLI Structure
Octofs provides a single command to start the MCP server:
MCP Tools
The server exposes the following tools:
File Operations:
view- Read files, view directories, and search file contenttext_editor- Create, edit, and manage file contentbatch_edit- Perform multiple atomic edits on a single fileextract_lines- Copy lines from source to target file
Code Analysis:
ast_grep- Search and refactor code using AST patternssemantic_search- Find code by functionality (requires indexing)view_signatures- Extract function signatures and declarations
Shell & System:
shell- Execute commands with background process supportworkdir- Get or set working directory context
Directory Operations:
- Directory listing with glob patterns
- Content search with ripgrep integration
- Hidden file handling
Configuration
Octofs is configured via environment variables and command-line flags:
# Set log level
# Start server on specific port (HTTP mode)
# Start server in stdio mode (default, for MCP)
Storage Locations
Octofs is stateless and operates on the filesystem directly. No persistent storage is required.
Architecture
Core Modules
src/main.rs- Entry point and server initializationsrc/cli.rs- CLI argument parsingsrc/mcp/- MCP server implementationserver.rs- MCP protocol handlerfs/- Filesystem toolscore.rs- Core file operationstext_editing.rs- Text editing operationsdirectory.rs- Directory operationsast_grep.rs- AST-based code analysisshell.rs- Shell command executionworkdir.rs- Working directory managementfunctions.rs- Tool function definitions
src/utils/- Utility functionsglob.rs- Glob pattern matchingtruncation.rs- Content truncation logic
Development
Build Commands
# Development build
# Release build
# Run tests
# Check code quality
# Format code
Code Quality Standards
- Zero clippy warnings - All code must pass
cargo clippywithout warnings - Minimal dependencies - Reuse existing dependencies before adding new ones
- Error handling - Use proper
Result<T>types and meaningful error messages - Testing - Unit tests for individual components, integration tests for workflows
License
Apache-2.0
Credits
Developed by Muvon Un Limited.