← Package Index
mcp-embeddings mcp
v1.0.0 · MCP Tool · ai · registry.pascalai.org
Generate text embeddings using any configured LLM provider via MakerAI (LLM_Embed / LLM_EmbedBatch). Returns dense vector representations suitable for semantic search, clustering and RAG pipelines. Includes cosine similarity and euclidean distance helpers.
embeddings vectors similarity semantic rag
MakerAI Pipeline
pipeline: IPAILLMProvider.Embed / EmbedBatchfunctions: LLM_Embed, LLM_EmbedBatch, CosineSimilarity, EuclideanDistanceresult_type: TPAIEmbeddingResult
Input Parameters
Parameter Type Description
operationrequired
string
'embed': single text; 'embed_batch': multiple texts; 'similarity': cosine similarity between two texts; 'distance': euclidean distance. One of: embed, embed_batch, similarity, distance.
textoptional
string
Text to embed (for 'embed' and one side of 'similarity'/'distance').
textsoptional
array[string]
List of texts for batch embedding.
text_boptional
string
Second text for 'similarity' or 'distance' operations.
modeloptional
string
Embedding model. Examples: 'text-embedding-3-small', 'text-embedding-3-large', 'embed-english-v3.0'. Empty = provider default.
provideroptional
string
One of: openai, cohere, google, ollama, auto. Default: auto.
Output Fields
Field Type Description
operation
string
vector
array[number]
Embedding vector (single embed).
vectors
array[array]
List of embedding vectors (batch).
dimensions
integer
Vector dimensionality.
model
string
tokens_used
integer
similarity
number
Cosine similarity score [-1, 1] (similarity operation).
distance
number
Euclidean distance (distance operation).
Examples
Embed a single text
// Input
{
"operation": "embed",
"text": "The quick brown fox jumps over the lazy dog",
"model": "text-embedding-3-small"
}
// Output
{
"operation": "embed",
"vector": [
0.0234,
-0.1823,
0.0571,
"..."
],
"dimensions": 1536,
"model": "text-embedding-3-small",
"tokens_used": 10
}
Compute semantic similarity between two sentences
// Input
{
"operation": "similarity",
"text": "How do I install Python?",
"text_b": "Python installation guide"
}
// Output
{
"operation": "similarity",
"similarity": 0.923,
"model": "text-embedding-3-small"
}
Install & Discovery
Install
ppm install mcp-embeddings
Get JSON Schema
GET /v1/packages/mcp-embeddings/1.0.0/schema
Discover by keyword
GET /v1/mcp/discover?q=embeddings
Discovery hint: Install with ppm install mcp-embeddings or invoke remotely via POST /v1/invoke/mcp-embeddings on the MCP Service.
PascalAI Usage
uses toolslib;
var Tool := LoadTool('mcp-embeddings');
var R := Tool.Call(JsonObj(['operation','similarity','text','cat','text_b','kitten']));
Writeln(FloatToStr(R['similarity']));