Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,31 +131,27 @@ console.log(response.response);

## 🔌 Model Context Protocol (MCP)

Connect AI assistants like Cursor and Claude Desktop to your OpenRAG knowledge base:
OpenRAG ships a built-in MCP server over **streamable HTTP**, mounted on your instance at `/mcp`. Connect AI assistants like Cursor, Claude Desktop, and IBM Bob to your OpenRAG knowledge base — no subprocess and no separate install. Authenticate with the same OpenRAG API key you use for the REST API, passed via the `X-API-Key` header.

```bash
pip install openrag-mcp
```
> **Note:** The standalone `openrag-mcp` PyPI package is deprecated. Connect your MCP client directly to the `/mcp` endpoint instead.
Comment thread
aimurphy marked this conversation as resolved.
Outdated

**Quick Example (Cursor/Claude Desktop config):**
```json
{
"mcpServers": {
"openrag": {
"command": "uvx",
"args": ["openrag-mcp"],
"env": {
"OPENRAG_URL": "http://localhost:3000",
"OPENRAG_API_KEY": "your_api_key_here"
"url": "http://localhost:3000/mcp",
"headers": {
"X-API-Key": "orag_your_api_key_here"
}
}
}
}
```

The MCP server provides tools for RAG-enhanced chat, semantic search, and settings management.
The MCP server provides tools for RAG-enhanced chat, semantic search, document ingestion, knowledge filters, and settings management.

📖 [Full MCP Documentation](https://pypi.org/project/openrag-mcp/)
📖 [Full MCP Documentation](https://docs.openr.ag/reference/mcp)
Comment thread
aimurphy marked this conversation as resolved.
Outdated

## 🛠️ Development

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/api-sdk-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ slug: /reference/api-sdk-overview

Use the OpenRAG SDKs to interact with OpenRAG programmatically or integrate OpenRAG into an application:

* [OpenRAG MCP Server](https://github.com/langflow-ai/openrag/tree/main/sdks/mcp)
* [MCP server](/reference/mcp) — connect MCP clients to OpenRAG's built-in streamable-HTTP endpoint. The standalone `openrag-mcp` package is deprecated; use the built-in endpoint instead.
Comment thread
aimurphy marked this conversation as resolved.
Outdated
* [Python SDK README](https://github.com/langflow-ai/openrag/tree/main/sdks/python)
* [TypeScript/JavaScript SDK README](https://github.com/langflow-ai/openrag/tree/main/sdks/typescript)

Expand Down
136 changes: 136 additions & 0 deletions docs/docs/reference/mcp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
Comment thread
aimurphy marked this conversation as resolved.
Outdated
title: MCP server
slug: /reference/mcp
---

OpenRAG ships a built-in [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server over **streamable HTTP**, mounted on your OpenRAG instance at `/mcp`.
Any MCP client that supports URL-based server configs — such as [Cursor](https://docs.cursor.com/context/model-context-protocol), [Claude Desktop](https://modelcontextprotocol.io/quickstart/user), and the MCP SDK — can connect directly to this endpoint.
There is no subprocess to spawn and nothing extra to install: your client connects over HTTP using the same OpenRAG API key you use for the REST API.

:::warning Deprecation notice
The standalone `openrag-mcp` PyPI package has been **retired**. It was a separate stdio MCP server that you installed and ran as a subprocess.

OpenRAG now provides MCP support natively through the streamable-HTTP endpoint described on this page. Connect your MCP client directly to your running OpenRAG instance at `/mcp` instead of installing `openrag-mcp`.
:::

## Prerequisites

- A running OpenRAG instance.
- An OpenRAG API key (begins with `orag_`). Create one in **Settings → API Keys**.

## Endpoint URL

The MCP endpoint lives at `/mcp` on your OpenRAG instance. Which host and port you use depends on how OpenRAG is deployed:

| Deployment | MCP URL |
|:-----------|:--------|
| Default Docker deployment | `http://localhost:3000/mcp` |
| Backend run directly (dev, outside Docker) | `http://localhost:8000/mcp` |
| Remote / deployed instance | `https://your-openrag-instance.com/mcp` |

:::note
In the default Docker deployment the backend port (`8000`) is not published to the host. The OpenRAG frontend on port `3000` proxies `/mcp` to the backend and forwards your authentication headers, so **`http://localhost:3000/mcp`** is the correct local URL for a standard install. Use `http://localhost:8000/mcp` only when you run the backend directly without the frontend.
:::

## Authentication with `x-api-key`

Pass your OpenRAG API key on every request using the `X-API-Key` header:

```
X-API-Key: orag_your_api_key_here
```

The `Authorization: Bearer orag_...` header is also accepted as an alternative. The same key works for both the REST API and MCP, and is forwarded transparently to the underlying endpoints.

## Connect a client

Add OpenRAG to your MCP client config using the `url` of your instance and the `X-API-Key` header. The examples below use the default local Docker URL — swap in your own host for a remote instance.

### Cursor

Edit `~/.cursor/mcp.json`:

```json
{
"mcpServers": {
"openrag": {
"url": "http://localhost:3000/mcp",
"headers": {
"X-API-Key": "orag_your_api_key_here"
}
}
}
}
```

Restart Cursor after saving the config.

### Claude Desktop

Edit your `claude_desktop_config.json`:

- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
"mcpServers": {
"openrag": {
"url": "http://localhost:3000/mcp",
"headers": {
"X-API-Key": "orag_your_api_key_here"
}
}
}
}
```

Restart Claude Desktop after editing the file.

### IBM Bob

Add the server to your IBM Bob MCP config, setting `type` to `streamable-http`. For a step-by-step walkthrough, see [MCP integration with IBM Bob](https://www.ibm.com/think/tutorials/mcp-integration-ibm-bob).

```json
{
"mcpServers": {
"openrag": {
"type": "streamable-http",
"url": "http://localhost:3000/mcp",
"headers": {
"x-api-key": "orag_your_api_key_here"
}
}
}
}
```

## Available tools

All tools are auto-exposed from the OpenRAG `/v1/` API and are available immediately after connecting:

| Tool | Description |
|:-----|:------------|
| `openrag_chat` | Send a message and get a RAG-enhanced response. Supports `chat_id` and `filter_id`. |
| `openrag_list_chats` | List all chat conversations. |
| `openrag_get_chat` | Get a specific chat conversation by ID. |
| `openrag_delete_chat` | Delete a chat conversation by ID. |
| `openrag_search` | Semantic search over the knowledge base. Supports filters, score threshold, data sources. |
| `openrag_ingest` | Ingest documents (files, URLs, text) into the knowledge base. Returns a `task_id`. |
| `openrag_get_task_status` | Check the status of an ingestion task by `task_id`. |
| `openrag_delete_document` | Delete a document from the knowledge base by filename. |
| `openrag_get_settings` | Get current OpenRAG configuration (LLM, embeddings, chunk settings, system prompt). |
| `openrag_update_settings` | Update OpenRAG configuration. All fields are optional. |
| `openrag_list_models` | List available models for a provider (`openai`, `anthropic`, `ollama`, `watsonx`). |
| `openrag_create_knowledge_filter` | Create a knowledge filter to scope searches and chats. |
| `openrag_search_knowledge_filters` | Search knowledge filters by name or criteria. |
| `openrag_get_knowledge_filter` | Get a knowledge filter by ID. |
| `openrag_update_knowledge_filter` | Update an existing knowledge filter. |
| `openrag_delete_knowledge_filter` | Delete a knowledge filter by ID. |

## Why streamable HTTP?

- **No subprocess** — your MCP client connects over HTTP; nothing to install or spawn locally.
- **Full tool surface** — document ingestion, task tracking, and knowledge filters are available from day one.
- **One auth model** — the same API key you use for the REST API works for MCP.
- **Self-hosted and secure** — the `/mcp` endpoint is part of your OpenRAG deployment; nothing leaves your network.
5 changes: 5 additions & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ const sidebars = {
id: "reference/api-sdk-overview",
label: "APIs and SDKs",
Comment thread
aimurphy marked this conversation as resolved.
Outdated
},
{
type: "doc",
id: "reference/mcp",
label: "MCP server",
},
Comment thread
aimurphy marked this conversation as resolved.
Outdated
"support/contribute",
"support/troubleshoot",
"support/ibm-elite-support",
Expand Down
54 changes: 25 additions & 29 deletions sdks/mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,29 @@ The OpenRAG backend exposes an MCP endpoint at `/mcp` using the streamable-HTTP
- A running OpenRAG instance (v0.3.0 or later)
- An OpenRAG API key — create one in **Settings → API Keys**

### Which URL to use

The MCP endpoint is `/mcp` on your OpenRAG instance. The host and port depend on how OpenRAG is deployed:

| Deployment | MCP URL |
|:-----------|:--------|
| Default Docker deployment | `http://localhost:3000/mcp` |
| Backend run directly (dev, outside Docker) | `http://localhost:8000/mcp` |
| Remote / deployed instance | `https://your-openrag-instance.com/mcp` |

In the default Docker deployment the backend port (`8000`) is not published to the host; the frontend on port `3000` proxies `/mcp` to the backend and forwards your auth headers, so `http://localhost:3000/mcp` is the correct local URL. The examples below use the local Docker URL — swap in your own host for a remote instance.

---

## Cursor

**Config file:** `~/.cursor/mcp.json`

**Standard API key:**

```json
{
"mcpServers": {
"openrag": {
"url": "https://your-openrag-instance.com/mcp",
"url": "http://localhost:3000/mcp",
"headers": {
"X-API-Key": "orag_your_api_key_here"
}
Expand All @@ -38,22 +48,6 @@ The OpenRAG backend exposes an MCP endpoint at `/mcp` using the streamable-HTTP
}
```

**IBM auth (when `IBM_AUTH_ENABLED=true` on the server):**

```json
{
"mcpServers": {
"openrag": {
"url": "https://your-openrag-instance.com/mcp",
"headers": {
"X-Username": "your_ibm_username",
"X-Api-Key": "your_ibm_api_key"
}
}
}
}
```

Restart Cursor after saving the config.

---
Expand All @@ -63,13 +57,11 @@ Restart Cursor after saving the config.
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

**Standard API key:**

```json
{
"mcpServers": {
"openrag": {
"url": "https://your-openrag-instance.com/mcp",
"url": "http://localhost:3000/mcp",
"headers": {
"X-API-Key": "orag_your_api_key_here"
}
Expand All @@ -78,24 +70,28 @@ Restart Cursor after saving the config.
}
```

**IBM auth:**
Restart Claude Desktop after editing the file.

---

## IBM Bob

Add the server to your IBM Bob MCP config, setting `type` to `streamable-http`. For a step-by-step walkthrough, see [MCP integration with IBM Bob](https://www.ibm.com/think/tutorials/mcp-integration-ibm-bob).

```json
{
"mcpServers": {
"openrag": {
"url": "https://your-openrag-instance.com/mcp",
"type": "streamable-http",
"url": "http://localhost:3000/mcp",
"headers": {
"X-Username": "your_ibm_username",
"X-Api-Key": "your_ibm_api_key"
"x-api-key": "orag_your_api_key_here"
}
}
}
}
```

Restart Claude Desktop after editing the file.

---

## Available tools
Expand Down Expand Up @@ -127,7 +123,7 @@ All tools are auto-exposed from the `/v1/` API and are available immediately aft

- **No subprocess** — your MCP client connects over HTTP; nothing to install or spawn locally.
- **Full tool surface** — document ingestion, task tracking, and knowledge filters are available from day one (previously listed as "coming later" in the stdio package).
- **One auth model** — the same API key or IBM credentials you use for the REST API work for MCP.
- **One auth model** — the same API key you use for the REST API works for MCP.
- **Self-hosted and secure** — the `/mcp` endpoint is part of your OpenRAG deployment; nothing leaves your network.

---
Expand Down
Loading