A production-quality Rust implementation of a Model Context Protocol (MCP) server for Dex Personal CRM.
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
- π¦ 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
- Rust 1.70+ (install via rustup)
- Dex API key (get one from Dex Settings)
- 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 --releaseConfiguration 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=5To 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.
- find_contact: Search for contacts by name, email, phone, or company
- get_contact_details: Retrieve complete contact information
- 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
- 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_full_text: Fast full-text search across all data
# 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# Format code
cargo fmt
# Run linter
cargo clippy
# Run linter with warnings as errors
cargo clippy -- -D warnings# Run benchmarks
cargo benchThis project uses GitHub Actions for continuous integration and automated releases.
-
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
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 .github/WORKFLOWS.md.
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 CLAUDE.md.
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 PERFORMANCE_RESULTS.md for benchmarks.
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
-
cargo fmt- Code is formatted -
cargo clippy- No clippy warnings -
cargo test- All tests pass -
cargo build- Project builds successfully - Documentation updated if needed
- CLAUDE.md - Project guidelines and Rust best practices
- architecture-review.md - Architecture overview
- LOGGING_GUIDE.md - Logging and debugging guide
- E2E_TESTS_SUMMARY.md - End-to-end testing guide
MIT License - see LICENSE for details
Built with the MCP SDK for Rust and powered by Dex Personal CRM.