Orcha
Reference

MCP reference

The Orcha MCP server, its 24 tools, and client configuration.

Orcha provides a Model Context Protocol (MCP) server that allows AI agents to interact with context files and structured databases within a workspace using the standardized MCP protocol.

Endpoint: POST https://app.tryorcha.com/mcp

Transport: Stateless Streamable HTTP. Every request is independently authenticated, so requests can be served safely across restarts and multiple application replicas.

Authentication

There are two ways in.

API token. Include it in the Authorization header:

Authorization: Bearer orca_your_token_here

Tokens must have appropriate permissions for the tools you want to use. Each token is associated with a specific workspace; all operations are scoped to it.

OAuth. Clients that speak the MCP OAuth flow (Claude and ChatGPT connectors, for example) can point at https://app.tryorcha.com/mcp with no token at all. Orcha serves the discovery documents at /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource, and the client sends you to a consent screen where you sign in, pick the workspace the connector runs against, and choose which of read, write, and delete it gets. Granted permissions are capped at your workspace role at consent time and re-checked on every request, so losing a role narrows the connector immediately.

Client configuration

Client-specific walkthroughs: Claude Code, Claude Desktop, Cursor. The generic HTTP configuration is:

{
  "mcpServers": {
    "orcha": {
      "url": "https://app.tryorcha.com/mcp",
      "type": "http",
      "headers": {
        "Authorization": "Bearer orca_your_token_here"
      }
    }
  }
}

File and folder tools

list_files

List all files accessible to the token within the associated workspace.

ArgumentTypeRequiredDescription
folderIdstringNoFilter files by folder ID

Returns: Array of file objects (without content), each including workspaceId. Permission: read

get_file

Get a specific file including its content. For large files, pass fromLine/maxLines to read only the relevant range; search_context results include location.startLine anchors to jump from.

ArgumentTypeRequiredDescription
idstringYesFile ID
fromLineintegerNo1-indexed line to start reading from
maxLinesintegerNoMaximum lines to return from fromLine

Returns: File content. Ranged reads are prefixed with a [lines X-Y of N] header. Permission: read

get_files

Get the contents of multiple files in one call. Prefer this over repeated get_file calls when the needed files are already known.

ArgumentTypeRequiredDescription
idsstring[]YesFile IDs to fetch (1 to 20)
maxBytesintegerNoSkip files larger than this; skipped entries return their size instead of content

Returns: Array of file objects; missing or out-of-scope IDs return an error entry instead of failing the call. Permission: read

create_file

Create a new file in the token's associated workspace.

ArgumentTypeRequiredDescription
namestringYesFile name
contentstringYesFile content
fileTypestringYesOne of: markdown, json, yaml, text
folderIdstringNoParent folder ID

Returns: Created file object with workspaceId. Permission: write

update_file

Update an existing file's content.

ArgumentTypeRequiredDescription
idstringYesFile ID
contentstringYesNew file content

Returns: Updated file object. Permission: write

delete_file

Move a file to trash (soft delete).

ArgumentTypeRequiredDescription
idstringYesFile ID

Returns: Success confirmation. Permission: delete

list_folders

List all folders accessible to the token within the associated workspace.

ArgumentTypeRequiredDescription
parentIdstringNoFilter by parent folder ID

Returns: Array of folder objects, each including workspaceId. Permission: read

create_folder

Create a new folder in the token's associated workspace.

ArgumentTypeRequiredDescription
namestringYesFolder name
parentIdstringNoParent folder ID

Returns: Created folder object with workspaceId. Permission: write

search_files

Search files by name within the token's workspace.

ArgumentTypeRequiredDescription
querystringYesSearch query

Returns: Array of matching file objects with workspaceId. Permission: read

list_source_documents

List read-only documents synced from connected sources (for example GitHub repositories). Source IDs come from get_workspace_overview, whose connectedSources section names each connected source with its document count and sync status. Synced documents are not files; read their content through search_context.

ArgumentTypeRequiredDescription
sourceIdstring (uuid)NoFilter to one connected source
limitintegerNoMax documents to return (default 50, max 200)

Returns: Array of source documents (id, sourceId, title, externalId, mimeType, indexStatus, lastSyncedAt). Permission: read (workspace-wide token; not available to folder-scoped tokens)

Context discovery and bundle tools

Orcha tells connected agents to start with get_workspace_overview when they are unfamiliar with a workspace. The overview includes discoverable bundles and connected sources. Agents can also call list_bundles directly, compare each bundle's useWhen guidance to the current task, and load a matching bundle with get_bundle.

Use bundles for established workflows that need a complete, curated source set. Use search_context for open-ended or ad hoc questions where only the most relevant excerpts are needed.

ToolPermissionPurpose
search_contextreadReturn ranked excerpts for an open-ended query
query_sourcereadQuery exactly one connected source, including live provider search
fetch_source_documentreadFetch one connected-source document's full body, live if not indexed
get_workspace_overviewreadSummarize files, folders, indexing, recent changes, available bundles, and connected sources
list_source_documentsreadList documents synced from a connected source
get_related_filesreadFind files semantically related to a known file
list_bundlesreadDiscover curated bundles, their useWhen guidance, and accessible included files
get_bundlereadRetrieve the complete current contents of a bundle by slug
browse_contextreadExplore the workspace as a read-only virtual filesystem with shell-style commands

search_context

search_context runs hybrid retrieval (PostgreSQL full-text + vector search fused with weighted reciprocal-rank fusion) over every indexed document in the workspace. The query supports websearch syntax: "quoted phrases" and -excluded terms.

ArgumentTypeRequiredDescription
querystringYesNatural-language or keyword query
searchesarrayNo1 to 8 typed sub-queries: lex, vec, or hyde entries with text
strategystringNokeyword, semantic, or hybrid (default) when no searches are given
modestringNofast, balanced (default), or fresh — see below
sourceIdsarrayNoRestrict to these connected sources (IDs from get_workspace_overview)
limitintegerNoMax chunks (default 10, max 50)
minScorenumberNoDrop results scoring below this threshold
tokenBudgetintegerNoApproximate token budget for returned content
explainbooleanNoAttach per-result score traces

Typed sub-queries broaden recall without hijacking the original ask (which always runs at double weight): lex entries carry exact keywords for full-text search, vec entries carry a natural-language restatement for vector search, and hyde entries carry a 30 to 80 word hypothetical answer passage that is embedded in place of the question.

mode controls upstream freshness cost. fast searches retained content only and never contacts a provider. balanced (the default) additionally searches the connected-source catalog — the bounded metadata inventory of objects whose bodies are not persistently indexed — and when a catalog entry decisively matches the ask, fetches up to a few bodies live from the provider, chunked in memory and cited with syncMode: "live". fresh also consults live-mode providers (for example issue trackers) directly. Every live call is metered against the connection's daily provider budget.

The response has two parts: results (cited evidence) and coverage (routing notes: what was fetched live, what the catalog lists but was not fetched, and budget or availability limits). Coverage notes are not evidence and must not be quoted as content.

Each result includes content, score, citation, the owning folder or source context, document updatedAt, and a location with startLine/endLine anchors plus the Markdown headingPath. Follow up with a ranged get_file instead of fetching whole files.

Example bundle retrieval:

{
  "name": "get_bundle",
  "arguments": {
    "slug": "engineering-onboarding"
  }
}

query_source

query_source queries exactly one connected source when the agent intentionally wants that provider rather than the whole workspace. It searches the source's retained content first, then its provider live-search path (for live-mode providers) or its catalog, fetching a small number of best-matching bodies live under the connection's daily provider budget. Folder-scoped tokens cannot use it.

ArgumentTypeRequiredDescription
sourceIdstring (UUID)YesConnected source ID from get_workspace_overview
querystringYesNatural-language or keyword query
limitintegerNoMax chunks (default 5, max 20)

The response mirrors search_context: results with citations plus coverage notes, and providerOperations reporting what the call spent upstream.

fetch_source_document

fetch_source_document returns one connected-source document's full body by sourceId and externalId (found in search_context coverage, list_source_documents, or query_source citations). Retained documents come from the index (origin: "indexed"); catalog-only documents are fetched live from the provider under the daily budget (origin: "live") and are not persisted. Folder-scoped tokens cannot use it.

ArgumentTypeRequiredDescription
sourceIdstring (UUID)YesConnected source ID
externalIdstringYesThe document's stable provider-side external ID

browse_context

browse_context runs a restricted, read-only shell script against a virtual tree of the workspace: /files (files and folders), /bundles (curated bundles with useWhen READMEs), /databases (records rendered as markdown files), and /sources (connected sources with provider citations). A root README.md orients the agent; start with cat /README.md or ls /.

ArgumentTypeRequiredDescription
scriptstringYesScript to run, e.g. rg -i 'rate limit' /files | head -20
cwdstringNoWorking directory for relative paths (default /)

Supported commands: pwd, cd, ls [-l], tree [-L n], find [-name glob] [-type f|d] [-maxdepth n], cat [-n], grep/rg (-i, -n, -l, -r, -F), head/tail [-n N], wc, stat, and help, with | pipelines and ;/&& chaining. The script runs in Orcha's own parser; write-shaped constructs are rejected. Executions are bounded by a scan budget and an output cap, and responses append a citations block for every file whose content was returned. Use stat <path> for entity IDs, deep links, and freshness.

grep/rg patterns use RE2 syntax, which matches in time linear to the input so no pattern can stall a request. Constructs that require backtracking, notably lookahead, lookbehind, and backreferences, are not supported and return an error naming the unsupported construct. Pass -F to match the pattern literally. find -name takes a glob (*, ?), not a regular expression.

Use browse_context for structural exploration (what exists, where things live, exact-string greps) and search_context for ranked semantic retrieval.

{
  "name": "browse_context",
  "arguments": {
    "script": "tree -L 2 /files ; cat /bundles/starter/README.md"
  }
}

Structured database tools

Database tools use stable database, property, and record UUIDs. Record values are objects keyed by property ID, and the API validates each value against its property type.

file_reference properties accept one file UUID or an array when the property enables multiple files. asset_reference properties identify imported binary attachments. Records may also expose a contentFileId page body. Referenced resources must be active and belong to the database workspace. Folder-scoped tokens cannot create out-of-scope file references, and inaccessible file references or page bodies are redacted from database query results.

ToolPermissionPurpose
list_databasesreadList databases in the token workspace with record counts
get_databasereadReturn a database schema, properties, and saved views
query_databasereadSearch, sort, filter, and paginate typed records
create_database_recordwriteCreate a record from a property-ID/value map
update_database_recordwriteMerge typed values into a record and create a version
delete_database_recorddeleteMove a record to trash and remove it from retrieval

Example query:

{
  "name": "query_database",
  "arguments": {
    "databaseId": "11111111-1111-4111-8111-111111111111",
    "search": "launch",
    "sortFieldId": "22222222-2222-4222-8222-222222222222",
    "sortDirection": "asc",
    "limit": 50
  }
}

Example record creation:

{
  "name": "create_database_record",
  "arguments": {
    "databaseId": "11111111-1111-4111-8111-111111111111",
    "values": {
      "22222222-2222-4222-8222-222222222222": "Launch",
      "33333333-3333-4333-8333-333333333333": true
    }
  }
}

Token scoping

Tokens can be scoped to restrict MCP tool access:

Scope typeBehavior
allTools can access all folders and files in the workspace
foldersTools are restricted to specified folders and their subfolders

When a token is folder-scoped:

  • list_files and list_folders return only accessible items
  • get_file returns 403 for out-of-scope files
  • create_file requires the target folder to be in scope
  • search_files only returns results within scope
  • database tools only expose databases assigned to an accessible folder; root-level databases require a workspace-wide token

Example prompts

Once connected, you can ask your AI assistant:

Reading context:

  • "What files do I have in Orcha?"
  • "Show me the content of my architecture.md file"
  • "Search for files related to API"
  • "Check which Orcha context bundles apply to this task and use the best match"

Managing context:

  • "Create a new file called project-notes.md with some starter content"
  • "Update my config.json with the new settings"
  • "Organize my files into a Projects folder"

Using context:

  • "Read my brand-voice.md and use that style to write a blog post"
  • "Check my api-spec.json and generate TypeScript types"
  • "List the records in my Projects database that mention launch"

Error handling

MCP tool calls may return errors in the following cases:

ErrorCause
UnauthorizedInvalid or missing token
ForbiddenToken lacks required permission or resource out of scope
Not foundRequested resource does not exist
Validation errorInvalid arguments provided

Errors are returned as tool call errors with descriptive messages.

Tool calls share the per-token rate limits documented in the API reference. Exceeding a window is answered at the transport level with HTTP 429 and a Retry-After header rather than as a tool error. Protocol traffic such as initialize and tools/list does not count against the limits, so a handshake never costs quota.