Complete entity graph MCP server with smart relationships
Project description
Directory MCP
A comprehensive Model Context Protocol (MCP) server for managing people, companies, channels, and projects with rich relationships and intelligent entity resolution powered by Google Gemini embeddings.
๐ Features
- ๐ง Intelligent Entity Resolution: Gemini embeddings understand natural queries like "John from TechCorp" or "backend team Discord"
- ๐ Rich Relationship Management: Track who works where, project assignments, channel memberships with roles
- ๐ฏ Powerful Search: Multi-criteria filtering, fuzzy matching, and semantic search
- ๐ Network Analysis: Visualize connections, find colleagues, discover team relationships
- ๐ Zero Setup: SQLite database with automatic initialization
- ๐ Auto Updates: Always get the latest version with automated configuration updates
- โก Fast Performance: <200ms response times, efficient caching, optimized queries
๐ฆ Installation
Quick Start with Claude Code
# Install and configure in one command
claude mcp add directory \
--type stdio \
--command uvx \
--args directory-mcp \
--env GEMINI_API_KEY=your-key-here
# Get your free Gemini API key at:
# https://makersuite.google.com/app/apikey
Manual Installation
# Install via pip
pip install directory-mcp
# Or run directly with uvx (recommended)
uvx directory-mcp
# Configure environment
export GEMINI_API_KEY="your-api-key-here"
๐ Quick Start Examples
Creating Entities
"Create Alice Johnson as Senior Engineer at TechCorp, email alice@techcorp.com"
"Add a new company called StartupAI in San Francisco, 50-100 employees"
"Create a project called 'AI Research Initiative' starting January 2025"
"Add a Slack channel #ai-research for the AI team"
Finding People
"Find all Python developers in San Francisco"
"Who works at TechCorp?"
"Search for data scientists with machine learning skills"
"Find people named Sarah"
Managing Relationships
"Add Alice to the AI Research Initiative project as lead"
"Link John Doe to TechCorp as Software Engineer"
"Add Sarah to the #ai-research channel as moderator"
"Show Alice's network connections"
Network Analysis
"Show me John's complete professional network"
"How are Alice and Bob connected?"
"Who are all the people working on AI projects?"
"Get company overview for TechCorp"
๐ ๏ธ MCP Tools Reference
System Tools
- get_directory_status - Check server health and statistics
Entity Creation
- create_person - Add new person with details (name, email, skills, location, etc.)
- create_company - Add new company (name, domain, industry, size, etc.)
- create_project - Add new project (name, description, status, dates)
- create_channel - Add communication channel (Slack, Discord, Teams, etc.)
Entity Retrieval
- get_person_details - Get comprehensive person information
- get_company_overview - Get company details with people, projects, and channels
Search & Discovery
- search_people - Full-text search across all person data
- find_people_by_criteria - Filter by company, skills, location, title
Relationship Management
- link_person_to_company - Employment relationships with roles
- assign_person_to_project - Project assignments with allocation
- add_person_to_channel - Channel membership with roles
Network Analysis
- get_person_network - Visualize all connections for a person
๐๏ธ Architecture
Directory MCP uses a modular architecture optimized for maintainability:
src/directory_mcp/
โโโ server.py # Main MCP server (88 lines)
โโโ database/ # Database layer
โ โโโ manager.py # Core database operations
โ โโโ schema.sql # SQLite schema with FTS5
โโโ tools/ # MCP tool implementations
โ โโโ system.py # System status tools
โ โโโ entities/ # CRUD operations per entity
โ โโโ search.py # Search and discovery
โ โโโ relationships.py # Entity linking
โ โโโ analysis.py # Network analysis
โโโ utils/ # Shared utilities
โโโ embedder.py # Gemini embedding generation
โโโ resolver.py # Entity resolution logic
โโโ serialization.py # JSON serialization helpers
๐ง Configuration
Environment Variables
GEMINI_API_KEY- Required. Your Google Gemini API keyGEMINI_MODEL- Optional. Default:gemini-1.5-flash-latestGEMINI_EMBEDDING_MODEL- Optional. Default:text-embedding-004DATABASE_PATH- Optional. Default:~/.config/directory-mcp/directory.db
Database Location
The SQLite database is automatically created at:
- macOS/Linux:
~/.config/directory-mcp/directory.db - Windows:
%APPDATA%/directory-mcp/directory.db
๐ Performance
- Response Times: All operations complete in <200ms
- Embedding Generation: ~100ms per entity
- Search Operations: <50ms average
- Concurrent Support: Thread-safe SQLite operations
- Caching: Intelligent embedding cache for repeated queries
๐ Known Limitations
-
FTS5 Special Characters: Search doesn't handle
@,',#,-well- Workaround: Search by name instead of email
-
Duplicate Detection: No automatic duplicate person prevention
- Workaround: Search before creating
-
Channel Names: Hyphens in channel names cause SQL errors
- Workaround: Use underscores or spaces
๐ Version History
- v0.4.28 - Current stable release with comprehensive testing
- v0.4.0 - Major refactoring to modular architecture
- v0.3.0 - Added Gemini embeddings for intelligent search
- v0.2.0 - Relationship management features
- v0.1.0 - Initial release with basic CRUD
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
# Clone the repository
git clone https://github.com/markov-ai/directory-mcp.git
cd directory-mcp
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest tests/
# Run with debug logging
LOG_LEVEL=DEBUG uvx directory-mcp
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with FastMCP framework
- Powered by Google Gemini for embeddings
- Inspired by the need for better professional network management
๐ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- PyPI: directory-mcp
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file directory_mcp-0.5.0.tar.gz.
File metadata
- Download URL: directory_mcp-0.5.0.tar.gz
- Upload date:
- Size: 42.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02a5d46c698c392a7ce2900920fc2305474e6f7632b62843dad753fe822b1d31
|
|
| MD5 |
93f1f95dee9afbf84f75b6a7cdf8d8ce
|
|
| BLAKE2b-256 |
8c7f50db14d00964bca7f76e051af167d234779f3466c325b4df570fa4604353
|
File details
Details for the file directory_mcp-0.5.0-py3-none-any.whl.
File metadata
- Download URL: directory_mcp-0.5.0-py3-none-any.whl
- Upload date:
- Size: 47.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
258986f7f95fbbca236a67ca5e4d8825c2a712306b81d810fa2c18940ec46841
|
|
| MD5 |
da70d6953ffb3e77638530d6d931a95a
|
|
| BLAKE2b-256 |
7389f598a90ec75552077320418106ac65129a69bdeb321a7f90ef89d61d3276
|