Skip to main content
Glama

Unicoda MCP Server

CI License: MIT

Unified AI Coding Agent MCP Server — wraps multiple coding agent SDKs behind a consistent Model Context Protocol (MCP) interface.

Overview

Unicoda lets MCP clients interact with different AI coding agents through a single, standardized abstraction layer. Instead of integrating each SDK separately, you get one consistent interface for workspace management, sessions, and chat.

Core Concepts

Concept

Description

Provider

Backend SDK (copilot, codex, claude-code)

Workspace

An agent instance bound to a project directory. Reads instruction files like AGENTS.md for context.

Session

A conversation within a workspace. Supports multi-turn dialogue with context.

Request

A single message send, tracked by requestId.

Architecture

┌─────────────────┐
│   MCP Client    │
└────────┬────────┘
         │ MCP Protocol
         ▼
┌─────────────────────────────────────────┐
│            Unicoda MCP Server           │
│  ┌─────────────────────────────────┐    │
│  │      Unified Tool Interface     │    │
│  └─────────────┬───────────────────┘    │
│  ┌─────────────┴───────────────────┐    │
│  │       Provider Abstraction      │    │
│  │  ┌─────────┐ ┌───────┐ ┌─────┐  │    │
│  │  │ Copilot │ │ Codex │ │ ... │  │    │
│  │  └─────────┘ └───────┘ └─────┘  │    │
│  └─────────────────────────────────┘    │
└─────────────────────────────────────────┘

Related MCP server: agent-shuttle-mcp

Supported Providers

Provider

SDK

Status

GitHub Copilot

@github/copilot-sdk

✅ Implemented

OpenAI Codex

@openai/codex-sdk

🔜 Planned

Claude Code

TBD

🔜 Planned

Installation

# Run directly from npm
npx @hongw/unicoda-mcp

# Or install globally
npm install -g @hongw/unicoda-mcp

# Or clone and build from source
git clone https://github.com/hongw/unicoda-mcp
cd unicoda-mcp
pnpm install
pnpm build
node dist/index.js

MCP Configuration

Add to your MCP client configuration:

{
  "mcpServers": {
    "unicoda": {
      "command": "node",
      "args": ["/path/to/unicoda-mcp/dist/index.js"],
      "env": {
        "UNICODA_PROVIDER": "copilot"
      }
    }
  }
}

Configuration Options

Parameter

Environment Variable

Default

Description

--provider

UNICODA_PROVIDER

copilot

Default provider

--auto-start-workspace

UNICODA_AUTO_START_WORKSPACE

true

Auto-start workspace when needed

--max-workspaces

UNICODA_MAX_WORKSPACES

10

Maximum concurrent workspaces

--workspace-ttl

UNICODA_WORKSPACE_TTL

1800000

Workspace idle timeout (ms)

--port-range-start

UNICODA_PORT_RANGE_START

40000

CLI port allocation start

Available Tools

Workspace Management

Tool

Description

workspace_start

Start a workspace for a project directory

workspace_stop

Stop a workspace

workspace_list

List all running workspaces

Session Management

Tool

Description

session_create

Create a new conversation session

session_list

List sessions in a workspace

session_delete

Delete a session

session_history

Get full chat history

Chat

Tool

Description

send

Send a message (returns immediately with requestId)

send_and_wait

Send a message and wait for completion

poll

Check request status with optional long-polling

abort

Abort an in-progress request

Utility

Tool

Description

models_list

List available models

Quick Start

// 1. Create session (auto-starts workspace)
session_create({ workspace: "/path/to/project" })
// → { sessionId: "sess-xyz", workspaceId: "ws-abc", autoStarted: true }

// 2. Send task and wait for completion
send_and_wait({
  workspace: "ws-abc",
  sessionId: "sess-xyz",
  prompt: "Add error handling to src/api.ts"
})
// → { requestId: "req-123", status: "completed", messages: [...] }

Poll Options

The poll tool supports long-polling and response filtering:

Parameter

Description

timeout

Long-poll timeout (ms). Waits up to this duration for completion.

detail

Response detail level:

status — Only requestId and status

message — Status + assistant text messages

brief — Status + messages + tool call summaries (truncated)

full — Everything (default)

Message Format

Responses include a messages array with conversation events:

interface Message {
  type: 'user' | 'assistant' | 'tool_call' | 'tool_result' | 'system' | 'error';
  content: string;
  timestamp: string;  // ISO8601
  metadata?: {
    toolName?: string;
    toolArgs?: unknown;
    toolResult?: unknown;
    // ...
  };
}

Request Status

All requests follow a unified state machine:

queued → running → completed
                 → error
                 → timeout
         ↓
       aborted

Error Handling

Errors include structured information:

{
  "error": {
    "code": "WORKSPACE_NOT_FOUND",
    "message": "Workspace ws-xyz not found",
    "retryable": false
  }
}

Common error codes: WORKSPACE_NOT_FOUND, SESSION_NOT_FOUND, REQUEST_NOT_FOUND, TIMEOUT, CLI_START_FAILED

Development

pnpm install
pnpm build
pnpm test
pnpm lint

Contributing

Contributions welcome! See ARCHITECTURE.md for internal design details and implementation notes.

Available Tools

12 tools
abortAbort RequestC

Abort an in-progress request.

Inputs: requestId (required), sessionId (required), workspace (required).

models_listList ModelsC

List available AI models.

Inputs: provider.

pollPoll RequestA

Check the status of a previously sent request. Returns accumulated messages and current status. Supports long-polling via the timeout parameter and flexible detail levels.

Inputs: requestId (required), sessionId (required), workspace (required), detail, +1 more.

sendSend MessageA

Send a message to GitHub Copilot. Returns immediately with a requestId that can be polled for status and results.

Inputs: prompt (required), sessionId (required), workspace (required), attachments.

send_and_waitSend and WaitA

Send a message to GitHub Copilot and wait for the complete response. Blocks until the agent finishes or timeout is reached.

Inputs: prompt (required), sessionId (required), workspace (required), timeout, +1 more.

session_createCreate SessionC

Create a new conversation session in a workspace. A directory path or workspace ID can be used.

Inputs: workspace (required), model, provider, sessionId.

session_deleteDelete SessionC

Delete a session from a workspace.

Inputs: sessionId (required), workspace (required).

session_historySession HistoryC

Get the chat history for a session.

Inputs: sessionId (required), workspace (required).

session_listList SessionsC

List all sessions in a workspace.

Inputs: workspace (required).

workspace_listList WorkspacesB

List all running workspaces.

Inputs: no named parameters.

workspace_startStart WorkspaceC

Start a GitHub Copilot workspace bound to a project directory.

Inputs: directory (required), provider.

workspace_stopStop WorkspaceB

Stop a running workspace and release its resources.

Inputs: workspace (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools map cleanly to distinct resource+action pairs (workspace_*, session_*, models_list, poll, abort). The main overlap is between send and send_and_wait, which do the same underlying operation with different blocking semantics, and session_history versus poll could be momentarily confused (persisted session chat vs. in-flight request state), but descriptions resolve both.

    Naming Consistency4/5

    All names use snake_case and are highly readable. However, the convention shifts between noun_verb for resource operations (workspace_start, session_create, models_list) and bare verbs for the request lifecycle (send, poll, abort), a minor deviation from an otherwise predictable pattern.

    Tool Count5/5

    Twelve tools is well within the sweet spot for a workspace/session orchestration server. Each tool covers a distinct lifecycle step (start/stop/list, create/list/delete/history, send/poll/abort) and none feel redundant or filler.

    Completeness4/5

    The surface covers full lifecycle for workspaces (start/stop/list) and sessions (create/list/delete/history) plus a complete async request flow (send, send_and_wait, poll, abort). Minor gaps exist: no workspace status/get details, no session rename or history clearing, and no way to query a single session's metadata beyond history.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers