中文说明 | English README
A Model Context Protocol (MCP) based multimodal AI toolbox that integrates Zhipu GLM and Pollinations.AI platforms with web search capabilities.
- 🖼️ Support for multiple image formats (PNG, JPG, JPEG, GIF)
- 🤖 Integrated with Zhipu GLM-4.5V model for image analysis
- 🔍 Web search capabilities with Perplexity API integration
- 🧠 Advanced search with Sonar models for intelligent answers
- 🛡️ Built-in security mechanisms to prevent malicious content
- ⚡ Smart caching for improved response times on repeated queries
- 🔧 Flexible environment variable configuration with multi-level lookup
- 🚀 Lightweight, easy to integrate and deploy
pnpm installThis project supports multiple ways to set API Keys, in priority order:
-
System Environment Variables (Recommended)
export GLM_API_KEY=your_api_key_here export PERPLEXITY_API_KEY=your_perplexity_api_key_here
-
.env file in execution directory Create
.envfile in the directory where you run the command:GLM_API_KEY=your_api_key_here PERPLEXITY_API_KEY=your_perplexity_api_key_here -
.env file in project directory Create
.envfile in the project root directory
-
Zhipu AI API Key: Please visit Zhipu AI Open Platform to get your API Key.
-
Perplexity API Key: Please visit Perplexity AI to get your API Key. This is required for web search functionality.
For web search functionality, you can also configure the following environment variables:
WEB_SEARCH_CACHE_TTL: Search cache expiration time in minutes (default: 30)WEB_SEARCH_RATE_LIMIT: Request rate limit per window (default: 5)WEB_SEARCH_RATE_WINDOW_MS: Rate limit window in milliseconds (default: 60000)WEB_SEARCH_RETRY_AFTER_MS: Retry wait time in milliseconds after rate limiting (default: 1000)WEB_SEARCH_TIMEOUT_MS: API request timeout in milliseconds (default: 10000)
pnpm devNote: Development mode uses node --loader ts-node/esm to ensure ES module imports work correctly.
pnpm buildpnpm startAfter building, you can use it as an MCP tool in other applications:
./build/index.jsAnalyze image content.
Parameters:
image_path(string): Path to the image fileprompt(string): Analysis prompt text
Example:
{
"image_path": "/path/to/image.png",
"prompt": "Please describe the main content in this image"
}Search the web and return raw search results.
Parameters:
q(string): Search query texttop_k(number, optional): Number of results to return (1-20, default: 10)time_range(string, optional): Time range (any/day/week/month/year, default: any)site(string, optional): Restrict search to specific sitelang(string, optional): Search language (default: en)region(string, optional): Search region (default: US)safe_mode(boolean, optional): Safe search mode (default: true)include_snippets(boolean, optional): Include snippet fragments (default: true)
Example:
{
"q": "latest developments in artificial intelligence",
"top_k": 5,
"time_range": "month",
"lang": "en",
"region": "US"
}Advanced web search with additional options.
Parameters:
q(string): Search query texttop_k(number, optional): Number of results to return (1-20, default: 10)time_range(string, optional): Time range (any/day/week/month/year, default: any)site(string, optional): Restrict search to specific sitelang(string, optional): Search language (default: en)region(string, optional): Search region (default: US)safe_mode(boolean, optional): Safe search mode (default: true)include_snippets(boolean, optional): Include snippet fragments (default: true)operators(array, optional): Search operators (OR/AND)exclude_sites(array, optional): List of sites to excludefrom(string, optional): Start date (YYYY-MM-DD)to(string, optional): End date (YYYY-MM-DD)dedupe(string, optional): Deduplication strategy (none/domain/title, default: none)aggregate(boolean, optional): Aggregate similar resultsengine(string, optional): Search engine (raw_search/sonar_answer)sonar_model(string, optional): Sonar model (sonar/sonar-pro/sonar-reasoning/sonar-reasoning-pro/sonar-deep-research)
Example:
{
"q": "research papers on machine learning",
"top_k": 10,
"time_range": "year",
"exclude_sites": ["example.com", "spam.com"],
"from": "2023-01-01",
"to": "2023-12-31",
"dedupe": "domain",
"engine": "sonar_answer",
"sonar_model": "sonar-reasoning-pro"
}Query SiYuan note databases (tree views/attribute views) using SQLite syntax.
Parameters:
stmt(string): SQL query statement, e.g.: SELECT * FROM blocks WHERE type = 'av' LIMIT 10limit(number, optional): Limit the number of returned resultsoffset(number, optional): Offset for pagination queries
Example:
{
"stmt": "SELECT * FROM blocks WHERE type = 'av'",
"limit": 10
}Advanced Query Example:
{
"stmt": "SELECT b.id, b.content, a.name, a.value FROM blocks b JOIN attributes a ON b.id = a.block_id WHERE b.parent_id = 'database-block-id'",
"limit": 20,
"offset": 0
}ISC
Issues and Pull Requests are welcome!