Skip to content

Commit defff9c

Browse files
committed
Update Sophia MCP documentation and configuration examples
1 parent 5566f21 commit defff9c

2 files changed

Lines changed: 77 additions & 40 deletions

File tree

docs/cloud/sophia/administrator-guide.adoc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ The JWT token value is displayed *only once* after creation — copy it immediat
297297

298298
For each token, the admin panel can generate ready-to-paste MCP configuration snippets for:
299299

300-
- *Claude Desktop* — uses `npx mcp-remote` with `Authorization: Bearer` header
301-
- *Cursor / VS Code* — uses SSE format with headers object
300+
- *Claude Desktop* — SSE format with `Authorization: Bearer` header
301+
- *Cursor / VS Code* — SSE format with headers object
302302

303303
image::../../../images/sophia/token-mcp-config.png[MCP config]
304304

@@ -309,12 +309,11 @@ Example generated configuration for Claude Desktop:
309309
{
310310
"mcpServers": {
311311
"sophia": {
312-
"command": "npx",
313-
"args": [
314-
"mcp-remote",
315-
"https://sophia-api.restheart.com/mcp/restheart/",
316-
"--header", "Authorization: Bearer <token>"
317-
]
312+
"type": "sse",
313+
"url": "https://sophia-api.restheart.com/mcp/restheart/",
314+
"headers": {
315+
"Authorization": "Bearer <token>"
316+
}
318317
}
319318
}
320319
}

docs/cloud/sophia/mcp.adoc

Lines changed: 70 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,26 @@ menu: sophia
66
applies_to: both
77
---
88

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.
1010

11-
Connect any link:https://modelcontextprotocol.io[MCP-compatible] AI client to your RESTHeart knowledge base in minutes.
11+
== What the MCP Server Exposes
1212

13-
=== Public MCP Contexts
13+
Sophia organises its knowledge into *Contexts*. Each context defines an isolated knowledge domain with its own:
1414

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:
1629

1730
[cols="1,2,2", options="header"]
1831
|===
@@ -21,84 +34,109 @@ Sophia exposes two public MCP contexts — no account or token required:
2134
| `cloud` | `https://sophia-api.restheart.com/mcp/cloud/` | RESTHeart Cloud managed service docs
2235
|===
2336

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`:
2540

2641
[source,json]
2742
----
2843
{
2944
"mcpServers": {
3045
"sophia-restheart": {
31-
"command": "npx",
32-
"args": ["mcp-remote", "https://sophia-api.restheart.com/mcp/restheart/"]
46+
"type": "sse",
47+
"url": "https://sophia-api.restheart.com/mcp/restheart/"
3348
}
3449
}
3550
}
3651
----
3752

38-
=== Authenticated Access
53+
== Authenticated Access
3954

4055
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.
4156

4257
image::../../../images/sophia/token-mcp-config.png[MCP config generation]
4358

4459
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:
4560

46-
`https://sophia-api.restheart.com/mcp/<context>/?token=<your-token>`
61+
`https://<your-sophia>/mcp/<context>/?token=<your-token>`
62+
63+
== Configuration Examples
4764

48-
=== Configuration Examples
65+
=== Clients with native HTTP/SSE support
4966

50-
==== 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):
5172

5273
[source,json]
5374
----
5475
{
5576
"mcpServers": {
5677
"sophia": {
57-
"command": "npx",
58-
"args": [
59-
"mcp-remote",
60-
"https://sophia-api.restheart.com/mcp/restheart/",
61-
"--header", "Authorization: Bearer <your-token>"
62-
]
78+
"type": "sse",
79+
"url": "https://<your-sophia>/mcp/<context>/",
80+
"headers": {
81+
"Authorization": "Bearer <your-token>"
82+
}
6383
}
6484
}
6585
}
6686
----
6787

68-
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.
88+
Restart Claude Desktop after editing the file.
7189

72-
==== Cursor / VS Code (SSE transport)
90+
*Cursor* — add to `.cursor/mcp.json`:
7391

7492
[source,json]
7593
----
7694
{
77-
"sophia-restheart": {
95+
"sophia": {
7896
"type": "sse",
79-
"url": "https://sophia-api.restheart.com/mcp/restheart/",
97+
"url": "https://<your-sophia>/mcp/<context>/",
8098
"headers": {
8199
"Authorization": "Bearer <your-token>"
82100
}
83101
}
84102
}
85103
----
86104

87-
==== Claude Code
105+
=== Clients that support stdio only
88106

89-
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.
90108

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.
92110

93-
=== Selecting a Context
111+
*Claude Code* — add to `.mcp.json` in your project root or to the global MCP config:
94112

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.
113+
[source,json]
114+
----
115+
{
116+
"mcpServers": {
117+
"sophia": {
118+
"command": "npx",
119+
"args": ["mcp-remote", "https://<your-sophia>/mcp/<context>/?token=<your-token>"]
120+
}
121+
}
122+
}
123+
----
96124

97-
==== Filtering by Tag
125+
*Zed* — add to `.zed/settings.json`:
98126

99-
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.
127+
[source,json]
128+
----
129+
{
130+
"context_servers": {
131+
"sophia": {
132+
"command": "npx",
133+
"args": ["mcp-remote", "https://<your-sophia>/mcp/<context>/?token=<your-token>"]
134+
}
135+
}
136+
}
137+
----
100138

101-
=== Available Tools
139+
== Available Tools
102140

103141
[cols="1,3", options="header"]
104142
|===
@@ -112,7 +150,7 @@ Within a context, documents are organized by *tags*. Pass the optional `tags` pa
112150
| `sophia_api` | Returns the complete Sophia REST API reference. Requires authentication — reserved for service administrators.
113151
|===
114152

115-
=== Recommended Tool-Chaining Workflow
153+
== Recommended Tool-Chaining Workflow
116154

117155
To maximise the context available to an AI agent:
118156

0 commit comments

Comments
 (0)