mcp in rust both client and server
  • Rust 98.1%
  • Makefile 1.9%
Find a file
2025-06-28 12:30:59 +00:00
.github crate name 2025-06-07 20:29:36 -07:00
examples env example 2025-06-09 21:43:12 -07:00
mcp-client publish 2025-06-07 19:31:00 -07:00
mcp-server readme 2025-06-27 16:03:30 -07:00
tests tools 2025-06-02 23:25:59 -07:00
.gitignore credit bal too low 2025-06-08 13:31:18 -07:00
Cargo.lock chore: bump version to 0.7.0 2025-06-28 12:30:59 +00:00
Cargo.toml chore: bump version to 0.7.0 2025-06-28 12:30:59 +00:00
LICENSE Create LICENSE 2025-06-07 19:01:40 -07:00
Makefile install 2025-06-07 14:21:49 -07:00
README.md badges 2025-06-07 20:23:45 -07:00
SECURITY.md warnings 2025-06-07 20:01:23 -07:00
THREAT_MODEL.md your 2025-06-07 20:06:19 -07:00

Dependabot Updates Rust CI

GameCode MCP2

A clean (and possibly naive) implementation of the Model Context Protocol (MCP) for tool integration.

Motivation - as few dependencies as possible, as simple and auditable a configuration as possible.

⚠️ Security Notice

MCP is early technology. Allowing LLMs to execute system commands is inherently risky. This implementation prioritizes auditability over features - you can read every line that processes LLM requests. Even so, proceed with caution. Only time will tell if MCP's approach is sound.

Key Features

  • Direct tool exposure - Tools defined in tools.yaml are exposed directly via MCP, not through meta-tools
  • Clean protocol implementation - Pure JSON-RPC 2.0 over stdio without external dependencies
  • Dynamic tool loading - Configure tools via YAML without recompiling
  • Built-in and external tools - Support for both internal handlers and external commands

Architecture

This workspace contains two crates:

  • mcp-server - The MCP server that loads tools from tools.yaml and exposes them via the protocol
  • mcp-client - A client library for testing and integration

Usage

Running the Server

# Build the server
cargo build --release --bin gamecode-mcp2

# Create a tools.yaml file (see examples/tools.yaml)
cp examples/tools.yaml .

# Run the server (it communicates via stdio)
./target/release/gamecode-mcp2

Using with Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "gamecode": {
      "command": "/path/to/gamecode-mcp2"
    }
  }
}

Using with gamecode-cli

The mcp-client crate can be used as a dependency in gamecode-cli for MCP integration.

Tool Configuration

Tools are defined in tools.yaml:

tools:
  - name: my_tool
    description: Description for the LLM
    command: /path/to/command  # or "internal" for built-in
    args:
      - name: param1
        description: Parameter description
        required: true
        type: string
        cli_flag: --param  # null for positional
    internal_handler: handler_name  # for internal tools

Protocol

This implementation follows the MCP specification:

  • initialize - Handshake with client
  • tools/list - Returns all available tools
  • tools/call - Execute a specific tool

Tools are exposed directly, not through meta-tools like "run".