@hongw/unicoda-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Unicoda Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,217 @@
1
+ # Unicoda MCP Server
2
+
3
+ [![CI](https://github.com/hongw/unicoda-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/hongw/unicoda-mcp/actions/workflows/ci.yml)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
+
6
+ Unified AI Coding Agent MCP Server — wraps multiple coding agent SDKs behind a consistent [Model Context Protocol (MCP)](https://modelcontextprotocol.io) interface.
7
+
8
+ ## Overview
9
+
10
+ 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.
11
+
12
+ ### Core Concepts
13
+
14
+ | Concept | Description |
15
+ |---------|-------------|
16
+ | **Provider** | Backend SDK (copilot, codex, claude-code) |
17
+ | **Workspace** | An agent instance bound to a project directory. Reads instruction files like `AGENTS.md` for context. |
18
+ | **Session** | A conversation within a workspace. Supports multi-turn dialogue with context. |
19
+ | **Request** | A single message send, tracked by `requestId`. |
20
+
21
+ ### Architecture
22
+
23
+ ```
24
+ ┌─────────────────┐
25
+ │ MCP Client │
26
+ └────────┬────────┘
27
+ │ MCP Protocol
28
+
29
+ ┌─────────────────────────────────────────┐
30
+ │ Unicoda MCP Server │
31
+ │ ┌─────────────────────────────────┐ │
32
+ │ │ Unified Tool Interface │ │
33
+ │ └─────────────┬───────────────────┘ │
34
+ │ ┌─────────────┴───────────────────┐ │
35
+ │ │ Provider Abstraction │ │
36
+ │ │ ┌─────────┐ ┌───────┐ ┌─────┐ │ │
37
+ │ │ │ Copilot │ │ Codex │ │ ... │ │ │
38
+ │ │ └─────────┘ └───────┘ └─────┘ │ │
39
+ │ └─────────────────────────────────┘ │
40
+ └─────────────────────────────────────────┘
41
+ ```
42
+
43
+ ## Supported Providers
44
+
45
+ | Provider | SDK | Status |
46
+ |----------|-----|--------|
47
+ | **GitHub Copilot** | `@github/copilot-sdk` | ✅ Implemented |
48
+ | **OpenAI Codex** | `@openai/codex-sdk` | 🔜 Planned |
49
+ | **Claude Code** | TBD | 🔜 Planned |
50
+
51
+ ## Installation
52
+
53
+ ```bash
54
+ # Run directly from npm
55
+ npx @hongw/unicoda-mcp
56
+
57
+ # Or install globally
58
+ npm install -g @hongw/unicoda-mcp
59
+
60
+ # Or clone and build from source
61
+ git clone https://github.com/hongw/unicoda-mcp
62
+ cd unicoda-mcp
63
+ pnpm install
64
+ pnpm build
65
+ node dist/index.js
66
+ ```
67
+
68
+ ## MCP Configuration
69
+
70
+ Add to your MCP client configuration:
71
+
72
+ ```json
73
+ {
74
+ "mcpServers": {
75
+ "unicoda": {
76
+ "command": "node",
77
+ "args": ["/path/to/unicoda-mcp/dist/index.js"],
78
+ "env": {
79
+ "UNICODA_PROVIDER": "copilot"
80
+ }
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ## Configuration Options
87
+
88
+ | Parameter | Environment Variable | Default | Description |
89
+ |-----------|---------------------|---------|-------------|
90
+ | `--provider` | `UNICODA_PROVIDER` | `copilot` | Default provider |
91
+ | `--auto-start-workspace` | `UNICODA_AUTO_START_WORKSPACE` | `true` | Auto-start workspace when needed |
92
+ | `--max-workspaces` | `UNICODA_MAX_WORKSPACES` | `10` | Maximum concurrent workspaces |
93
+ | `--workspace-ttl` | `UNICODA_WORKSPACE_TTL` | `1800000` | Workspace idle timeout (ms) |
94
+ | `--port-range-start` | `UNICODA_PORT_RANGE_START` | `40000` | CLI port allocation start |
95
+
96
+ ## Available Tools
97
+
98
+ ### Workspace Management
99
+
100
+ | Tool | Description |
101
+ |------|-------------|
102
+ | `workspace_start` | Start a workspace for a project directory |
103
+ | `workspace_stop` | Stop a workspace |
104
+ | `workspace_list` | List all running workspaces |
105
+
106
+ ### Session Management
107
+
108
+ | Tool | Description |
109
+ |------|-------------|
110
+ | `session_create` | Create a new conversation session |
111
+ | `session_list` | List sessions in a workspace |
112
+ | `session_delete` | Delete a session |
113
+ | `session_history` | Get full chat history |
114
+
115
+ ### Chat
116
+
117
+ | Tool | Description |
118
+ |------|-------------|
119
+ | `send` | Send a message (returns immediately with `requestId`) |
120
+ | `send_and_wait` | Send a message and wait for completion |
121
+ | `poll` | Check request status with optional long-polling |
122
+ | `abort` | Abort an in-progress request |
123
+
124
+ ### Utility
125
+
126
+ | Tool | Description |
127
+ |------|-------------|
128
+ | `models_list` | List available models |
129
+
130
+ ## Quick Start
131
+
132
+ ```javascript
133
+ // 1. Create session (auto-starts workspace)
134
+ session_create({ workspace: "/path/to/project" })
135
+ // → { sessionId: "sess-xyz", workspaceId: "ws-abc", autoStarted: true }
136
+
137
+ // 2. Send task and wait for completion
138
+ send_and_wait({
139
+ workspace: "ws-abc",
140
+ sessionId: "sess-xyz",
141
+ prompt: "Add error handling to src/api.ts"
142
+ })
143
+ // → { requestId: "req-123", status: "completed", messages: [...] }
144
+ ```
145
+
146
+ ## Poll Options
147
+
148
+ The `poll` tool supports long-polling and response filtering:
149
+
150
+ | Parameter | Description |
151
+ |-----------|-------------|
152
+ | `timeout` | Long-poll timeout (ms). Waits up to this duration for completion. |
153
+ | `detail` | Response detail level: |
154
+ | | `status` — Only `requestId` and `status` |
155
+ | | `message` — Status + assistant text messages |
156
+ | | `brief` — Status + messages + tool call summaries (truncated) |
157
+ | | `full` — Everything (default) |
158
+
159
+ ## Message Format
160
+
161
+ Responses include a `messages` array with conversation events:
162
+
163
+ ```typescript
164
+ interface Message {
165
+ type: 'user' | 'assistant' | 'tool_call' | 'tool_result' | 'system' | 'error';
166
+ content: string;
167
+ timestamp: string; // ISO8601
168
+ metadata?: {
169
+ toolName?: string;
170
+ toolArgs?: unknown;
171
+ toolResult?: unknown;
172
+ // ...
173
+ };
174
+ }
175
+ ```
176
+
177
+ ## Request Status
178
+
179
+ All requests follow a unified state machine:
180
+
181
+ ```
182
+ queued → running → completed
183
+ → error
184
+ → timeout
185
+
186
+ aborted
187
+ ```
188
+
189
+ ## Error Handling
190
+
191
+ Errors include structured information:
192
+
193
+ ```json
194
+ {
195
+ "error": {
196
+ "code": "WORKSPACE_NOT_FOUND",
197
+ "message": "Workspace ws-xyz not found",
198
+ "retryable": false
199
+ }
200
+ }
201
+ ```
202
+
203
+ Common error codes: `WORKSPACE_NOT_FOUND`, `SESSION_NOT_FOUND`, `REQUEST_NOT_FOUND`, `TIMEOUT`, `CLI_START_FAILED`
204
+
205
+ ## Development
206
+
207
+ ```bash
208
+ pnpm install
209
+ pnpm build
210
+ pnpm test
211
+ pnpm lint
212
+ ```
213
+
214
+ ## Contributing
215
+
216
+ Contributions welcome! See [ARCHITECTURE.md](docs/ARCHITECTURE.md) for internal design details and implementation notes.
217
+
@@ -0,0 +1,2 @@
1
+
2
+ export { }