GitHub Stars
0
User Rating
Not Rated
Forks
0
Issues
0
Views
1
Favorites
0
Eagle MCP Server
๐ฏ๐ต ๆฅๆฌ่ช | English
A Modern Context Protocol (MCP) server implementation for Eagle App integration. This server enables AI assistants to interact with your Eagle library through a standardized interface with comprehensive tools and multilingual support.
โจ Features
- ๐๏ธ Modern Architecture: Pure MCP implementation built with mcp-python
- ๐ ๏ธ Comprehensive Tools: 16 high-level tools + 17 direct API tools for complete Eagle operations
- ๐๏ธ Configurable API Access: Toggle between user-friendly and advanced developer tools
- ๐ Multilingual Support: Enhanced Japanese text handling and UTF-8 encoding
- ๐ผ๏ธ Image Processing: Base64 encoding, thumbnail generation, and metadata analysis
- ๐ Cross-platform: Compatible with LM Studio, Claude Desktop, and other MCP clients
- ๐ก๏ธ Robust Error Handling: Comprehensive error handling and logging
- โก High Performance: Async implementation with efficient Eagle API integration
- ๐ Type Safe: Full type annotations with Pydantic validation
๐ Quick Start
Prerequisites
Installation
- Clone the repository:
git clone https://github.com/shingo1228/eagle-mcp-server.git
cd eagle-mcp-server
- Install dependencies:
uv sync
- Start the server:
# Windows
run.bat
# Unix/Linux/macOS
uv run main.py
๐ง Configuration
Environment Variables
Create a .env.local
file for local configuration:
EAGLE_API_URL=http://localhost:41595
EAGLE_API_TIMEOUT=30.0
LOG_LEVEL=INFO
# Tool Configuration
EXPOSE_DIRECT_API_TOOLS=false # Set to true for advanced API access
# Optional: Custom paths
# USER_DATA_DIR=/custom/path/to/data
# CACHE_DIR=/custom/path/to/cache
MCP Client Configuration
Claude Desktop
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"eagle-mcp-server": {
"command": "/path/to/eagle-mcp-server/run.bat",
"env": {
"PYTHONPATH": "/path/to/eagle-mcp-server"
}
}
}
}
LM Studio
Add to your MCP configuration:
{
"mcpServers": {
"eagle-mcp-server": {
"command": "/path/to/eagle-mcp-server/run.bat",
"env": {
"PYTHONPATH": "/path/to/eagle-mcp-server"
}
}
}
}
๐ ๏ธ Available Tools
Core Tools (Always Available)
Tool | Description | Parameters |
---|---|---|
health_check |
Check Eagle API connection status | None |
Folder Management
Tool | Description | Parameters |
---|---|---|
folder_list |
List all folders in Eagle library | None |
folder_search |
Search folders by name | keyword |
folder_info |
Get detailed folder information | folder_id |
folder_create |
Create a new folder | folder_name , parent_id? |
folder_update |
Update folder properties | folder_id , folder_name? , description? |
folder_rename |
Rename a folder | folder_id , new_name |
Item Management
Tool | Description | Parameters |
---|---|---|
item_search |
Search items by keyword | keyword , limit? |
item_info |
Get detailed item information | item_id |
item_by_folder |
Get items in a specific folder | folder_id , limit? |
item_update_tags |
Update item tags | item_id , tags , mode? |
item_update_metadata |
Update item metadata | item_id , annotation? , star? |
item_delete |
Move item to trash | item_id |
Image Processing
Tool | Description | Parameters |
---|---|---|
image_info |
Get image file paths and metadata | item_id |
image_base64 |
Get image as base64 data | item_id , use_thumbnail? |
image_analyze |
Set up image for AI analysis | item_id , analysis_prompt , use_thumbnail? |
thumbnail_path |
Get thumbnail file path | item_id |
Library Management
Tool | Description | Parameters |
---|---|---|
library_info |
Get Eagle library information | None |
Direct API Tools (Advanced)
๐ก Note: Enable with
EXPOSE_DIRECT_API_TOOLS=true
for low-level Eagle API access (17 additional tools)
When enabled, provides direct access to Eagle's REST API endpoints for advanced users and developers.
๐ค AI Integration
System Prompts for AI Assistants
To help AI assistants effectively use Eagle MCP Server, we provide comprehensive system prompts:
- Complete System Prompt - Detailed guide with workflows and best practices
- Concise System Prompt - Quick reference for AI integration
- Japanese System Prompt - ๆฅๆฌ่ช็ใทในใใ ใใญใณใใ
These prompts include:
- 33 tool usage patterns and workflows
- Best practices for efficient operations
- Error handling and user interaction guidelines
- Response format recommendations
- Performance optimization tips
Integration Examples
# Example: AI assistant using Eagle MCP Server
from mcp import ClientSession
# 1. Always start with health check
await session.call_tool("health_check")
# 2. Discover content structure
library = await session.call_tool("library_info")
folders = await session.call_tool("folder_list")
# 3. Search and analyze
items = await session.call_tool("item_search", {"keyword": "design", "limit": 10})
image_data = await session.call_tool("image_base64", {"item_id": "abc123", "use_thumbnail": true})
๐ Project Structure
eagle-mcp-server/
โโโ main.py # Main MCP server implementation
โโโ run.bat # Server startup script (Windows)
โโโ eagle_client.py # Eagle API client
โโโ config.py # Configuration management
โโโ handlers/ # Tool handlers
โ โโโ base.py # Base handler class
โ โโโ folder.py # Folder operations (6 tools)
โ โโโ item.py # Item operations (6 tools)
โ โโโ library.py # Library operations (1 tool)
โ โโโ image.py # Image processing (4 tools)
โ โโโ direct_api.py # Direct API access (17 tools)
โโโ utils/ # Utility functions
โ โโโ __init__.py
โ โโโ encoding.py # Text encoding utilities
โโโ schemas/ # Pydantic schemas
โโโ tests/ # Unit tests
โโโ debug/ # Debug scripts
โโโ docs/ # Documentation
โโโ scripts/ # Setup scripts
๐งช Testing
Run the test suite:
uv run python -m pytest tests/
Run basic functionality test:
# Basic health check
uv run python -c "from eagle_client import EagleClient; import asyncio; asyncio.run(EagleClient().health_check())"
# Test with Direct API tools enabled
EXPOSE_DIRECT_API_TOOLS=true uv run python debug/simple_test.py
# Run comprehensive test
uv run python test_v3.py
๐ Troubleshooting
Common Issues
- Connection refused: Ensure Eagle App is running on the configured port (default: 41595)
- Module not found: Check Python path and virtual environment activation
- Permission denied: Verify file permissions on startup scripts
- Japanese text issues: Ensure UTF-8 encoding is properly configured
- Direct API tools not visible: Set
EXPOSE_DIRECT_API_TOOLS=true
in your environment
See TROUBLESHOOTING.md for detailed solutions.
๐ค 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
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Install development dependencies:
uv sync --extra dev
- Make your changes
- Run tests:
uv run python -m pytest
- Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Related Links
๐ Support
If you encounter any issues or have questions:
- Check the troubleshooting guide
- Search existing issues
- Create a new issue
Note: This project requires Eagle App to be installed and running. Eagle App is a powerful digital asset management application available at eagle.cool.