You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cloud/sophia/mcp.adoc
+70-32Lines changed: 70 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,26 @@ menu: sophia
6
6
applies_to: both
7
7
---
8
8
9
-
== Sophia MCP Server
9
+
Every Sophia instance exposes an link:https://modelcontextprotocol.io[MCP-compatible] server, allowing any AI client to query its knowledge base directly — without going through the chat UI or the REST API.
10
10
11
-
Connect any link:https://modelcontextprotocol.io[MCP-compatible] AI client to your RESTHeart knowledge base in minutes.
11
+
== What the MCP Server Exposes
12
12
13
-
=== Public MCP Contexts
13
+
Sophia organises its knowledge into *Contexts*. Each context defines an isolated knowledge domain with its own:
14
14
15
-
Sophia exposes two public MCP contexts — no account or token required:
15
+
- *documents* — files ingested into the knowledge base, tagged for access control
16
+
- *system prompt template* — how the AI frames its answers
17
+
- *RAG options* — how many documents to retrieve and inject into the prompt
18
+
- *MCP description* — the text shown to AI clients when they list available tools
19
+
20
+
Each context is accessible at its own MCP endpoint: `<base-url>/mcp/<context-id>/`. When an AI client connects to that endpoint, it can use the Sophia tools to search and retrieve content *scoped to that context only*. A client connected to the `restheart` context cannot read documents that belong to the `cloud` context, and vice versa.
21
+
22
+
Within a context, documents are further organised by *tags*. Pass the optional `tags` parameter to `sophia_search` to narrow retrieval to documents carrying specific tags. Use `sophia_list_tags` to discover which tags are available.
23
+
24
+
For more on contexts, see the link:/docs/cloud/sophia/administrator-guide#_context_management[Administrator Guide].
25
+
26
+
== SoftInstigate Public MCP Servers
27
+
28
+
SoftInstigate runs two public Sophia instances as live examples — no account or token required:
16
29
17
30
[cols="1,2,2", options="header"]
18
31
|===
@@ -21,84 +34,109 @@ Sophia exposes two public MCP contexts — no account or token required:
21
34
| `cloud` | `https://sophia-api.restheart.com/mcp/cloud/` | RESTHeart Cloud managed service docs
22
35
|===
23
36
24
-
To connect immediately with Claude Desktop, add this to `claude_desktop_config.json`:
37
+
These are fully functional Sophia deployments managed by SoftInstigate. You can use them directly in your AI client or as a reference when setting up your own instance via link:/docs/cloud[RESTHeart Cloud].
38
+
39
+
To connect immediately with Claude Desktop, open *Settings → Connectors → Add custom connector* and paste the URL. Or add this to `claude_desktop_config.json`:
Private knowledge bases require an API token. Issue one from the admin panel (see link:/docs/cloud/sophia/administrator-guide#_api_token_management[API Token Management]). The admin panel generates ready-to-paste MCP configuration snippets for each token.
The token can be passed as an `Authorization: Bearer <token>` header or, for clients that do not support custom headers, as a `?token=<jwt>` query parameter:
==== Claude Desktop (authenticated via config file)
67
+
Clients that connect directly over HTTP (Claude Desktop, Cursor) use the context URL with an optional `Authorization` header.
68
+
69
+
*Claude Desktop* — the easiest way is via the UI: open *Settings → Connectors → Add custom connector* and paste the context URL. For private contexts, Claude Desktop will prompt for OAuth client credentials, which Sophia supports natively.
70
+
71
+
To configure via `claude_desktop_config.json` (`~/Library/Application Support/Claude/` on macOS, `%APPDATA%\Claude\` on Windows):
Add the snippet under `mcpServers` in `claude_desktop_config.json` (`~/Library/Application Support/Claude/` on macOS, `%APPDATA%\Claude\` on Windows), then restart.
69
-
70
-
When configuring via the Claude Desktop UI, custom headers are not available — use OAuth client credentials instead, which Sophia supports natively.
Add to your project's `.mcp.json` or global MCP config.
107
+
Some clients (Claude Code, Zed, VS Code) spawn MCP servers as local processes and communicate over stdio. Use link:https://www.npmjs.com/package/mcp-remote[`mcp-remote`] as a bridge — it connects to the HTTP endpoint and exposes it as a stdio process. It requires link:https://nodejs.org[Node.js >= 18] and is downloaded automatically by `npx` on first run.
90
108
91
-
The snippets above use link:https://www.npmjs.com/package/mcp-remote[`mcp-remote`], a small Node.js bridge that exposes the HTTP endpoint as a local `stdio` process — the format most clients expect. It requires link:https://nodejs.org[Node.js >= 18] and is downloaded automatically by `npx` on first run.
109
+
For authenticated access with stdio clients, pass the token via the `?token=` query parameter since stdio bridges typically do not support injecting headers.
92
110
93
-
=== Selecting a Context
111
+
*Claude Code* — add to `.mcp.json` in your project root or to the global MCP config:
94
112
95
-
Each context has its own URL path. Contexts define the knowledge base scope, prompt template, and RAG options. Use the admin panel to create and manage additional contexts.
Within a context, documents are organized by *tags*. Pass the optional `tags` parameter to the `sophia_search` tool to narrow retrieval to documents that carry the specified tags. Use `sophia_list_tags` to discover which tags are available.
0 commit comments