roshan-baaz-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@roshan-baaz-mcpsemantic search for Persian documents about technology"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
roshan-baaz-mcp
A self-hostable Model Context Protocol server for Roshan AI's Baaz (باز) Persian semantic-search service.
Built from the public API documentation at docs.roshan-ai.ir. Unofficial community integration.
What is this?
Baaz (باز) is Roshan AI's Persian-native semantic search and retrieval service. You give it documents; it chunks them, computes embeddings, and stores them across an Elasticsearch + Weaviate backend. You can then run semantic queries, find similar documents, check document status, fetch full documents, and manage indices — all tuned for Persian (فارسی) content.
roshan-baaz-mcp wraps that HTTP API as MCP tools so Claude — or any
MCP-compatible client — can call Baaz as first-class tools.
Baaz is self-hostable, and a single deployment is rarely enough: teams run
many independent Baaz instances (per region, per tenant, per environment).
This server treats named instances as a core concept — one MCP process can
route every tool call to the right Baaz deployment via an optional instance
argument.
Highlights
100% endpoint coverage — every documented Baaz endpoint is a tool.
Multi-instance / self-hosting first — route by
instance; tokens are never exposed bylist_instances.Guardrails — http(s) URL validation, ~10MB body cap, pagination clamps, and token redaction in every error path.
Offline docs tool —
roshan_baaz_docsdescribes the service and tools without any network call.
Related MCP server: rag-mcp-server
Tool reference
Every tool accepts an optional instance: str | None selecting which configured
Baaz deployment to call (defaults to default_instance).
Tool | Method & endpoint | Purpose |
|
| Index/update a batch of documents (chunked + embedded). |
|
| Semantic query → ranked documents with matching chunks. |
|
| Check whether documents (by URL) already exist. |
|
| Delete an entire index and all its documents. |
|
| Delete only documents of one |
|
| Index statistics keyed by |
|
| Find documents similar to a given |
|
| Fetch a full document by id. |
|
| Check that an instance is up and ready. |
| (local) | List configured instances — names + base URLs only, never tokens. |
| (local) | Offline docs about Baaz and these tools. |
See the Baaz API guide for full request/response field semantics.
Install
Requires Python 3.10+ (developed and tested on 3.11).
git clone https://github.com/roshan-research/roshan-baaz-mcp.git
cd roshan-baaz-mcp
python -m venv .venv && source .venv/bin/activate
pip install -e . # add ".[dev]" for the test/lint toolchainRun it (stdio transport by default):
python -m roshan_baaz_mcp # or: roshan-baaz-mcp
python -m roshan_baaz_mcp --help # transports, host/port, log levelConfiguration (multi-instance)
Configuration is read from environment variables via pydantic-settings.
Shorthand (single instance)
The fastest way to point at one Baaz deployment. This synthesizes an instance
named default:
Variable | Default | Description |
|
| Base URL of the Baaz deployment. |
| (none) | Token sent as |
export ROSHAN_BAAZ_BASE_URL=https://baaz.roshan-ai.ir
export ROSHAN_BAAZ_TOKEN=your-secret-tokenNested (one or many named instances)
Prefix ROSHAN_BAAZ__, nested delimiter __. Each instance under
INSTANCES__<NAME>__:
Variable | Default | Description |
|
| Base URL of that instance. |
| (none) | Auth token for that instance. |
|
| Verify the TLS certificate. |
|
| Per-request timeout (seconds). |
|
| Instance used when a tool omits |
|
| Logging level. |
# Two self-hosted regions behind one MCP server
export ROSHAN_BAAZ__INSTANCES__TEHRAN__BASE_URL=https://baaz.tehran.example.ir
export ROSHAN_BAAZ__INSTANCES__TEHRAN__TOKEN=tehran-token
export ROSHAN_BAAZ__INSTANCES__MASHHAD__BASE_URL=https://baaz.mashhad.example.ir
export ROSHAN_BAAZ__INSTANCES__MASHHAD__TOKEN=mashhad-token
export ROSHAN_BAAZ__DEFAULT_INSTANCE=tehranTools then target a deployment with instance="mashhad"; omit it to use the
default. Call list_instances to discover configured names (tokens are never
returned).
Use with an MCP client
Add the server to your MCP client (e.g. Claude Desktop) config:
{
"mcpServers": {
"roshan-baaz": {
"command": "python",
"args": ["-m", "roshan_baaz_mcp"],
"env": {
"ROSHAN_BAAZ_BASE_URL": "https://baaz.roshan-ai.ir",
"ROSHAN_BAAZ_TOKEN": "your-secret-token"
}
}
}
}Architecture
The MCP client talks to roshan-baaz-mcp over a transport (stdio by default).
The server resolves the requested instance, applies guardrails, and calls the
Baaz HTTP API.

Request flow
A typical retrieval session: index documents, run a semantic query, read the ranked results, then optionally expand with similar documents.

Self-hosting & scaling
Because Baaz is self-hosted, one MCP process can front many Baaz deployments,
routing each tool call by its instance argument (region / tenant / environment).

Scaling notes:
Stateless — the server holds no per-request state; run as many replicas as you need behind your scheduler. Configuration comes entirely from the environment.
One process, many instances — add instances by setting more
ROSHAN_BAAZ__INSTANCES__<NAME>__*variables; no code changes.Rate limits — Baaz limits to ~100 requests/minute per deployment; spread heavy load across instances and back off on
429.Body cap — requests are capped at ~10MB (enforced client-side before the call); batch large indexing jobs accordingly.
Horizontal autoscaling — a Kubernetes HPA manifest and Helm chart ship in
deploy/.
Deployment
Ready-to-use manifests live in deploy/:
Docker —
Dockerfileand a two-instancedocker-compose.yml.Kubernetes — raw manifests in
deploy/kubernetes/(namespace, configmap, secret, deployment, service, ingress, hpa, kustomization).Helm — chart in
deploy/helm/roshan-baaz-mcp/.Terraform — example in
deploy/terraform/.
See deploy/README.md for details.
Testing
pip install -e ".[dev]"
python -m pytest -q # all HTTP is mocked with respx; no network
ruff check src testsOptional live tests run against a real Baaz deployment when you opt in:
export ROSHAN_BAAZ_LIVE=1
export ROSHAN_BAAZ_BASE_URL=https://baaz.roshan-ai.ir
export ROSHAN_BAAZ_TOKEN=your-secret-token
python -m pytest tests/live -qThere is also a no-network smoke test that asserts every tool has a non-empty
description and an instance parameter:
python scripts/smoke_test.pyExamples
examples/inspect_server.py prints the
registered tools and their schemas without any network call. See
examples/README.md.
License
MIT. Baaz (باز) and Roshan AI are products/trademarks of Roshan AI; this is an unofficial, community-maintained integration built from public docs.
This server cannot be deployed
Maintenance
Related MCP Connectors
Agent-driven search: build, import, tune, search, and score result quality — all over MCP.
Verified business OSS MCP for search, RSS, crawling, documents, browser, media and transcription.
Make your knowledge agent-ready. One MCP endpoint, 5 connectors, 3 search modes.
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceExposes Elasticsearch semantic search capabilities as MCP tools, enabling ELSER, kNN, and hybrid search with automatic index setup.MIT
- FlicenseNot gradedqualityCmaintenanceEnables hybrid vector and keyword search over Azure AI Search indexes via an MCP tool, supporting query with embedding generation.-
- AlicenseNot gradedqualityAmaintenanceProvides MCP tools for semantic search over personal knowledge sources using pluggable embeddings and local vector indexing.1MIT
- AlicenseAqualityBmaintenanceProvides managed Apache Solr search as MCP tools, enabling hybrid retrieval, server-side GPU embeddings, document indexing, and grounded RAG answers without managing infrastructure.381061 PyPIMIT