MO

Moorcheh MCP Server: Embeddings & Gen AI Answers

Integrate Moorcheh Embedding, Vector Store, Search, and Gen AI Answer services via the MCP server for fast, accurate AI-powered search and responses.

Quick Install
npx -y @moorcheh-ai/moorcheh-mcp

Overview

Moorcheh MCP Server implements a Model Context Protocol (MCP) gateway that unifies embeddings, vector storage, semantic search, and generative-answering into a single, MCP-compatible service. It lets applications send standardized requests for text embeddings, vector search, and context-aware generative answers without coupling to a specific model provider or vector database. The server translates MCP-style requests into Moorcheh Embedding, Vector Store, Search, and Gen AI services and returns structured results that are easy to consume by web apps, chatbots, or backend pipelines.

For developers building retrieval-augmented generation (RAG), semantic search, or AI-powered support flows, the Moorcheh MCP Server reduces integration complexity. Instead of wiring multiple SDKs and handling tokenization, chunking, and context assembly yourself, you call the MCP endpoints and the server orchestrates embedding, index lookup, and answer composition for you. This speeds up prototyping and helps maintain consistent behavior across environments.

Features

  • MCP-compatible API surface for embeddings, vector search, and generative answers
  • Unified orchestration of:
    • Embedding generation
    • Vector store upserts and queries
    • Relevance-based search and filtering
    • Gen AI answer generation with retrieved context
  • Pluggable model and vector store configuration (provider-agnostic)
  • Docker-friendly for local development and production deployment
  • JSON-based requests and responses for easy integration with HTTP clients
  • Basic auth / API key support and CORS-aware deployment options

Installation / Configuration

Clone the repo and run with Docker or locally. The examples below are generic — consult the repository for provider-specific adapters and advanced options.

Clone the repository:

git clone https://github.com/moorcheh-ai/moorcheh-mcp.git
cd moorcheh-mcp

Run with Docker (example):

# build image
docker build -t moorcheh-mcp .

# run with environment variables or link to .env
docker run -p 8080:8080 --env-file .env moorcheh-mcp

Simple docker-compose.yml example:

version: "3.8"
services:
  mcp:
    image: moorcheh-mcp:latest
    ports:
      - "8080:8080"
    env_file:
      - .env
    restart: unless-stopped

Environment variables (example .env):

# API / server
MCP_PORT=8080
MCP_API_KEY=your-server-api-key

# Model provider (example)
MODEL_PROVIDER=openai
OPENAI_API_KEY=sk-...

# Vector store config (example)
VECTOR_STORE_TYPE=postgres
VECTOR_STORE_URL=postgresql://user:pass@localhost:5432/vectordb

Run locally (typical Node workflow):

# install dependencies and start (if the project uses Node)
npm install
npm run start

Note: exact install/run commands depend on the repository language and build tools. Check the repo README for platform-specific instructions.

Available Tools / Resources

The server exposes a small set of MCP-oriented capabilities. Typical endpoints and their purpose:

EndpointDescription
POST /mcp/embedGenerate embeddings for text or documents
POST /mcp/upsertUpsert documents into the configured vector store
POST /mcp/searchSemantic search across the vector store (returns nearest neighbors)
POST /mcp/answerRetrieve relevant context and generate a contextualized answer

Example: Generate embeddings

curl -X POST "http://localhost:8080/mcp/embed" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MCP_API_KEY" \
  -d '{"texts":["What is retrieval-augmented generation?"]}'

Example: Semantic search

curl -X POST "http://localhost:8080/mcp/search" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MCP_API_KEY" \
  -d '{
    "query": "how to integrate embeddings",
    "top_k": 5,
    "filters": {"source": "docs"}
  }'

Example: Generate an answer using retrieved context

curl -X POST "http://localhost:8080/mcp/answer" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MCP_API_KEY" \
  -d '{
    "question": "How do I set up the vector store?",
    "search": {"top_k": 4},
    "generation": {"model": "gpt-4o-mini", "temperature": 0.1}
  }'

Responses typically include structured objects: embeddings arrays, search hits with metadata and scores, and answer objects with the generated text plus provenance or source references.

Use Cases

  • Knowledge base search and Q&A
    • Ingest product docs and support articles into the vector store via /mcp/upsert. Use /mcp/answer to let users ask natural language questions and receive answers with cited passages.
  • Customer support bot
    • Front a conversational UI with the MCP server so the bot retrieves top context and uses Gen AI to compose concise responses that reference relevant doc snippets.
  • Semantic code search
    • Index code snippets and docstrings; let developers search semantically to find relevant implementations or examples.
  • Enterprise search and recommendation
    • Combine embeddings with metadata filters to deliver personalized search results or suggest related content.
  • RAG pipelines in microservices
    • Use MCP as a single internal service that standardizes embed/search/generation calls across teams and reduces duplicated integration work.

Tips and Troubleshooting

  • Verify model provider keys and vector store connectivity in your .env before starting the server.
  • If search results are low quality, tune embedding model or increase top_k and apply stricter filters.
  • Monitor latency: embedding and generation calls depend on external model providers; consider batching or caching embeddings for heavy workloads.
  • Secure the server in production: enable API keys, TLS, and network-level restrictions.

Repository and source code: https://github.com/moorcheh-ai/moorcheh-mcp

For advanced configuration, multi-tenant setups, and provider adapters, refer to the repository documentation and example configs.