octipus-mcp-server

v0.8.0
octipus-mcp-server Checked 2 days ago Published 2 days ago

MCP server bridge for Octipus — exposes skills, agents, search, and chat as MCP tools

This package exposes an Octipus backend as a Model Context Protocol server. It registers 83 tools across 23 groups for chat, search, agents, sessions, models, knowledge, documents, tasks, and administration. Tool availability and results still depend on the connected backend, the authenticated user, and that user's permissions. This release adds the update_skill alias for octipus_update_skill and includes skill IDs in listings. Existing list_skills and get_skill aliases remain available for managed agent workflows. Update the connected Octipus backend to 0.6.0 for the new update behavior.

Summary extracted from the README.

Octipus MCP server

This package exposes an Octipus backend as a Model Context Protocol server. It registers 83 tools across 23 groups for chat, search, agents, sessions, models, knowledge, documents, tasks, and administration. Tool availability and results still depend on the connected backend, the authenticated user, and that user's permissions.

v0.6.0

This release adds the update_skill alias for octipus_update_skill and includes skill IDs in listings. Existing list_skills and get_skill aliases remain available for managed agent workflows. Update the connected Octipus backend to 0.6.0 for the new update behavior. Mounted skills must still be edited at their source and reloaded.

Install this version with npm install -g octipus-mcp-server@0.6.0, or use npx -y octipus-mcp-server@0.6.0 in your MCP client. Restart the client after updating. See the full release notes.

Install

Published on npm, so nothing needs to be checked out to use it:

npx octipus-mcp-server            # run it without installing
npm install -g octipus-mcp-server # or install, and get `octipus-mcp` on PATH

It is a bridge, not a backend: it needs a running Octipus instance to talk to, and the URL and credentials below are how it finds one.

To build it from a checkout instead — when changing it, or to run an unreleased revision:

cd mcp-server
npm install
npm run build

The server requires Node.js 18 or newer. The rest of the Octipus repository requires Node.js 24 or newer, so use Node.js 24 when developing both together.

Connect over stdio

Start the Octipus backend first, then set its URL and one authentication method:

export OCTIPUS_URL=http://localhost:3005
export OCTIPUS_API_KEY=octi_your_token
npm run start:stdio

A personal access token in OCTIPUS_API_KEY is the preferred setup. Alternatively, set both OCTIPUS_USER and OCTIPUS_PASSWORD for an account without TOTP. The bridge logs in through /api/auth/login-mobile, caches the returned token until shortly before its server-reported expiry, and shares concurrent login attempts within one backend client. Accounts requiring TOTP should use a personal access token; this bridge has no interactive TOTP flow.

In username/password mode, a backend 401 refreshes authentication and retries the request once. API-key mode takes precedence and does not refresh or retry an unauthorized request. Other errors are returned without authentication retries.

OCTIPUS_API_KEY accepts a personal access token or session JWT. Protected backend calls require configured credentials. The transport key described below is separate from backend authentication.

The direct tool bridge (octipus_list_tools, octipus_execute_tool, and the web search, page fetch, knowledge, messaging, notes, tasks, profiles and email tools built on it) calls /api/tools and /api/tools/:id/tools/:name/execute. With a non-admin token it lists and runs only the tools your own chat agent has (the general role's tools, without the install's MCP servers), under your tool permissions; anything that would ask for approval is refused. An admin token reaches every registered tool. The health, model and channel status tools need an admin token.

The default transport is stdio, so npm start and npm run start:stdio are equivalent. A typical MCP client configuration — Claude Desktop, Claude Code, or anything else that speaks MCP over stdio — is:

{
  "mcpServers": {
    "octipus": {
      "command": "npx",
      "args": ["-y", "octipus-mcp-server"],
      "env": {
        "OCTIPUS_URL": "http://localhost:3005",
        "OCTIPUS_API_KEY": "octi_your_token"
      }
    }
  }
}

From a checkout, point the client at the built entry instead — "command": "node", "args": ["/absolute/path/to/octipus/mcp-server/dist/index.js"] — so it runs the revision you are editing rather than the published one.

Compact toolset

A client that sends every tool schema with each request can start the server with --toolset compact (or "env": { "OCTIPUS_MCP_TOOLSET": "compact" }). It then lists three tools — octipus_search_tools, octipus_describe_tool and octipus_call_tool — that find, describe and run the full set with the same validation, deadlines and module gating as a direct call. Clients with their own tool search or code mode, such as Claude Code, do not need it. See MCP-SERVER.md.

HTTP/SSE transport

export OCTIPUS_API_KEY=octi_your_backend_token
export MCP_API_KEY=choose-a-separate-transport-key
npm run start:http
# Alternate port or explicit network bind:
npm run start:http -- --port 4010 --host 0.0.0.0

The listener defaults to 127.0.0.1:3010. --host overrides MCP_HOST; --port changes the port. A nonempty MCP_API_KEY is required at startup. Use TLS through a reverse proxy when exposing it remotely.

This preserves the legacy MCP HTTP+SSE transport (deprecated by the SDK); it is not the newer Streamable HTTP /mcp protocol:

  • GET /sse opens a stream and advertises /messages?sessionId=<id>.
  • POST /messages?sessionId=<id> sends JSON-RPC to that stream's session. Accepted messages return 202; results arrive as SSE events.
  • Both endpoints require Authorization: Bearer <MCP_API_KEY>. Configure the header for both the stream request and subsequent POSTs in your client.
  • Each stream has its own MCP server/protocol state. Closing the stream removes the session; unknown or closed sessions return 400.
  • Requests with an Origin header must match CORS_ORIGINS exactly (a comma-separated list, default http://localhost:3007). Other origins get 403. Native clients without Origin are accepted if authenticated.
  • SDK parsing limits POST bodies to 4 MB and rejects malformed JSON-RPC.
  • GET /health is public and reports listener availability, not backend readiness.

All HTTP clients act through the same configured Octipus backend account. The transport key is a shared access credential, not a per-user identity. Backend permissions still apply, including unattended ASK refusal. Share this bridge only with clients authorized to use that account. Stdio continues to work without an HTTP transport key.

Tests

npm test builds the package and runs Node tests for authentication and real SDK HTTP/SSE roundtrips against local fixtures, including concurrent clients, rejected requests, and disconnect/shutdown cleanup. These tests do not measure live model quality or validate a remote proxy deployment.

Updating skills

Use octipus_list_skills to find the skill ID, read it with get_skill, then call update_skill (also available as octipus_update_skill) with skill_id and only the fields to change. content replaces the complete Markdown body; an empty string clears it and activates the structured fields. Omitted fields, the skill ID, and role assignments are preserved. Custom skills require their owner or an administrator. Mounted skills remain read-only: edit the source and use Reload mounted skills in Octipus. The same update_skill tool is available to internal agents without an MCP connection.

Delegated execution history

octipus_get_agent_activity reads durable agent/attempt history by session, dispatch handle or full/unambiguous short UI agent id. It includes failed and already-collected executions, ordered attempt timestamps, selected models, primary/fallback errors, exit diagnostics when reported and the real UI links. Page agents with after_agent_id and events with after_event_id. Workspace and current target-session access are rechecked for every lookup. Legacy dispatch handles and original provider failures cannot be reconstructed if they were never recorded. An unknown upstream account is reported as unknown; an operator CLI or personal credential owner is not proof of a particular subscription.

Managed CLI agents call get_agent_activity, list_tools and describe_tool through their run-scoped bridge. mcp_list_tools discovers external servers; an empty external-server list does not describe the parent Octipus connection. task_state indexes task/output records, while collect_children collects run-local handles; neither is the complete historical execution ledger.

spawn_child.routePolicy.primaryModel restricts the request to its configured primary model id or row name; a mismatch refuses the spawn. allowBackup=false prohibits backup attempts. Default fallback uses the configured topic backup, and receipts report the applied policy. Prose constraints do not override provider routing.