| Crates.io | gamecode-mcp2 |
| lib.rs | gamecode-mcp2 |
| version | 0.7.0 |
| created_at | 2025-06-08 03:36:18.392665+00 |
| updated_at | 2025-06-28 12:31:34.713936+00 |
| description | Minimal, auditable Model Context Protocol server for safe LLM-to-system interaction |
| homepage | |
| repository | https://github.com/navicore/gamecode-mcp2 |
| max_upload_size | |
| id | 1704578 |
| size | 100,593 |
A minimal, auditable Model Context Protocol (MCP) server for LLM-to-system interaction.
gamecode-mcp2 implements the Model Context Protocol specification, enabling Large Language Models to execute tools and interact with systems in a controlled, secure manner. It prioritizes security and auditability through explicit configuration and minimal dependencies.
cargo install gamecode-mcp2
tools.yaml file:tools:
- name: read_file
description: Read the contents of a file
command: cat
args:
- name: path
description: Path to the file to read
required: true
type: string
cli_flag: null # Positional argument
gamecode-mcp2
{
"mcpServers": {
"gamecode": {
"command": "/path/to/gamecode-mcp2"
}
}
}
Tools are defined in YAML with the following structure:
tools:
- name: tool_name
description: What this tool does
command: command_to_execute # or "internal" for built-in handlers
args:
- name: argument_name
description: What this argument is for
required: true
type: string # string, number, boolean, or array
cli_flag: --flag # optional, null for positional args
is_path: true # optional, enables path validation
validation: # optional
validate_paths: true
allow_absolute_paths: false
The server includes safe implementations of common operations:
add, multiply: Basic arithmeticlist_files: List directory contentswrite_file: Write content to files (with validation)The server looks for tools in this order:
--tools-fileGAMECODE_TOOLS_FILEtools.yaml in current directory~/.config/gamecode-mcp/tools.yamlThe --inject flag allows you to pass server-side values that are invisible to the LLM but available to your tools. This is essential for multi-tenant scenarios where the LLM must not control security-critical parameters.
gamecode-mcp2 --inject tenant=customer123 --inject environment=production
When tools execute, they receive these as environment variables:
tenant=customer123 → GAMECODE_TENANT=customer123environment=production → GAMECODE_ENVIRONMENT=production┌─────────────┐ ┌──────────────┐ ┌─────────────────┐ ┌──────┐
│ Orchestrator│ --> │ gamecode-mcp2│ --> │ Tool Execution │ --> │ Tool │
│ (knows │ │ (--inject) │ │ (env vars set) │ │ │
│ tenant) │ │ │ │ │ │ │
└─────────────┘ └──────────────┘ └─────────────────┘ └──────┘
↑
│ MCP Protocol (no tenant info)
│
┌──────────────┐
│ LLM │
│ (cannot see │
│ or modify │
│ tenant) │
└──────────────┘
# Your orchestrator spawns a new MCP server per request
gamecode-mcp2 --inject tenant=$CUSTOMER_ID --inject env=$ENVIRONMENT
# Your tool script accesses the values
#!/bin/bash
# query-data.sh
psql -h $GAMECODE_ENV.db.example.com \
-d tenant_$GAMECODE_TENANT \
-c "$1"
Important: This provides a separation of concerns but is not a complete security solution. Always validate tool inputs and follow defense-in-depth principles.
See the examples/ directory for tool configurations for various use cases:
core/: Basic file and system operationsdevelopment/: Language-specific development toolssecurity/: Security-focused configurationsdata/: Data processing toolsmulti-tenant-example.yaml: Using injected values for tenant isolationMIT License - see LICENSE file for details