davidswolf/dex-mcp-server-rust
If you are the rightful owner of dex-mcp-server-rust and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A production-quality Rust implementation of a Model Context Protocol (MCP) server for Dex Personal CRM.
Dex MCP Server (Rust)
A production-quality Rust implementation of a Model Context Protocol (MCP) server for Dex Personal CRM.
Overview
This MCP server enables AI assistants (like Claude) to interact with Dex Personal CRM, providing capabilities for:
- Contact Discovery: Intelligent contact search with fuzzy matching and confidence scoring
- Contact Enrichment: Add notes, reminders, and update contact information
- Relationship History: Retrieve contact timeline and interaction history
- Full-Text Search: Fast search across contacts, notes, and reminders with caching
Features
- 🦀 Written in Rust: Fast, safe, and reliable
- 🏗️ Clean Architecture: Repository pattern with clear separation of concerns
- 🔍 Advanced Search: Full-text search with BM25 ranking and fuzzy matching
- ⚡ Performance Optimized: Intelligent caching with configurable TTL
- 🧪 Well-Tested: Comprehensive unit and integration tests
- 📊 Observability: Built-in logging and metrics
- 🔒 Secure: Environment-based configuration for API keys
Quick Start
Prerequisites
- Rust 1.70+ (install via rustup)
- Dex API key (get one from Dex Settings)
Installation
- Clone the repository:
git clone https://github.com/yourusername/DexMCPServerRust.git
cd DexMCPServerRust
- Set up environment variables:
cp .env.example .env
# Edit .env and add your Dex API key
- Build the project:
cargo build --release
- Run the server:
cargo run --release
Configuration
Configuration is managed through environment variables. Create a .env file based on .env.example:
DEX_API_KEY=your_api_key_here
DEX_API_BASE_URL=https://api.getdex.com/api/rest
MAX_MATCH_RESULTS=10
MATCH_CONFIDENCE_THRESHOLD=70
CACHE_TTL_MINUTES=5
Claude Desktop Integration
To use this MCP server with Claude Desktop, add it to your configuration:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"dex": {
"command": "C:\\path\\to\\DexMCPServerRust\\target\\release\\dex-mcp-server.exe",
"env": {
"DEX_API_KEY": "your_api_key_here"
}
}
}
}
See claude_desktop_config_example.json for a complete example.
Available MCP Tools
Contact Discovery
- find_contact: Search for contacts by name, email, phone, or company
- get_contact_details: Retrieve complete contact information
Contact Enrichment
- enrich_contact: Add or update contact information
- add_contact_note: Create a note for a contact
- create_contact_reminder: Set a reminder for a contact
Relationship History
- get_contact_history: Retrieve contact timeline with notes and reminders
- get_contact_notes: Get all notes for a contact
- get_contact_reminders: Get all reminders for a contact
Search
- search_full_text: Fast full-text search across all data
Development
Running Tests
# Run all tests
cargo test
# Run library tests only
cargo test --lib
# Run specific test
cargo test test_name
# Run with output
cargo test -- --nocapture
Code Quality
# Format code
cargo fmt
# Run linter
cargo clippy
# Run linter with warnings as errors
cargo clippy -- -D warnings
Benchmarks
# Run benchmarks
cargo bench
CI/CD
This project uses GitHub Actions for continuous integration and automated releases.
Workflows
-
CI Pipeline: Runs on every push and PR
- Code formatting checks (
cargo fmt) - Linting with Clippy
- Tests on Linux, macOS, and Windows
- Documentation checks
- Security audits
- Dependency checks
- Code formatting checks (
-
Release Pipeline: Automated semantic versioning
- Automatic version calculation from commit messages
- Multi-platform binary builds (Linux, macOS, Windows, ARM)
- GitHub releases with changelogs
- Optional publishing to crates.io
Commit Message Format
This project uses Conventional Commits for automatic semantic versioning:
feat:- New feature (minor version bump)fix:- Bug fix (patch version bump)BREAKING CHANGE:- Breaking change (major version bump)docs:,chore:,refactor:,test:,ci:- No version bump
Example:
git commit -m "feat: add contact export functionality"
For more details, see .
Architecture
The project follows clean architecture principles:
src/
├── main.rs # Application entry point
├── lib.rs # Library root
├── client/ # Dex API client (sync wrapper)
├── repositories/ # Data access layer
├── services/ # Business logic layer
├── tools/ # MCP tool implementations
├── models/ # Domain models
├── search/ # Full-text search engine
├── cache/ # Caching utilities
├── config.rs # Configuration management
├── error.rs # Error types
└── server/ # MCP server implementation
For more details, see .
Performance
The server includes several performance optimizations:
- Request Caching: Configurable TTL-based caching for API responses
- Parallel Fetching: Concurrent API requests where possible
- Efficient Indexing: BM25-based search index with lazy initialization
- Connection Pooling: Reusable HTTP connections
See for benchmarks.
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Pre-commit Checklist
-
cargo fmt- Code is formatted -
cargo clippy- No clippy warnings -
cargo test- All tests pass -
cargo build- Project builds successfully - Documentation updated if needed
Documentation
- - Project guidelines and Rust best practices
- - Architecture overview
- - Logging and debugging guide
- - End-to-end testing guide
License
MIT License - see for details
Resources
Acknowledgments
Built with the MCP SDK for Rust and powered by Dex Personal CRM.