Skip to content

localrivet/gocreate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoCreate 🚀

A powerful Model Context Protocol (MCP) server built in Go that provides comprehensive development tools for AI assistants. GoCreate enables seamless interaction between AI models and your development environment through a standardized protocol.

Built with gomcp - the complete Go implementation of the Model Context Protocol.

✨ Features

🗂️ File System Operations

  • Read Files: Read file contents with optional line-based pagination
  • Write Files: Create or completely replace file contents
  • Multiple File Reading: Read multiple files simultaneously
  • Directory Management: Create directories and list contents with detailed metadata
  • File Operations: Move, rename files and directories
  • File Search: Find files by name using case-insensitive substring matching
  • File Info: Get detailed metadata about files and directories

✏️ Code Editing

  • Block Editing: Surgical text replacements with diff-based error reporting
  • Precise Editing: Line-based editing with start/end line specifications
  • Large File Support: Handles files up to 100MB with memory-efficient processing
  • Context-Aware Replacements: Smart replacement with near-miss detection

🔍 Search Capabilities

  • Code Search: Powered by pure Go search engine with ripgrep-compatible features
  • Advanced Filtering: File pattern matching, case-insensitive search, gitignore support
  • Context Lines: Configurable context around matches
  • Performance Optimized: Concurrent processing with worker pools and atomic operations
  • Timeout Support: Configurable search timeouts
  • Unicode Support: Full UTF-8 text processing

💻 Terminal & Process Management

  • Command Execution: Execute terminal commands with timeout support
  • Session Management: Manage multiple terminal sessions
  • Process Control: List running processes and terminate by PID
  • Output Reading: Read command output from running sessions
  • Cross-Platform: Support for Unix-like systems and Windows

⚙️ Configuration Management

  • Dynamic Config: Get and set configuration values at runtime
  • Security Controls: Configurable blocked commands for safety
  • JSON-based: Human-readable configuration format

🛠️ Installation

Prerequisites

  • Go 1.24 or later
  • Git

Build from Source

git clone https://github.com/localrivet/gocreate.git
cd gocreate
go mod download
go build -o gocreate

🚀 Usage

As MCP Server

GoCreate implements the Model Context Protocol and can be used with any MCP-compatible client:

./gocreate

Configuration with Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "gocreate": {
      "command": "/path/to/gocreate",
      "args": [],
      "env": {}
    }
  }
}

Configuration with Other MCP Clients

GoCreate follows the standard MCP protocol and works with any MCP-compatible client. See the gomcp documentation for client examples.

🔧 Available Tools

File System Tools

Tool Description Arguments
read_file Read file contents with optional pagination file_path, start_line?, end_line?
write_file Write content to file file_path, content
read_multiple_files Read multiple files at once file_paths[]
create_directory Create directory path
list_directory List directory contents path
move_file Move/rename files source_path, destination_path
search_files Find files by name path, pattern, timeout_ms?
get_file_info Get file metadata path

Editing Tools

Tool Description Arguments
edit_block Replace text blocks file_path, old_string, new_string, expected_replacements?
precise_edit Line-based editing file_path, start_line, end_line, new_content

Search Tools

Tool Description Arguments
search_code Search code with pure Go engine path, pattern, file_pattern?, ignore_case?, max_results?, include_hidden?, context_lines?, timeout_ms?

Terminal Tools

Tool Description Arguments
execute_command Execute terminal command command, timeout_ms?, shell?, use_powershell?
read_output Read command output pid
force_terminate Terminate session pid
list_sessions List active sessions -
execute_in_terminal Client-side terminal execution command, cwd?

Process Tools

Tool Description Arguments
list_processes List running processes -
kill_process Terminate process by PID pid

Configuration Tools

Tool Description Arguments
get_config Get current configuration -
set_config_value Set configuration value key, value

🔒 Security Features

  • Command Blocking: Configurable list of blocked commands for security
  • File Size Limits: 100MB limit for editing operations
  • Input Validation: Comprehensive argument validation
  • Safe Defaults: Secure default configurations

Default Blocked Commands

  • File system: rm, mkfs, format, mount, umount, fdisk, dd
  • System admin: sudo, su, passwd, adduser, useradd, usermod
  • System control: shutdown, reboot, halt, poweroff, init
  • Network/Security: iptables, firewall, netsh

📁 Project Structure

gocreate/
├── main.go                 # Server entry point
├── config/                 # Configuration management
├── tools/
│   ├── config/            # Configuration tools
│   ├── edit/              # Text editing tools
│   ├── filesystem/        # File system operations
│   ├── process/           # Process management
│   ├── search/            # Pure Go search engine
│   └── terminal/          # Terminal operations
├── go.mod                 # Go module definition
└── README.md             # This file

🔄 Protocol Support

GoCreate implements the Model Context Protocol with support for:

  • Tools: All 20+ development tools
  • Structured Logging: Using Go's log/slog package
  • Error Handling: Comprehensive validation and error reporting
  • Timeout Management: Configurable timeouts for long-running operations
  • Cross-Platform: Unix-like systems and Windows support
  • Type Safety: Leverages Go's type system for safety and expressiveness
  • Automatic Version Negotiation: Seamless compatibility with MCP clients

🏗️ Built With

  • gomcp - Complete Go implementation of Model Context Protocol
  • goripgrep - High-performance text search with ripgrep-compatible features
  • go-diff - Diff functionality for precise editing
  • Go 1.24+ - Modern Go features and performance

🚀 Performance Features

Search Engine Optimizations

  • Concurrent Processing: Worker pools scaling with CPU cores
  • Atomic Operations: Thread-safe statistics and counters
  • Literal String Optimization: Fast path for non-regex patterns
  • Binary File Detection: Automatic skipping of binary files
  • Memory Efficient: Streaming file processing with configurable buffers
  • Gitignore Support: Respects .gitignore patterns (configurable)

Benchmarks

Our pure Go search engine delivers excellent performance:

  • Speed: ~350µs to scan 10 files (730 bytes)
  • Concurrency: Scales with available CPU cores
  • Memory: Efficient streaming with minimal memory footprint
  • Compatibility: Drop-in replacement for ripgrep functionality

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

🔗 Related Projects


GoCreate - Empowering AI assistants with comprehensive development tools 🛠️✨

Built with ❤️ using gomcp

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published