Skip to content

Commit f3dfbb2

Browse files
committed
feat: implement server connection
Signed-off-by: sunrabbit123 <[email protected]>
1 parent 58f7c55 commit f3dfbb2

File tree

12 files changed

+978
-299
lines changed

12 files changed

+978
-299
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
dist

README.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,36 @@
33
## Usage
44

55
```typescript
6-
import { bundler } from "@wrtnlabs/mcp-bundler";
76
import type { Server } from "@modelcontextprotocol/sdk/server/index.js";
7+
88
import { createServer } from "@wrtnlabs/calculator-mcp";
9+
import { bundler } from "@wrtnlabs/mcp-bundler";
910

1011
export const server: Server = bundler({
11-
mcpServers: {
12-
figma: {
13-
command: "bun",
14-
args: [
15-
"--watch",
16-
"/path/to/figma-mcp/src/index.ts",
17-
"-e",
18-
"FIGMA_PERSONAL_ACCESS_TOKEN=your_token_here",
19-
"-e",
20-
"PORT=6000"
21-
]
22-
},
23-
calculator: createServer({
24-
name: "calculator",
25-
version: "1.0.0"
26-
}),
27-
"notionApi": {
28-
"command": "npx",
29-
"args": ["-y", "@notionhq/notion-mcp-server"],
30-
"env": {
31-
"OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\" }"
32-
}
33-
},
34-
}
12+
mcpServers: {
13+
figma: {
14+
command: "bun",
15+
args: [
16+
"--watch",
17+
"/path/to/figma-mcp/src/index.ts",
18+
"-e",
19+
"FIGMA_PERSONAL_ACCESS_TOKEN=your_token_here",
20+
"-e",
21+
"PORT=6000"
22+
]
23+
},
24+
calculator: createServer({
25+
name: "calculator",
26+
version: "1.0.0"
27+
}),
28+
notionApi: {
29+
command: "npx",
30+
args: ["-y", "@notionhq/notion-mcp-server"],
31+
env: {
32+
OPENAPI_MCP_HEADERS: "{\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\" }"
33+
}
34+
},
35+
}
3536
})();
3637
```
3738

@@ -41,8 +42,8 @@ export const server: Server = bundler({
4142
> npx example-mcp
4243
```
4344

44-
4545
### SSE mode
46+
4647
```sh
4748
> npx example-mcp -p 4506
4849
```
@@ -72,6 +73,7 @@ await Promise.all([
7273
```
7374

7475
### in other ide and options
76+
7577
```
7678
{
7779
"mcpServers": {
@@ -84,4 +86,4 @@ await Promise.all([
8486
}
8587
}
8688
}
87-
```
89+
```

eslint.config.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import { wrtnlabs } from "@wrtnlabs/eslint-config";
33
export default wrtnlabs({
44
type: "app",
55
test: true,
6-
ignores: ["eslint.config.mts", "bin"],
6+
ignores: ["eslint.config.mts", "tsup.config.ts", "vitest.config.mts"],
77
rules: {
88
"no-unsafe-assignment": "off",
99
"no-unsafe-call": "off",
1010
"no-unsafe-member-access": "off",
11+
"no-console": "off",
12+
"node/prefer-global/process": "off",
1113
},
1214
});

package.json

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11
{
22
"name": "@wrtnlabs/mcp-bundler",
33
"version": "1.0.0",
4-
"description": "",
5-
"main": "index.js",
4+
"packageManager": "[email protected]",
5+
"description": "Bundles MCP servers and clients into a single executable",
6+
"license": "MIT",
7+
"keywords": [
8+
"mcp",
9+
"bundler",
10+
"mcp-bundler",
11+
"mcp-bundler"
12+
],
13+
"main": "src/index.ts",
14+
"publishConfig": {
15+
"import": "dist/index.mjs",
16+
"require": "dist/index.js",
17+
"types": "dist/index.d.ts",
18+
"access": "public"
19+
},
620
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
21+
"test": "vitest",
22+
"build": "tsup"
23+
},
24+
"dependencies": {
25+
"commander": "^13.1.0"
826
},
9-
"keywords": [],
10-
"author": "",
11-
"license": "ISC",
12-
"packageManager": "[email protected]",
1327
"devDependencies": {
14-
"@modelcontextprotocol/sdk": "^1.9.0",
28+
"@modelcontextprotocol/sdk": "^1.10.1",
1529
"@types/node": "^22.14.1",
1630
"@wrtnlabs/eslint-config": "^0.4.3",
1731
"eslint": "^9.24.0",
1832
"eslint-plugin-format": "^1.0.1",
33+
"jiti": "^2.4.2",
34+
"tsup": "^8.4.0",
1935
"typescript": "^5.8.3",
2036
"vitest": "^3.1.1"
2137
}

0 commit comments

Comments
 (0)