Skip to content

Commit 1b0ef13

Browse files
committed
test(ci): add ci
1 parent abb247f commit 1b0ef13

File tree

4 files changed

+52
-13
lines changed

4 files changed

+52
-13
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ $default-branch ]
9+
pull_request:
10+
branches: [ $default-branch ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [18.x, 20.x, 22.x]
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: 'npm'
29+
- run: npm ci
30+
- run: npm test

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"lint:fix": "eslint . --ext .ts --fix",
1414
"format": "prettier --write \"src/**/*.ts\"",
1515
"format:check": "prettier --check \"src/**/*.ts\"",
16+
"test-startup": "node build/server.js",
17+
"test": "npm run lint && npm run format:check && npm run build && npm run test-startup",
1618
"prepublishOnly": "npm run build"
1719
},
1820
"files": [

src/index.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
#!/usr/bin/env node
2-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
32
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
43

5-
import { getVersion } from "./common/version.js";
6-
import { registerTools } from "./tools/index.js";
4+
import { createServer } from "./server.js";
75

86
async function main() {
9-
const version = getVersion();
10-
11-
const server = new McpServer({
12-
name: "plane-mcp-server",
13-
version,
14-
capabilities: {},
15-
});
16-
17-
registerTools(server);
18-
7+
const { server, version } = createServer();
198
const transport = new StdioServerTransport();
209
await server.connect(transport);
2110
console.error(`Plane MCP Server running on stdio: ${version}`);

src/server.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2+
3+
import { getVersion } from "./common/version.js";
4+
import { registerTools } from "./tools/index.js";
5+
6+
export function createServer() {
7+
const version = getVersion();
8+
9+
const server = new McpServer({
10+
name: "plane-mcp-server",
11+
version,
12+
capabilities: {},
13+
});
14+
15+
registerTools(server);
16+
17+
return { server, version };
18+
}

0 commit comments

Comments
 (0)