Skip to content

Connecting via MCP (Model Context Protocol) ​

Unishift ships a built-in Model Context Protocol (MCP) server as part of the API Gateway. The server lets external AI assistants and development environments (Cursor, Claude Desktop, Claude Code, Windsurf, VS Code) connect directly to the platform microservices.

Connection uses a Personal Access Token. All requests run strictly in the context of the user's permissions (available spaces, documents, tasks, commands) and are recorded in the audit log.


1. Getting a user token ​

A personal Bearer token is used to connect an MCP client securely.

Via the Unishift web UI ​

  1. Open the Unishift web client.
  2. In the top-right corner click the profile avatar and go to User settings.
  3. In the side menu open the API keys section (access tokens).
  4. Click Create token.
  5. Fill in the parameters:
    • Name: a readable client name (for example, Cursor IDE, Claude Desktop Workstation).
    • Note (optional): purpose or host.
    • Expiration (TTL): pick an interval (7 days, 30 days, 90 days, 1 year).
  6. Click Create and copy the generated token.

The token is shown once

Save the copied value immediately. For security, the full key is never shown again in plain text.

Via the API ​

A token can also be issued programmatically:

bash
curl -X POST http://localhost:8090/api/v1/auth/tokens \
  -H "Authorization: Bearer <SESSION_OR_ADMIN_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cursor IDE Token",
    "note": "MCP integration",
    "ttl_seconds": 2592000
  }'

The response returns the created JWT in the data.token field.


2. MCP endpoints and transports ​

The Gateway provides several transports:

TransportURL / EndpointPurpose
Streamable HTTP (recommended)http://localhost:8090/mcpCursor IDE, modern MCP clients with HTTP support
Server-Sent Events (SSE)http://localhost:8090/mcp/sseSSE-capable clients (messages: POST /mcp/messages)
Stdio (CLI)gateway mcpLocal CLI transport over standard input/output

Ports in Docker

When the stack runs via Docker Compose, replace port 8090 with 18090 (or the external port of your installation domain: https://unishift.your-domain.com/mcp).


3. Client configuration ​

Cursor IDE ​

Add the configuration to .cursor/mcp.json in the project root or in the global Cursor settings file:

json
{
  "mcpServers": {
    "unishift": {
      "url": "http://localhost:8090/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_USER_TOKEN>"
      }
    }
  }
}

To use the SSE transport, point to the /mcp/sse endpoint:

json
{
  "mcpServers": {
    "unishift-sse": {
      "url": "http://localhost:8090/mcp/sse",
      "headers": {
        "Authorization": "Bearer <YOUR_USER_TOKEN>"
      }
    }
  }
}

Claude Desktop ​

In the claude_desktop_config.json file:

json
{
  "mcpServers": {
    "unishift": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://localhost:8090/mcp",
        "--header",
        "Authorization: Bearer <YOUR_USER_TOKEN>"
      ]
    }
  }
}

Claude Code CLI ​

To connect from the Claude Code terminal:

bash
claude mcp add unishift http://localhost:8090/mcp --header "Authorization: Bearer <YOUR_USER_TOKEN>"

4. Available tools ​

After connecting, an AI agent gets access to the platform toolset:

Semantic and full-text search over the corporate RAG knowledge base (documents, guidelines, notes, technical specifications, task context) with filtering by space or across all spaces available to the user.

  • Input parameters:
    • query (string, required): search query or question (task keys are supported, e.g. PA-123).
    • space_id (string, optional): space identifier (UUID, space-<uuid> or a human-readable name such as Backend or Core Team). If omitted — the search covers all spaces the user has access to.
    • scopes (array of strings, optional): exact list of RAG scopes (e.g. ["space-c1f7b889-..."]). When passed, overrides space_id.
    • limit (integer, optional): maximum number of fragments (default 5, max 20).
    • token (string, optional): explicit Bearer token (for clients running over the stdio transport without an HTTP Authorization header).
  • Result: a list of relevant text fragments with the source name (Source: "...") and metadata.

list_spaces ​

Returns all workspaces the current user has access to (including id, name, description and a ready RAG scope identifier).

  • Input parameters:
    • query (string, optional): filter spaces by name or id substring.
  • Result: an array of spaces with id, name, description, scope (space-<uuid>).

list_services ​

Returns the registered platform microservices, their base URLs and health probe statuses.

  • Input parameters:
    • check_health (boolean, optional): whether to poll live health probes.
  • Returned services: spaces, documents, task-tracker, command-manager, storage, flow-manager, scheduler, env-manager, spark-grid, ai-router, notifications, etc.

get_service_api ​

Fetches the current OpenAPI / Swagger specification of a chosen service directly from the running instance.

  • Input parameters:
    • service_name (string, required): the service name (e.g. task-tracker, documents, spaces).
    • filter (string, optional): filter paths by substring (e.g. tasks, export, search).
  • Result: the list of available routes, parameter schemas and request/response bodies. Lets the model adapt dynamically to the current API version without hardcoded contracts.

call_service_api ​

Performs a real HTTP request (GET, POST, PUT, DELETE, PATCH) to any platform service through the Gateway.

  • Input parameters:
    • service_name (string, required): the target microservice.
    • method (string, required): GET, POST, PUT, DELETE, PATCH.
    • path (string, required): the method path starting with / (e.g. /api/v1/spaces).
    • query_params (object, optional): URL query parameters.
    • headers (object, optional): extra headers (e.g. X-Space-ID).
    • body (any, optional): the JSON request body.

5. Practical use cases ​

Connecting Unishift via MCP turns the agent inside an IDE into a full participant of the team's workflows.

Case 1: Working with tracker tasks right in the codebase ​

A developer works on a feature in the IDE and phrases the request:

"Look at the description of task TASK-428 in Unishift, implement the required validations in the controller and move the task to Review with a comment linking the changed files."

What the AI agent does:

  1. Calls call_service_api (GET /api/v1/tasks/... on task-tracker) and receives the full task description, acceptance criteria and the comment thread.
  2. Studies the codebase, writes the required code and tests.
  3. Calls call_service_api (PATCH /api/v1/tasks/:id), sets the status to In Review, and adds a comment listing the affected files and how to verify them.

Case 2: Finding guidelines and syncing documentation (RAG & Documents) ​

"Find the API versioning rules in the Backend space knowledge base and create a new page describing our payments service."

What the AI agent does:

  1. Calls rag_search with {"query": "API versioning rules", "space_id": "Backend"} and gets exact excerpts from architecture guidelines (ADRs) and company standards with cited sources.
  2. Designs the documentation according to the found standards.
  3. Saves the finished article directly into the knowledge base section via call_service_api (POST /api/v1/documents).

Case 3: Running and checking commands on isolated runners (Command Manager) ​

"Run a test migration pass for the billing service on the dev runner and show the output."

What the AI agent does:

  1. Queries the list of registered commands in command-manager via call_service_api.
  2. Starts the command execution on a runner (POST /api/v1/executions).
  3. Reads the execution logs and summarizes whether the migration succeeded — without opening a terminal or configuring SSH access.

Case 4: Triggering end-to-end automation pipelines (Flow Manager) ​

"Launch the test-stand build pipeline after the latest commits."

What the AI agent does:

  1. Finds the required graph in flow-manager.
  2. Starts the flow execution with the branch's input parameters.
  3. Tracks node completion and reports the result.

Case 5: Safe environment audit (Env Manager) ​

"Check whether the backend-services space defines keys for S3 and NATS."

What the AI agent does:

  1. Queries the key registry in env-manager for the project workspace.
  2. Verifies the required variables without exposing the secret values themselves.

Case 6: End-to-end release preparation ​

"Collect all ready tasks from the tracker for release 2.4.0, compose the release notes, save them to the documentation and notify the team chat."

What the AI agent does:

  1. Queries tasks with the Ready for Release status in task-tracker.
  2. Builds a structured change list (Features, Fixes, Breaking Changes).
  3. Creates a page in documents under Releases / 2.4.0.
  4. Sends a notification with the link via the notifications service.

6. Security and audit ​

  • Least privilege: the token is limited by the user's role (admin / user) and the spaces available to them.
  • Action audit: every call_service_api call leaves an event in the system logs and NATS with the user id (X-User-ID), IP address and the affected resource.
  • Instant revocation: if a token is suspected compromised, it can be revoked immediately in the web UI under API keys, without resetting the main password.