A comprehensive MCP server for AI knowledge management with Elasticsearch, file operations, and version control
Project description
Elasticsearch MCP Server ๐
The complete knowledge management solution
Powerful Model Context Protocol server for Elasticsearch integration with comprehensive file management and version control.
๐ What is Elasticsearch MCP Server?
The most comprehensive MCP server that transforms your AI assistant into a powerful knowledge management system. The key advantage? It combines everything you needโElasticsearch search, file operations, document validation, and version control in one unified solution.
๐ Complete Knowledge Management:
- โ Elasticsearch Integration: Full-featured search, indexing, and document management
- โ File System Control: Comprehensive file operations with cross-platform support
- โ Document Validation: Schema-enforced document structure with auto-templates
- โ Version Control: Git and SVN support with intelligent file tracking
- โ Security First: Sandboxed operations with configurable restrictions
- โ Production Ready: Battle-tested with comprehensive error handling
โจ Key Benefits:
- ๐ฏ 28 Powerful Tools: Everything from search to version control
- ๐ Universal AI Support: Works with Claude, ChatGPT, Cursor, and any MCP-compatible AI
- ๐ Smart Document Management: Auto-validation, templates, and structured data
- ๐ก๏ธ Enterprise Security: Path validation, access controls, and audit trails
- โก Zero Dependencies: Optional Elasticsearch - works standalone for file operations
๐ AI Assistant Support
Works with any MCP-compatible AI assistant:
- โ Claude Desktop
- โ ChatGPT Plus (with MCP support)
- โ Cursor IDE
- โ Windsurf
- โ VS Code (with MCP extension)
- โ Any MCP client
Perfect for developers who want to automate knowledge management and teams who need structured document workflows!
๐ฌ What You Can Do
Real workflows you can try today:
๐ Knowledge Management
- "Search all documents for information about API authentication and create a comprehensive guide"
- "Index this technical document with proper categorization and tags"
- "Find all documents related to deployment and generate a deployment checklist"
- "Create a new document template for API documentation with required fields"
๐ File Operations & Organization
- "Organize all markdown files by category and move them to appropriate directories"
- "Read all configuration files and create a settings summary document"
- "Find duplicate files in the project and list them for cleanup"
- "Create a project structure document listing all important files"
๐ Version Control & History
- "Setup Git repository for this knowledge base and commit all current documents"
- "Check what changes were made to the user manual in the last version"
- "Commit these updated API docs with a descriptive message"
- "Show me the previous version of this configuration file"
๐ค Development & Documentation
- "Index all code documentation and make it searchable"
- "Create a changelog from Git commit history"
- "Validate all documents follow our schema requirements"
- "Generate project documentation from README files"
๐ Advanced Search & Analysis
- "Search across all documents and files for security-related information"
- "Find all TODO comments in code files and create a task list"
- "Analyze document metadata and generate a content report"
- "Search for outdated information and flag it for review"
โก Quick Start
1. Installation
๐ NEW: Now Available on PyPI!
# Super easy installation with uvx
uvx agent-knowledge-mcp
# Or install as a tool for persistent use
uv tool install agent-knowledge-mcp
Alternative installation methods:
# Install from GitHub (latest development)
uvx --from git+https://github.com/itshare4u/AgentKnowledgeMCP.git agent-knowledge-mcp
# Traditional installation
git clone https://github.com/itshare4u/AgentKnowledgeMCP.git
cd AgentKnowledgeMCP
pip install -r requirements.txt
2. Configuration
# Copy and edit configuration
cp src/config.json.example src/config.json
nano src/config.json
3. Connect to Your AI Assistant
For Claude Desktop, add to your claude_desktop_config.json:
{
"mcpServers": {
"agent-knowledge": {
"command": "uvx",
"args": ["agent-knowledge-mcp"]
}
}
}
Alternative configurations:
{
"mcpServers": {
"agent-knowledge-github": {
"command": "uvx",
"args": ["--from", "git+https://github.com/itshare4u/AgentKnowledgeMCP.git", "agent-knowledge-mcp"]
}
}
}
For Cursor, add to settings:
{
"cursor.mcp.servers": [
{
"name": "agent-knowledge",
"command": "uvx",
"args": ["agent-knowledge-mcp"]
}
]
}
Alternative (if installed manually):
{
"cursor.mcp.servers": [
{
"name": "agent-knowledge",
"command": "python3",
"args": ["/path/to/AgentKnowledgeMCP/src/server.py"],
"workingDirectory": "/path/to/AgentKnowledgeMCP"
}
]
}
For VS Code, install MCP extension and configure:
{
"mcp.servers": {
"agent-knowledge": {
"command": "uvx",
"args": ["agent-knowledge-mcp"]
}
}
}
Alternative (if installed manually):
{
"mcp.servers": {
"agent-knowledge": {
"command": "python3",
"args": ["/path/to/AgentKnowledgeMCP/src/server.py"],
"cwd": "/path/to/AgentKnowledgeMCP"
}
}
}
For Windsurf, add to ~/.windsurf/config.json:
{
"mcp": {
"servers": {
"agent-knowledge": {
"command": "uvx",
"args": ["agent-knowledge-mcp"]
}
}
}
}
Alternative (if installed manually):
{
"mcp": {
"servers": {
"agent-knowledge": {
"command": "python3",
"args": ["/path/to/AgentKnowledgeMCP/src/server.py"],
"env": {
"PYTHONPATH": "/path/to/AgentKnowledgeMCP"
}
}
}
}
}
๏ฟฝ Quick VS Code Installation
For quick installation in VS Code, click the installation buttons below:
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P (or Cmd + Shift + P on macOS) and typing Preferences: Open Settings (JSON).
Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.
Note that the
mcpkey is needed when using themcp.jsonfile.
UV Installation (Recommended)
{
"mcp": {
"servers": {
"agent-knowledge": {
"command": "uvx",
"args": ["agent-knowledge-mcp"]
}
}
}
}
Manual Installation
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "server_path",
"description": "Path to AgentKnowledgeMCP server.py",
"default": "${workspaceFolder}/src/server.py"
}
],
"servers": {
"agent-knowledge": {
"command": "python3",
"args": [
"${input:server_path}"
],
"cwd": "${workspaceFolder}"
}
}
}
}
๏ฟฝ๐ ๏ธ Capabilities
Elasticsearch MCP Server provides 28 powerful tools across 4 categories:
๐ Elasticsearch Operations (9 tools)
- Smart Search - Multi-field queries with boosting and relevance scoring
- Document Management - Index, retrieve, update, delete with validation
- Index Administration - Create, configure, manage Elasticsearch indices
- Schema Validation - Enforce document structure and data types
- Template Generation - Auto-create document templates with required fields
๐ File System Management (11 tools)
- File Operations - Read, write, append, delete, move, copy with safety checks
- Directory Management - Create, list, navigate directory structures
- Path Intelligence - Relative/absolute path conversion and validation
- File Discovery - Search files by name, content, or metadata
- Cross-Platform - Windows, macOS, Linux compatibility
๐๏ธ System Administration (5 tools)
- Configuration Management - Dynamic config reload and validation
- Security Controls - Access restrictions and path validation
- Health Monitoring - System status and Elasticsearch connectivity
- Auto-Setup - Intelligent Elasticsearch configuration
- Environment Management - Directory permissions and structure
๐ Version Control (3 tools)
- Repository Setup - Git/SVN initialization with best practices
- File Tracking - Intelligent commit with change detection
- History Access - Retrieve any previous version of files
- Multi-VCS - Support for both Git and SVN workflows
๐ฌ Example Prompts to Try
Once everything is set up, try asking your AI:
Knowledge Discovery:
"Search all indexed documents for information about user authentication and summarize the key points"
Document Creation:
"Create a new API documentation template and index it with proper categorization"
File Management:
"Find all configuration files in the project and create a backup in the configs directory"
Version Control:
"Setup version control for this knowledge base and commit all current documents with proper organization"
Content Analysis:
"Analyze all markdown files for outdated information and create a list of files that need updates"
Project Documentation:
"Read all README files in subdirectories and create a comprehensive project overview document"
๐๏ธ Architecture
AgentKnowledgeMCP/
โโโ src/
โ โโโ server.py # Main MCP server
โ โโโ config.json # Configuration
โ โโโ config.json.example # Configuration template
โ โโโ tools.py # Tool definitions (28 tools)
โ โโโ elasticsearch_handlers.py # Elasticsearch operations
โ โโโ file_handlers.py # File system operations
โ โโโ admin_handlers.py # Admin operations
โ โโโ version_control_handlers.py # VCS operations
โ โโโ document_schema.py # Document validation
โ โโโ elasticsearch_client.py # ES client management
โ โโโ security.py # Security & validation
โโโ tests/
โ โโโ run_all_tests.py # Test runner
โ โโโ test_file_paths.py # File operations tests
โ โโโ test_validation.py # Document validation tests
โ โโโ test_version_control.py # VCS comprehensive tests
โ โโโ test_simple_vcs.py # VCS demo tests
โ โโโ demo_agent_workflow.py # Complete workflow demo
โ โโโ quick_test.py # Quick functionality check
โ โโโ README.md # Test documentation
โโโ .knowledges/ # Knowledge base storage
โโโ setup.py # Quick setup script
โโโ requirements.txt # Python dependencies
โโโ CHANGELOG.md # Version history
โโโ README.md # This file
graph TD
A[AI Assistant] --> B[MCP Server]
B --> C[Elasticsearch Client]
B --> D[File System Handler]
B --> E[Version Control Handler]
B --> F[Document Validator]
C --> G[Elasticsearch Cluster]
D --> H[Local File System]
E --> I[Git/SVN Repository]
F --> J[Schema Validation]
Modern, Modular Design:
- MCP Protocol - Standard communication with AI assistants
- Elasticsearch Integration - Full-featured search and indexing
- File System Safety - Sandboxed operations with validation
- Version Control - Git/SVN support with intelligent workflows
- Document Validation - Schema enforcement and template generation
๐ Security & Privacy
Enterprise-grade security:
- โ Sandboxed Operations - All file operations restricted to configured directories
- โ Path Validation - Prevent directory traversal and unauthorized access
- โ Access Controls - Configurable permissions and restrictions
- โ Audit Trails - Full logging of operations and changes
- โ No Cloud Dependencies - Everything runs locally
Configuration Example:
{
"security": {
"allowed_base_directory": "/your/safe/directory",
"restrict_file_operations": true,
"log_all_operations": true
}
}
๐ Tool Reference
| Category | Count | Tools |
|---|---|---|
| Elasticsearch | 9 | search, index_document, create_index, get_document, delete_document, list_indices, delete_index, validate_document_schema, create_document_template |
| File System | 11 | read_file, write_file, append_file, delete_file, move_file, copy_file, list_directory, create_directory, delete_directory, file_info, search_files |
| Administration | 5 | get_allowed_directory, set_allowed_directory, reload_config, setup_elasticsearch, elasticsearch_status |
| Version Control | 3 | setup_version_control, commit_file, get_previous_file_version |
Total: 28 tools for comprehensive knowledge management!
๐งช Testing & Validation
Comprehensive test suite included:
# Run all tests
python3 tests/run_all_tests.py
# Individual tests
python3 tests/test_file_paths.py # File operations
python3 tests/test_validation.py # Document validation
python3 tests/test_version_control.py # Version control
python3 tests/test_simple_vcs.py # VCS demo
# Demo workflows
python3 tests/demo_agent_workflow.py # Complete workflow
python3 tests/quick_test.py # Quick check
Quality Assurance:
- โ Unit Tests - All core functionality tested
- โ Integration Tests - End-to-end workflow validation
- โ Error Handling - Comprehensive error scenarios covered
- โ Cross-Platform - Tested on Windows, macOS, Linux
๐ค Contributing
Love to have your help making Elasticsearch MCP Server even better!
Quick Development Setup
git clone https://github.com/yourusername/AgentKnowledgeMCP.git
cd AgentKnowledgeMCP
# Install dependencies
pip install -r requirements.txt
# Run tests
python3 test_file_paths.py
# Start development server
python3 src/server.py
Ways to Contribute
- ๐ Report bugs via GitHub Issues
- ๐ก Suggest features for new tools or capabilities
- ๐ง Add new tools or improve existing ones
- ๐ Improve documentation and examples
- ๐งช Test with different AI assistants and share results
Development Guidelines
- Modular Design - Each tool category in separate handlers
- Comprehensive Testing - Test all new functionality
- Security First - Validate all inputs and file operations
- Cross-Platform - Ensure compatibility across operating systems
๐ฆ Installation Options
โจ Easy Installation with UV (Recommended):
# Install directly from GitHub
uvx --from git+https://github.com/itshare4u/AgentKnowledgeMCP.git agent-knowledge-mcp
# After package is published to PyPI:
uvx agent-knowledge-mcp
๐ง Manual Installation:
git clone https://github.com/itshare4u/AgentKnowledgeMCP.git
cd AgentKnowledgeMCP
python3 -m pip install -e .
๐ Requirements:
- Python 3.8+
- Elasticsearch (optional - server works without it for file operations)
- Git (for version control features)
๐ Publishing to PyPI
For maintainers who want to publish this package:
# Build the package
uv build
# Publish to Test PyPI first
uv publish --repository testpypi --token <your-test-pypi-token>
# Test installation from Test PyPI
uvx --index https://test.pypi.org/simple/ agent-knowledge-mcp
# Publish to main PyPI
uv publish --token <your-pypi-token>
After publishing, users can install with:
uvx agent-knowledge-mcp
๐ License
MIT License - see LICENSE for details.
Ready to supercharge your AI assistant with comprehensive knowledge management? Get started today! ๐
Transform your AI into a powerful knowledge management system with Elasticsearch search, intelligent file operations, and version control - all in one unified MCP server.
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 agent_knowledge_mcp-1.0.2.tar.gz.
File metadata
- Download URL: agent_knowledge_mcp-1.0.2.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c60d253e6df48067f9da3dce7eadfe71e94c0e12f1200b1e6783a1fee099a8cf
|
|
| MD5 |
1003e276ba0b44de156efd011de53346
|
|
| BLAKE2b-256 |
54049247dbd22d14f3c11c30941895d452d54e3f1c90e4d00bd40a05f0181f80
|
File details
Details for the file agent_knowledge_mcp-1.0.2-py3-none-any.whl.
File metadata
- Download URL: agent_knowledge_mcp-1.0.2-py3-none-any.whl
- Upload date:
- Size: 34.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6809c468ad32448b684e65075fecd1e3bf5b5d51f96c4d54b95ca9f6676071ae
|
|
| MD5 |
5f0e5cce819386082b3bc79b1e192d65
|
|
| BLAKE2b-256 |
1d8f7ae43c2bb21020ed566fd38626b3c052892f9eb946247917ace3e5c7b0d5
|