An MCP server written in Go that provides tools for shell command execution, file operations, and file searching with security controls
This Go MCP server implements 4 file and shell operation tools with explicit schemas and descriptions. Naming follows verb_noun conventions (execute_shell_command, show_file, search_in_file, write_file). All tools have descriptions of 50-200 chars and structured input parameters with types and per-param descriptions visible in the Go struct tags. However, output schemas are NOT documented in the code provided, only inferred from Go struct field names. Error handling is minimal; security features like path validation exist but are not surfaced in tool descriptions. Tool composition is reasonable (single responsibility per tool), but descriptions lack context about when to use each tool instead of alternatives, and no dry-run/confirmation pattern for destructive operations (execute_shell_command, write_file).
Execute a shell command and return the complete results including stdout, stderr, and exit code
Search for patterns in a file using regular expressions
Show contents of a file with options to display specific line ranges
Write content to a file with options to append or overwrite existing content
Output schemas not documented. Neither tool descriptions nor source code explicitly define what fields are returned. LLMs cannot plan downstream operations without knowing the response structure. The Go struct ExecuteShellCommandResult is visible but not exposed as a schema declaration in the tool registration.
execute_shell_command description (107 chars) lacks guidance on error recovery. No mention that stderr is captured, what exit codes mean, or when to retry vs. report failure to user. Description states WHAT but not WHEN or WHY.
write_file has no confirmation or dry-run option. This is a destructive tool (mode='w' overwrites existing files) but the description does not warn agents or suggest a preview step. Agents making mistakes will silently destroy files.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 47 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 38 | - | v1 |
Security constraints (path allowlisting via AllowedPaths, DenyListPaths) are implemented server-side but NOT documented in tool descriptions. LLMs do not know which paths are accessible, potentially wasting calls on forbidden operations or misunderstanding error responses.
Tool descriptions do not disambiguate when to use show_file vs. search_in_file. An LLM might call search_in_file with an empty pattern as a workaround to read a file, wasting compute. Descriptions should clarify the distinction.
Error handling is not described. What does execute_shell_command return if the command times out? If a file is not found? If a regex is invalid? Tool descriptions and schema should hint at error conditions and recovery paths.
execute_shell_command timeout parameter has no units specified in the description ('Maximum execution time in seconds' is stated, but is the integer in milliseconds or seconds? Ambiguous.) Additionally, no bounds defined (min=?, max=?).
search_in_file parameter max_matches=-1 to mean 'all matches' is underdocumented. LLMs may not understand that -1 is a sentinel value. Describe the expected behavior: 'Use -1 to return all matches; omit for default limit of 100.'