@opsee/mcp-server 0.1.6 → 0.1.8
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/README.md +207 -0
- package/bin/opsee-mcp.js +9 -3
- package/package.json +9 -3
- package/src/__tests__/tools.test.ts +465 -0
- package/src/auth/oauth-provider.ts +254 -0
- package/src/auth/token-context.ts +11 -0
- package/src/client/api.ts +48 -24
- package/src/index-http.ts +6 -0
- package/src/server-http.ts +120 -0
- package/src/server.ts +11 -9
- package/src/tools/cycles.ts +3 -0
- package/src/tools/docs.ts +4 -0
- package/src/tools/projects.ts +2 -0
- package/src/tools/repositories.ts +1 -0
- package/src/tools/task-metadata.ts +4 -0
- package/src/tools/tasks.ts +4 -0
- package/src/tools/user.ts +1 -0
- package/src/utils/format.ts +8 -8
package/README.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Opsee MCP Server
|
|
2
|
+
|
|
3
|
+
Manage your Opsee projects, tasks, docs, and cycles directly from AI-powered coding environments like Claude Code and Cursor.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### 1. Authenticate
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @opsee/mcp-server login
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This opens your browser to sign in to Opsee. Your credentials are saved to `~/.opsee/credentials.json`.
|
|
14
|
+
|
|
15
|
+
### 2. Add to Claude Code
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
claude mcp add opsee -- npx @opsee/mcp-server serve
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 3. Restart Claude Code
|
|
22
|
+
|
|
23
|
+
Exit and reopen Claude Code. Run `/mcp` to verify `opsee` shows as connected.
|
|
24
|
+
|
|
25
|
+
### 4. Start using it
|
|
26
|
+
|
|
27
|
+
Ask Claude things like:
|
|
28
|
+
- "List my Opsee projects"
|
|
29
|
+
- "Show tasks in project Codlas"
|
|
30
|
+
- "Create a task called 'Fix login bug' in project 1"
|
|
31
|
+
- "What cycles are active in project 1?"
|
|
32
|
+
- "Show me the docs in project 1"
|
|
33
|
+
|
|
34
|
+
## Available Tools (19)
|
|
35
|
+
|
|
36
|
+
| Tool | Description |
|
|
37
|
+
|------|-------------|
|
|
38
|
+
| `opsee_get_me` | Get your profile info |
|
|
39
|
+
| `opsee_list_projects` | List all projects |
|
|
40
|
+
| `opsee_get_project` | Get project details |
|
|
41
|
+
| `opsee_list_tasks` | List tasks with filters |
|
|
42
|
+
| `opsee_get_task` | Get task details |
|
|
43
|
+
| `opsee_create_task` | Create a new task |
|
|
44
|
+
| `opsee_update_task` | Update task fields |
|
|
45
|
+
| `opsee_list_task_types` | Get task types (Bug, Feature, etc.) |
|
|
46
|
+
| `opsee_list_task_priorities` | Get priority levels |
|
|
47
|
+
| `opsee_list_boards` | List Kanban boards |
|
|
48
|
+
| `opsee_list_board_columns` | Get board columns/statuses |
|
|
49
|
+
| `opsee_list_cycles` | List cycles/sprints |
|
|
50
|
+
| `opsee_get_cycle` | Get cycle details |
|
|
51
|
+
| `opsee_create_cycle` | Create a new cycle |
|
|
52
|
+
| `opsee_list_doc_spaces` | List doc spaces |
|
|
53
|
+
| `opsee_list_doc_pages` | List pages in a doc space |
|
|
54
|
+
| `opsee_get_doc_page` | Read a doc page |
|
|
55
|
+
| `opsee_create_doc_page` | Create a new doc page |
|
|
56
|
+
| `opsee_list_repositories` | List connected repositories |
|
|
57
|
+
|
|
58
|
+
## Remote MCP Server (Recommended)
|
|
59
|
+
|
|
60
|
+
The remote server runs in the cloud with OAuth 2.0 authentication — no local setup or tokens needed.
|
|
61
|
+
|
|
62
|
+
### Environments
|
|
63
|
+
|
|
64
|
+
| Environment | URL | Opsee Instance |
|
|
65
|
+
|-------------|-----|----------------|
|
|
66
|
+
| **Production** | `https://mcp.api.opsee.ai/mcp` | `https://opsee.ai` |
|
|
67
|
+
| **Development** | `https://opsee-development.mcp.cls.codilas.link/mcp` | `https://opsee-development.cdn.codilas.link` |
|
|
68
|
+
|
|
69
|
+
### Claude Code
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Production
|
|
73
|
+
claude mcp add opsee --transport http https://mcp.api.opsee.ai/mcp
|
|
74
|
+
|
|
75
|
+
# Development
|
|
76
|
+
claude mcp add opsee-dev --transport http https://opsee-development.mcp.cls.codilas.link/mcp
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Restart Claude Code. On first use, your browser opens for Opsee login. After authenticating, all tools are available immediately.
|
|
80
|
+
|
|
81
|
+
You can have both environments connected at the same time — use tools prefixed with the server name (e.g. `opsee` for production, `opsee-dev` for development).
|
|
82
|
+
|
|
83
|
+
### Cursor / Other MCP Clients
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"mcpServers": {
|
|
88
|
+
"opsee": {
|
|
89
|
+
"type": "http",
|
|
90
|
+
"url": "https://mcp.api.opsee.ai/mcp"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Replace the URL with the development endpoint if targeting that environment.
|
|
97
|
+
|
|
98
|
+
Your MCP client handles the OAuth flow automatically — just sign in when prompted.
|
|
99
|
+
|
|
100
|
+
### How it works
|
|
101
|
+
|
|
102
|
+
1. Client connects to the MCP endpoint (e.g. `https://mcp.api.opsee.ai/mcp`)
|
|
103
|
+
2. Server returns 401 with OAuth discovery metadata
|
|
104
|
+
3. Client registers itself and opens the Opsee login page in your browser
|
|
105
|
+
4. After login, the client exchanges the auth code for an access token
|
|
106
|
+
5. All subsequent tool calls use the token automatically
|
|
107
|
+
|
|
108
|
+
## Local MCP Server (Alternative)
|
|
109
|
+
|
|
110
|
+
Run the MCP server locally via npx. Requires a one-time login to get a token.
|
|
111
|
+
|
|
112
|
+
### 1. Authenticate
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npx @opsee/mcp-server login
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 2. Add to Claude Code
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
claude mcp add opsee -- npx @opsee/mcp-server serve
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Cursor / Other MCP Clients (Local)
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"mcpServers": {
|
|
129
|
+
"opsee": {
|
|
130
|
+
"command": "npx",
|
|
131
|
+
"args": ["@opsee/mcp-server", "serve"]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### CI / Headless Environments
|
|
138
|
+
|
|
139
|
+
Skip the browser login by setting a token directly:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"mcpServers": {
|
|
144
|
+
"opsee": {
|
|
145
|
+
"command": "npx",
|
|
146
|
+
"args": ["@opsee/mcp-server", "serve"],
|
|
147
|
+
"env": {
|
|
148
|
+
"OPSEE_API_TOKEN": "your-jwt-token"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Self-Hosting the Remote Server
|
|
156
|
+
|
|
157
|
+
Deploy the MCP server in your own infrastructure using Docker.
|
|
158
|
+
|
|
159
|
+
### Docker
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
docker build -f mcp/Dockerfile . -t opsee-mcp-server
|
|
163
|
+
|
|
164
|
+
docker run -p 3100:3100 \
|
|
165
|
+
-e MCP_SERVER_URL=https://mcp.yourdomain.com \
|
|
166
|
+
-e OPSEE_API_URL=http://your-backend:8080 \
|
|
167
|
+
-e OPSEE_APP_URL=https://your-frontend.com \
|
|
168
|
+
opsee-mcp-server
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Kubernetes
|
|
172
|
+
|
|
173
|
+
The server includes Kustomize configs following the same pattern as the backend:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Development
|
|
177
|
+
kubectl apply -k mcp/k8/environments/development/ -n opsee-development
|
|
178
|
+
|
|
179
|
+
# Production
|
|
180
|
+
kubectl apply -k mcp/k8/environments/production/ -n opsee-production
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Environment Variables
|
|
184
|
+
|
|
185
|
+
| Variable | Description | Default |
|
|
186
|
+
|----------|-------------|---------|
|
|
187
|
+
| `MCP_SERVER_URL` | Public URL of this MCP server (for OAuth redirects) | `http://localhost:3100` |
|
|
188
|
+
| `MCP_HOST` | Bind host | `0.0.0.0` |
|
|
189
|
+
| `MCP_PORT` | Bind port | `3100` |
|
|
190
|
+
| `OPSEE_API_URL` | Backend Connect RPC URL | `https://grpc.api.opsee.ai` |
|
|
191
|
+
| `OPSEE_APP_URL` | Frontend URL (OAuth login page) | `https://opsee.ai` |
|
|
192
|
+
| `OPSEE_API_TOKEN` | Direct JWT token for local mode | — |
|
|
193
|
+
| `OPSEE_CREDENTIALS_PATH` | Override credential file path | `~/.opsee/credentials.json` |
|
|
194
|
+
|
|
195
|
+
## Local Development
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Start backend + frontend locally, then:
|
|
199
|
+
|
|
200
|
+
# Local mode (stdio):
|
|
201
|
+
OPSEE_APP_URL=http://localhost:5173 OPSEE_API_URL=http://localhost:9990 npx @opsee/mcp-server login
|
|
202
|
+
claude mcp add opsee -e OPSEE_API_URL=http://localhost:9990 -- npx @opsee/mcp-server serve
|
|
203
|
+
|
|
204
|
+
# Remote mode (HTTP):
|
|
205
|
+
MCP_SERVER_URL=http://localhost:3100 OPSEE_API_URL=http://localhost:9990 OPSEE_APP_URL=http://localhost:5173 npx @opsee/mcp-server serve-remote
|
|
206
|
+
claude mcp add opsee-local --transport http http://localhost:3100/mcp
|
|
207
|
+
```
|
package/bin/opsee-mcp.js
CHANGED
|
@@ -13,9 +13,15 @@ const tsxPkg = dirname(require.resolve("tsx/package.json"));
|
|
|
13
13
|
const tsx = resolve(tsxPkg, "dist", "cli.mjs");
|
|
14
14
|
|
|
15
15
|
const command = process.argv[2];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
let script;
|
|
17
|
+
if (command === "login") {
|
|
18
|
+
script = resolve(__dirname, "..", "src", "auth", "login-cli.ts");
|
|
19
|
+
} else if (command === "serve-remote") {
|
|
20
|
+
script = resolve(__dirname, "..", "src", "index-http.ts");
|
|
21
|
+
} else {
|
|
22
|
+
// Default: stdio mode (local)
|
|
23
|
+
script = resolve(__dirname, "..", "src", "index.ts");
|
|
24
|
+
}
|
|
19
25
|
|
|
20
26
|
const child = spawn(process.execPath, [tsx, script], { stdio: "inherit", env: process.env });
|
|
21
27
|
child.on("exit", (code) => process.exit(code || 0));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opsee/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Opsee MCP server — manage projects, tasks, docs, and cycles from AI coding environments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,20 +11,26 @@
|
|
|
11
11
|
"start": "npx tsx src/index.ts",
|
|
12
12
|
"proto-local": "rm -rf ./gen && cd .. && buf build -o mcp/descriptor.bin && cd mcp && buf generate --include-imports descriptor.bin && rm descriptor.bin",
|
|
13
13
|
"proto": "rm -rf ./gen && curl -k 'https://general.storage.codilas.link/opsee/proto/descriptor.bin' --output ./descriptor.bin && buf generate --include-imports descriptor.bin && rm ./descriptor.bin",
|
|
14
|
-
"lint": "tsc --noEmit"
|
|
14
|
+
"lint": "tsc --noEmit",
|
|
15
|
+
"test": "vitest run"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"@bufbuild/protobuf": "^2.2.3",
|
|
18
19
|
"@connectrpc/connect": "^2.0.2",
|
|
19
20
|
"@connectrpc/connect-node": "^2.0.2",
|
|
20
21
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
22
|
+
"cors": "^2.8.6",
|
|
23
|
+
"express": "^5.2.1",
|
|
21
24
|
"open": "^10.1.0",
|
|
22
25
|
"tsx": "^4.21.0",
|
|
23
26
|
"zod": "^4.3.6"
|
|
24
27
|
},
|
|
25
28
|
"devDependencies": {
|
|
29
|
+
"@types/cors": "^2.8.19",
|
|
30
|
+
"@types/express": "^5.0.6",
|
|
26
31
|
"@types/node": "^22.13.0",
|
|
27
|
-
"typescript": "^5.7.0"
|
|
32
|
+
"typescript": "^5.7.0",
|
|
33
|
+
"vitest": "^4.1.0"
|
|
28
34
|
},
|
|
29
35
|
"engines": {
|
|
30
36
|
"node": ">=18.0.0"
|