Connect agents outside a desktop client
Give cloud-hosted agents and personal agents the same Orcha workspace that your desktop tools use, over MCP or the REST API.
Native memory and project files such as CLAUDE.md stay inside one client.
Claude Code reads CLAUDE.md from the repository where it runs. The built-in
memory of an assistant stays with the account of that assistant.
Other agents do not have these files or this memory. Examples are an agent that you build with the Claude API, an agent on a server schedule, an agent in a workflow tool, and an agent that you message over text. At the start of each run, such an agent does not know your decisions, conventions, or source documents. It knows them only if you send them.
Orcha gives this knowledge through one endpoint that all runtimes can call. The agent reads the same workspace that you use in the web app and in Claude Code. It has the permissions of the token or OAuth grant that you give it.
Each search_context result has a citation, a document updatedAt, and line
anchors. Thus, the agent can tell where an answer came from and how current
it is. A folder-scoped, read-only token limits a cloud agent to the part of
the workspace that it needs.
This guide shows six runtimes. At the end of each section, a check confirms that the agent gets a result with a citation.
Prerequisites
- A workspace with content. First, add files, import a vault, or connect a source. Refer to the quickstart and Connect a source.
- A credential. Most runtimes in this guide run without a person at a
browser. Thus, they use an API token from the API Tokens page. The token
starts with
orca_. It is bound to the workspace that you viewed when you created it. Orcha shows the token only one time. Runtimes that run the MCP OAuth flow can use a consent-screen grant instead. In this guide, OpenClaw is such a runtime. On the consent screen, you select the workspace and the permissions. - The narrowest scope that works. For an agent that only answers
questions, give
readonly. Addwriteonly if the agent must create files, records, or memories. To keep the agent in one part of the workspace, limit the token to specified folders. Folder-scoped tokens exclude root-level files and root-level databases. They cannot use the connected-source tools (query_source,fetch_source_document,list_source_documents). Refer to Tokens and scoping. - A secret store. Put the token in an environment variable or in the
secret manager of your platform. The examples read the token from
ORCHA_TOKEN.
Two endpoints give access to the same workspace:
| Interface | Endpoint | Auth header |
|---|---|---|
| MCP (Streamable HTTP) | https://app.tryorcha.com/mcp | Authorization: Bearer orca_... |
| REST search | POST https://app.tryorcha.com/api/v1/search_context | Authorization: Bearer orca_... |
If the runtime has an MCP client, use MCP. If the runtime can only send HTTP requests, use REST.
Claude Messages API (MCP connector)
For a cloud agent, the MCP connector is the shortest method. The Anthropic servers open the MCP connection to Orcha. Thus, your code makes one API call and does not run an MCP client. The connector supports only MCP tool calls. All Orcha tools are MCP tool calls.
- Install the Anthropic SDK with
pip install anthropic. - Export your Anthropic API key as
ANTHROPIC_API_KEY. - Export your Orcha token as
ORCHA_TOKEN. - Run the script below.
The request must have both parts. Each server in mcp_servers must have
exactly one mcp_toolset entry in tools with the same mcp_server_name.
If it does not, the request fails validation. The connector sends
authorization_token to Orcha as a bearer token. Orcha accepts an orca_
token in this field.
You can give the agent only the read tools that it needs. To do this, disable all tools by default and enable each tool by its name:
Verify: The output contains a tool call: search_context line. The
mcp_tool_result content includes a citation for each result. If the model
answers without a tool call, add "Use the Orcha tools" to the prompt.
Claude Agent SDK
The Agent SDK runs the Claude Code agent loop in your own process or
container. Give Orcha as a remote HTTP server in the mcpServers option
(mcp_servers in Python). The SDK does not open a browser and does not run
an interactive OAuth flow. Thus, send the token in headers.
The agent can call MCP tools only after you give explicit permission. To
allow the Orcha tools, use the mcp__orcha__* wildcard. The permissions of
the token still set the limit for each call.
TypeScript
- Install the SDK with
npm install @anthropic-ai/claude-agent-sdk. - Export
ORCHA_TOKENand your Anthropic credentials. - Run the script below.
Python
- Install the SDK with
pip install claude-agent-sdk. - Export
ORCHA_TOKENand your Anthropic credentials. - Run the script below.
Use "type": "http" for Orcha. Orcha supports only Streamable HTTP. The
legacy SSE paths return 410 Gone.
Verify: The MCP servers: line shows orcha with the status
connected. The status can also be pending when the SDK has a cached tool
list. The final result gives the names of the documents that the agent used.
If the status is failed or needs-auth, do not trust the answer. Examine
the token first. When a server is not available, the agent can use its
built-in tools instead.
Claude Managed Agents
Managed Agents run the agent loop and a sandbox for each session on the Anthropic infrastructure. They support remote MCP servers. The configuration has two parts:
- The agent declares the Orcha server without credentials.
- A vault keeps the token and supplies it when a session starts.
The token does not go into the sandbox.
- Create a vault for the credentials of the agent.
- Add the Orcha token to the vault as a
static_bearercredential. Itsmcp_server_urlmust be the same as the server URL on the agent. - Create an environment. With
limitednetworking, setallow_mcp_serverstotrue. If you do not, session creation fails with a 400. - Create the agent with Orcha in
mcp_serversand a matchingmcp_toolset. - Start a session with the vault in
vault_ids. - Send a message.
- Read the event stream.
By default, an MCP toolset uses the always_ask permission policy. With this
policy, the session stops before each Orcha call until you approve the call.
The example sets always_allow because the token is read-only.
If you give the agent a token with write or delete, keep always_ask for
the write tools. Alternatively, use the auto policy.
Verify: The stream prints an Orcha tool call: line for a
search_context call. Then it prints an answer that gives the names of its
sources.
If Orcha rejects the credential, the session still starts. It then sends a
session.error event with mcp_authentication_failed_error. Make sure that
the mcp_server_url of the vault credential is exactly
https://app.tryorcha.com/mcp.
n8n
n8n agents connect to MCP servers through the MCP Client Tool node. You attach this node to an AI Agent node as a tool.
- Open the workflow that contains your AI Agent node.
- From the nodes panel, add an MCP Client Tool node.
- Connect the node to the tool input of the agent.
- Set Server Transport to HTTP Streamable.
- Set Endpoint to
https://app.tryorcha.com/mcp. - Set Authentication to Bearer Auth.
- Create a Bearer Auth credential with your
orca_token as the value. - Set Tools to Include to Selected.
- Select
get_workspace_overview,search_context, andget_file.
The node can show one SSE Endpoint field and no Server Transport option. In this condition, the workflow uses version 1 of the node, which supports only SSE. Orcha has no SSE transport. To get the current version, delete the node and add it again from the nodes panel.
If an MCP client is not available, call the REST endpoint from an HTTP Request node. Use these settings:
- Method:
POST. - URL:
https://app.tryorcha.com/api/v1/search_context. - Authentication: Bearer Auth with the same token.
- Body: JSON, for example
{"query": "deployment requirements", "limit": 5}.
Verify: Run the workflow with the message "Search Orcha for our
deployment requirements and cite each source." In the execution log, the MCP
Client Tool node shows a search_context call. Its output includes a
citation for each result.
Manus
Manus connects to remote MCP servers as custom connectors.
- In Manus, open Settings.
- Open Integrations.
- Open Custom MCP Servers.
- Click Add Server.
- Type
Orchaas the server name. - Type
https://app.tryorcha.com/mcpas the server URL. - Type your
orca_token as the bearer token. - Save the server. Manus then tests the connection.
Manus also shows a Connectors screen with Add MCP by URL. Both screens use the same URL.
Verify: After the connection test, Manus shows the list of Orcha tools.
Ask "Search Orcha for our deployment requirements and cite each source."
Make sure that the task log shows a search_context call.
OpenClaw
OpenClaw is a self-hosted personal agent. It keeps MCP server definitions
under mcp.servers in its configuration. It supports Streamable HTTP and the
MCP OAuth flow, and Orcha supports both. The OAuth grant uses the workspace
and the permissions that you select on the Orcha consent screen.
Stop the local Gateway before you start. The add and login commands do
not work while the Gateway runs.
-
Stop the local Gateway.
-
Add the Orcha server:
-
Run
openclaw mcp login orcha. -
Open the authorization URL that the command prints.
-
On the Orcha consent screen, select the workspace.
-
Give
read. -
Run
openclaw mcp doctor orcha --probe. This command confirms the connection and shows the list of tools. -
Start the Gateway again.
To give access to only some tools, add --include 'get_workspace_overview,search_context,get_file'
to the add command. Alternatively, set toolFilter.include on the server
in the configuration.
Verify: doctor --probe shows the Orcha tools. Then ask your agent
"Search Orcha for our deployment requirements and cite each source." Make
sure that the reply gives the names of the source documents.
Meta Muse
Muse is the personal agent from Meta. It runs on its own cloud computer, so it can connect to the hosted Orcha endpoint.
Meta documents a Custom Connector for services that are not in the Muse connector list. You tell Muse to create one. Muse keeps the credential in its secure credential store. The Meta documentation does not give the protocol of a custom connector. Thus, these steps give Muse both the MCP endpoint and the REST endpoint.
- Create an Orcha token with
readonly. - Limit the token to the folders that Muse needs.
- In a Muse chat, tell Muse to create a custom connector for Orcha.
- Give Muse the MCP endpoint
https://app.tryorcha.com/mcp. - Give Muse the header
Authorization: Bearer orca_...with your token. - If Muse asks for an API instead, give it
POST https://app.tryorcha.com/api/v1/search_context. Use the same header and a JSON body that containsquery.
Meta does not review custom connectors. A read-only, folder-scoped token keeps the access of Muse small. You can revoke the token at any time on the API Tokens page.
Verify: Ask Muse "Search Orcha for our deployment requirements and tell me which documents you used." The answer gives the names of Orcha documents. On the Orcha API Tokens page, the Last used date of the token is today.
What the agent can and cannot do
The token or grant sets what an agent can do. The runtime does not change this.
-
Read. With
read, the agent can search, browse, and read these items: files, folders, databases, memories, and indexed connected-source documents. Tell an agent that does not know the workspace to start withget_workspace_overview. Then tell it to usesearch_context. -
Connected sources are read-only. Orcha indexes them from the provider. An agent can query and fetch them, but it cannot change them. Synced documents are not files.
query_sourceandfetch_source_documentneed a workspace-wide token. Live fetches count against the daily provider budget of the connection. -
Memories. With
write, the agent can create a memory withcreate_memory. It can change a memory withupdate_memory. To remove a member, the agent also needsdelete. Folder-scoped grants can add only files, folders, and databases in their scope. They can never add connected-source documents. -
Files and records. With
write, the agent can create and update files, folders, and database records. Withdelete, it can move them to trash. -
Rate limits. Each MCP tool call and each
/api/v1request counts against windows for each token. The windows are one minute, one hour, and one day. The limits per minute are:- 600 requests on Free.
- 1,200 requests on Starter.
- 2,400 requests on Studio and Team.
- 6,000 requests on Pro and Business.
Protocol traffic, such as
initializeandtools/list, does not count. When a window has no requests left, Orcha returns429with aRetry-Afterheader. Refer to Rate limits. -
Feedback. All agents with
readcan callsubmit_feedback. This tool reports missing or old context to the workspace maintainers.
Troubleshooting
Orcha supplies a troubleshooting usage guide. It gives information about
empty results, scope errors, and feedback. To read it, a connected agent
calls the get_usage_guide tool with topic set to troubleshooting. The
MCP reference gives the list of error
types.
| Symptom | Likely cause |
|---|---|
Unauthorized or HTTP 401 | The token is missing, has an error, or was deleted. Create a new token. Orcha cannot show a token again. |
Forbidden on one tool | The token does not have the permission, or the resource is outside its folder scope. |
403 before a tool runs | The client sent an Origin header that Orcha does not allow. Server-side runtimes usually do not send this header. |
410 Gone | The client uses the removed SSE transport. Change the client to Streamable HTTP at /mcp. |
429 | A rate-limit window has no requests left. Wait for the number of seconds in Retry-After. |
| Results are empty | Orcha possibly did not index the content yet. Or the scope of the token excludes the content. Read the coverage notes in the search_context response. |
If the problem continues, refer to Support.