MCP Server for FG-CLIP embedding services
Project description
FGCLIP-MCP
MCP (Model Context Protocol) server for FG-CLIP embedding services. To obtain and configure an API key, please apply at https://research.360.cn/sass.
Features
This MCP server provides the following tools and resources:
Tools
- text_embedding: Generate embedding vectors for text
- image_embedding: Generate embedding vectors for images
- cosine_similarity: Compute cosine similarity between two lists of vectors
Use Cases
This MCP server helps users achieve the following capabilities:
- Image Feature Extraction: Convert images into high-dimensional vector representations for machine learning and similarity computation
- Text Feature Extraction: Transform text into semantic vector representations with multi-language support
- Multi-modal Similarity Computation:
- Image-to-Image Similarity: Compare visual similarity between different images
- Image-to-Text Similarity: Enable cross-modal retrieval, such as finding relevant images based on text descriptions
- Text-to-Text Similarity: Calculate semantic similarity between texts
Through these capabilities, users can build powerful search engines, recommendation systems, content classification, and multi-modal AI applications.
Tool Details
text_embedding
Generate embedding vectors for input texts.
Parameters:
texts: A list of text strings to embedmodel: The model to use (default: "fg-clip")
Returns:
saved_uris: A list of URIs where the embeddings are storedsuccess: Whether the operation succeedederror_msg: Error message, if any
image_embedding
Generate embedding vectors for images.
Parameters:
images: A list of image URLs or base64-encoded imagesmodel: The model to use (default: "fg-clip")
Returns:
saved_uris: A list of URIs where the embeddings are storedsuccess: Whether the operation succeedederror_msg: Error message, if any
cosine_similarity
Compute cosine similarity between two lists of vectors.
Parameters:
uris_a: A list of URIs for the first set of embeddingsuris_b: A list of URIs for the second set of embeddingsmode: Calculation mode (default: "pairwise")"pairwise": Compute similarity for vectors at corresponding positions"matrix": Compute a full similarity matrix for all vector pairs
Returns:
similarities: Similarity values or a similarity matrixshape: Shape information of the resultsuccess: Whether the operation succeeded
Dev && Test
git clone https://github.com/360CVGroup/FGCLIP-MCP
cd FGCLIP-MCP
uv venv
uv sync
source .venv/bin/activate
export MCP_API_KEY=your_api_key
pytest -q
MCP Host Configuration
From pypi
{
"mcpServers": {
"fgclip-mcp": {
"command": "uvx",
"args": [
"fgclip-mcp"
],
"env": {
"MCP_API_KEY": "your_api_key"
}
}
}
}
From local
{
"mcpServers": {
"fgclip-mcp-local": {
"command": "uv",
"args": [
"--directory",
"/path_to_fgclip-mcp/src/fgclip_mcp",
"run",
"/path_to_fgclip-mcp/src/fgclip_mcp/__main__.py"
],
"env": {
"MCP_API_KEY": "your_api_key"
}
}
}
}
License
Apache License 2.0
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 fgclip_mcp-0.1.2.tar.gz.
File metadata
- Download URL: fgclip_mcp-0.1.2.tar.gz
- Upload date:
- Size: 97.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12ea5d3053ca6408dac324e2cea5c8ea3870827b011a6118fb096b34c743102d
|
|
| MD5 |
5506cc71aae78be48f5725958a697360
|
|
| BLAKE2b-256 |
bbcecbea2be70f2c2664a79496931129b068e33682307bfd0bc936ec4d17e7cb
|
File details
Details for the file fgclip_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fgclip_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73204f701f6c7ee1e0506ac4cf2f30352381818ab25b5dc75221650155a3eafa
|
|
| MD5 |
debfae87f28c03f4b101bd153317dfdc
|
|
| BLAKE2b-256 |
dc416d466043605187d94ec2eefba9fea8ab744fa3d3e3fabd6a44334c541301
|