') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - localrivet/gocreate · GitHub
Skip to content

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

ToolDescriptionArguments
read_fileRead file contents with optional paginationfile_path, start_line?, end_line?
write_fileWrite content to filefile_path, content
read_multiple_filesRead multiple files at oncefile_paths[]
create_directoryCreate directorypath
list_directoryList directory contentspath
move_fileMove/rename filessource_path, destination_path
search_filesFind files by namepath, pattern, timeout_ms?
get_file_infoGet file metadatapath

Editing Tools

ToolDescriptionArguments
edit_blockReplace text blocksfile_path, old_string, new_string, expected_replacements?
precise_editLine-based editingfile_path, start_line, end_line, new_content

Search Tools

ToolDescriptionArguments
search_codeSearch code with pure Go enginepath, pattern, file_pattern?, ignore_case?, max_results?, include_hidden?, context_lines?, timeout_ms?

Terminal Tools

ToolDescriptionArguments
execute_commandExecute terminal commandcommand, timeout_ms?, shell?, use_powershell?
read_outputRead command outputpid
force_terminateTerminate sessionpid
list_sessionsList active sessions-
execute_in_terminalClient-side terminal executioncommand, cwd?

Process Tools

ToolDescriptionArguments
list_processesList running processes-
kill_processTerminate process by PIDpid

Configuration Tools

ToolDescriptionArguments
get_configGet current configuration-
set_config_valueSet configuration valuekey, 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

Stars

25 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages