Skip to content

Commit 7764632

Browse files
committed
Simplify Sophia MCP documentation and configuration examples
1 parent 93d40be commit 7764632

1 file changed

Lines changed: 41 additions & 76 deletions

File tree

docs/cloud/sophia/mcp.adoc

Lines changed: 41 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -29,110 +29,94 @@ SoftInstigate runs two public Sophia instances as live examples — no account o
2929

3030
[cols="1,2,2", options="header"]
3131
|===
32-
| Context | Endpoint | Knowledge base
32+
| Context | Url | Knowledge base
3333
| `restheart` | `https://sophia-api.restheart.com/mcp/restheart/` | RESTHeart documentation, plugin API, configuration guides
3434
| `cloud` | `https://sophia-api.restheart.com/mcp/cloud/` | RESTHeart Cloud managed service docs
3535
|===
3636

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].
37+
These are fully functional Sophia deployments managed by SoftInstigate. You can use them directly in your AI client.
3838

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`:
39+
To connect immediately with Claude Desktop, open *Settings → Connectors → Add custom connector* and paste the URL.
4040

41-
[source,json]
42-
----
43-
{
44-
"mcpServers": {
45-
"sophia-restheart": {
46-
"type": "sse",
47-
"url": "https://sophia-api.restheart.com/mcp/restheart/"
48-
}
49-
}
50-
}
51-
----
52-
53-
== Authenticated Access
54-
55-
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.
56-
57-
image::../../../images/sophia/token-mcp-config.png[MCP config generation]
58-
59-
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:
41+
== Public contexts
6042

61-
`https://<your-sophia>/mcp/<context>/?token=<your-token>`
43+
No authentication required — just the URL.
6244

63-
== Configuration Examples
45+
=== Claude Desktop
6446

65-
=== Clients with native HTTP/SSE support
47+
Open *Settings → Connectors → Add custom connector* and paste the URL.
6648

67-
Clients that connect directly over HTTP (Claude Desktop, Cursor) use the context URL with an optional `Authorization` header.
49+
=== Clients with native Streamable HTTP support
6850

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):
51+
Add this to the MCP settings:
7252

7353
[source,json]
7454
----
7555
{
76-
"mcpServers": {
77-
"sophia": {
78-
"type": "sse",
79-
"url": "https://<your-sophia>/mcp/<context>/",
80-
"headers": {
81-
"Authorization": "Bearer <your-token>"
82-
}
83-
}
56+
"sophia": {
57+
"type": "http",
58+
"url": "https://<your-sophia>/mcp/<context>/"
8459
}
8560
}
8661
----
8762

88-
Restart Claude Desktop after editing the file.
63+
=== Clients that support stdio only
64+
65+
Some clients (Claude Code, VS Code, Zed) 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 requires link:https://nodejs.org[Node.js >= 18] and is downloaded automatically by `npx` on first run.
8966

90-
*Cursor* — add to `.cursor/mcp.json`:
67+
Example configuration snippet:
9168

9269
[source,json]
9370
----
9471
{
95-
"sophia": {
96-
"type": "sse",
97-
"url": "https://<your-sophia>/mcp/<context>/",
98-
"headers": {
99-
"Authorization": "Bearer <your-token>"
72+
"sophia": {
73+
"command": "npx",
74+
"args": ["mcp-remote", "https://<your-sophia>/mcp/<context>/"]
10075
}
101-
}
10276
}
10377
----
10478

105-
=== Clients that support stdio only
79+
== Private contexts
80+
81+
Private contexts require authentication. Sophia supports two approaches.
82+
83+
=== Via OAuth (recommended for interactive clients)
84+
85+
Claude Desktop supports OAuth natively. Other clients work in similar way.
10686

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.
87+
Open *Settings → Connectors → Add custom connector*, paste the context URL, and set `OAuth Client ID` to `claude_desktop` in the advanced settings. Sophia login page will open in the browser to complete the flow.
10888

109-
For authenticated access with stdio clients, pass the token via the `?token=` query parameter since stdio bridges typically do not support injecting headers.
89+
=== Via API token
11090

111-
*Claude Code* — add to `.mcp.json` in your project root or to the global MCP config:
91+
Issue a token from the admin panel (see link:/docs/cloud/sophia/administrator-guide#_api_token_management[API Token Management]). Pass it as an `Authorization: Bearer` header or, for clients that do not support custom headers, as a `?token=<jwt>` query parameter.
92+
93+
Example configuration snippet:
11294

11395
[source,json]
11496
----
11597
{
116-
"mcpServers": {
117-
"sophia": {
118-
"command": "npx",
119-
"args": ["mcp-remote", "https://<your-sophia>/mcp/<context>/?token=<your-token>"]
98+
"sophia": {
99+
"type": "http",
100+
"url": "https://<your-sophia>/mcp/<context>/",
101+
"headers": {
102+
"Authorization": "Bearer <your-token>"
120103
}
121104
}
122105
}
123106
----
124107

125-
*Zed* — add to `.zed/settings.json`:
108+
For client that supports only the stio transport:
126109

127110
[source,json]
128111
----
129112
{
130-
"context_servers": {
131113
"sophia": {
132114
"command": "npx",
133-
"args": ["mcp-remote", "https://<your-sophia>/mcp/<context>/?token=<your-token>"]
115+
"args": [
116+
"mcp-remote",
117+
"https://<your-sophia>/mcp/<context>/",
118+
"--header", "Authorization: Bearer <your-token>" ]
134119
}
135-
}
136120
}
137121
----
138122

@@ -149,22 +133,3 @@ For authenticated access with stdio clients, pass the token via the `?token=` qu
149133
| `sophia_render_prompt` | Builds a fully interpolated system prompt with RAG context injected, ready to send to any LLM as a `system` + `user` message pair.
150134
| `sophia_api` | Returns the complete Sophia REST API reference. Requires authentication — reserved for service administrators.
151135
|===
152-
153-
== Recommended Tool-Chaining Workflow
154-
155-
To maximise the context available to an AI agent:
156-
157-
. *`sophia_search`* — find relevant chunks; note the `Source:` filename and `Path:` directory in each result.
158-
. *`sophia_get_file`* — retrieve the full file from `Source:` (not just the matched chunk).
159-
. *`sophia_list_files`* with `path=<Path:>` — discover all related files in the same directory.
160-
. *`sophia_get_file`* — retrieve any relevant sibling files.
161-
162-
To explore the knowledge base structure before searching:
163-
164-
[source]
165-
----
166-
sophia_list_paths → top-level directories
167-
sophia_list_paths(path=X) → subdirectories under X
168-
sophia_list_files(path=X) → files in directory X
169-
sophia_list_tags → available tags
170-
----

0 commit comments

Comments
 (0)