Skip to content

Conversation

@gorgalxandr
Copy link

Overview

This PR adds comprehensive CLI integration documentation and a practical file operations example to help developers integrate Rust MCP servers with AI CLI tools like Claude Code CLI, Codex CLI, and Gemini CLI.

What's Added

1. Comprehensive CLI Integration Guide (examples/cli-integration/CLI_INTEGRATION_GUIDE.md)

  • Step-by-step setup instructions for Claude Code CLI, Codex CLI, and Gemini CLI
  • Detailed troubleshooting section with common issues and solutions
  • Security considerations and best practices
  • Manual testing procedures for debugging
  • Configuration templates and wrapper script examples

2. File Operations Example (examples/servers/file_operations_stdio.rs)

  • Complete MCP server implementation using the official Rust SDK
  • Real-world tools that AI assistants need: file I/O and command execution
  • Proper error handling and user-friendly error messages
  • Security-conscious implementation with input validation examples

3. Helper Scripts (examples/cli-integration/scripts/)

  • Automated setup script for streamlined integration
  • Wrapper script templates for CLI tools that need them
  • Ready-to-use configuration examples

4. Updated Project Configuration

  • Added file operations example to Cargo.toml
  • Excluded documentation directory from workspace to prevent build issues

Problem Solved

The official Rust MCP SDK is excellent but was missing practical examples and documentation for real-world AI CLI integration. Developers had to figure out:

  • How different CLI tools handle MCP server integration
  • Why wrapper scripts are needed for some CLI tools
  • Common integration issues and their solutions
  • Security considerations for production use

Testing

The file operations example has been tested with:

  • ✅ Claude Code CLI - Working with wrapper script
  • ✅ Codex CLI - Working with direct binary execution
  • ✅ Gemini CLI - Working with wrapper script

All three tools can successfully:

  • Initialize the MCP connection
  • List available tools
  • Execute file read/write operations
  • Execute shell commands
  • Handle errors gracefully

Benefits for the Community

  1. Faster Adoption - Developers can quickly set up working AI tool integrations
  2. Reduced Support Burden - Common integration issues are documented with solutions
  3. Best Practices - Shows proper error handling, logging, and security considerations
  4. Real-World Examples - File operations are what developers actually need for AI tools

Breaking Changes

None. This PR only adds new examples and documentation.

Checklist

  • Examples follow Rust SDK patterns and conventions
  • Code includes proper error handling
  • Documentation is comprehensive and clear
  • Examples have been tested with multiple CLI tools
  • Security considerations are documented
  • Helper scripts are provided for common scenarios
  • Example compiles successfully

- Add comprehensive CLI integration documentation
- Add file operations MCP server example using official SDK
- Include helper scripts and automation tools
- Provide troubleshooting guide and best practices
- Support Claude Code CLI, Codex CLI, and Gemini CLI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added T-documentation Documentation improvements T-dependencies Dependencies related changes T-config Configuration file changes T-examples Example code changes labels Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-config Configuration file changes T-dependencies Dependencies related changes T-documentation Documentation improvements T-examples Example code changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant