Skip to content

Commit be2e264

Browse files
committed
proof of concept: v2 monorepo, package split
1 parent 06a4fd2 commit be2e264

File tree

106 files changed

+31372
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+31372
-0
lines changed

common/tsconfig/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "@modelcontextprotocol/tsconfig",
3+
"private": true,
4+
"main": "tsconfig.json",
5+
"type": "module",
6+
"dependencies": {
7+
"typescript": "catalog:"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/modelcontextprotocol/typescript-sdk.git"
12+
},
13+
"bugs": {
14+
"url": "https://github.com/modelcontextprotocol/typescript-sdk/issues"
15+
},
16+
"homepage": "https://github.com/modelcontextprotocol/typescript-sdk/tree/develop/common/ts-config",
17+
"publishConfig": {
18+
"registry": "https://npm.pkg.github.com/"
19+
},
20+
"version": "2.0.0"
21+
}

common/tsconfig/tsconfig.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2018",
4+
"module": "Node16",
5+
"moduleResolution": "Node16",
6+
"declaration": true,
7+
"declarationMap": true,
8+
"sourceMap": true,
9+
"outDir": "./dist",
10+
"strict": true,
11+
"esModuleInterop": true,
12+
"forceConsistentCasingInFileNames": true,
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
"skipLibCheck": true,
16+
"paths": {
17+
"pkce-challenge": ["./node_modules/pkce-challenge/dist/index.node"]
18+
},
19+
"types": ["node", "vitest/globals"]
20+
}
21+
}

common/tsconfig/vitest.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
export default defineConfig({
4+
test: {
5+
globals: true,
6+
environment: 'node',
7+
setupFiles: ['./vitest.setup.ts'],
8+
include: ['test/**/*.test.ts']
9+
}
10+
});

common/vitest-config/package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "@modelcontextprotocol/vitest-config",
3+
"private": true,
4+
"main": "tsconfig.json",
5+
"type": "module",
6+
"dependencies": {
7+
"typescript": "catalog:"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/modelcontextprotocol/typescript-sdk.git"
12+
},
13+
"bugs": {
14+
"url": "https://github.com/modelcontextprotocol/typescript-sdk/issues"
15+
},
16+
"homepage": "https://github.com/modelcontextprotocol/typescript-sdk/tree/develop/common/ts-config",
17+
"publishConfig": {
18+
"registry": "https://npm.pkg.github.com/"
19+
},
20+
"version": "2.0.0",
21+
"devDependencies": {
22+
"@modelcontextprotocol/tsconfig": "workspace:^"
23+
}
24+
}

common/vitest-config/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "@modelcontextprotocol/tsconfig",
3+
"include": ["./"],
4+
"exclude": ["node_modules", "dist"],
5+
"compilerOptions": {
6+
"baseUrl": "."
7+
}
8+
}

packages/client/package.json

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"name": "@modelcontextprotocol/sdk-client",
3+
"version": "2.0.0-alpha.0",
4+
"description": "Model Context Protocol implementation for TypeScript",
5+
"license": "MIT",
6+
"author": "Anthropic, PBC (https://anthropic.com)",
7+
"homepage": "https://modelcontextprotocol.io",
8+
"bugs": "https://github.com/modelcontextprotocol/typescript-sdk/issues",
9+
"type": "module",
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/modelcontextprotocol/typescript-sdk.git"
13+
},
14+
"engines": {
15+
"node": ">=18"
16+
},
17+
"keywords": [
18+
"modelcontextprotocol",
19+
"mcp"
20+
],
21+
"exports": {
22+
".": {
23+
"import": "./dist/index.js"
24+
}
25+
},
26+
"typesVersions": {
27+
"*": {
28+
"*": [
29+
"./dist/*"
30+
]
31+
}
32+
},
33+
"files": [
34+
"dist"
35+
],
36+
"scripts": {
37+
"fetch:spec-types": "tsx scripts/fetch-spec-types.ts",
38+
"typecheck": "tsgo --noEmit",
39+
"build": "npm run build:esm",
40+
"build:esm": "mkdir -p dist && echo '{\"type\": \"module\"}' > dist/package.json && tsc -p tsconfig.prod.json",
41+
"build:esm:w": "npm run build:esm -- -w",
42+
"examples:simple-server:w": "tsx --watch src/examples/server/simpleStreamableHttp.ts --oauth",
43+
"prepack": "npm run build:esm && npm run build:cjs",
44+
"lint": "eslint src/ && prettier --check .",
45+
"lint:fix": "eslint src/ --fix && prettier --write .",
46+
"check": "npm run typecheck && npm run lint",
47+
"test": "vitest run",
48+
"test:watch": "vitest",
49+
"start": "npm run server",
50+
"server": "tsx watch --clear-screen=false scripts/cli.ts server",
51+
"client": "tsx scripts/cli.ts client"
52+
},
53+
"dependencies": {
54+
"@modelcontextprotocol/shared": "workspace:^",
55+
"ajv": "^8.17.1",
56+
"ajv-formats": "^3.0.1",
57+
"content-type": "^1.0.5",
58+
"cors": "^2.8.5",
59+
"cross-spawn": "^7.0.5",
60+
"eventsource": "^3.0.2",
61+
"eventsource-parser": "^3.0.0",
62+
"express": "^5.0.1",
63+
"express-rate-limit": "^7.5.0",
64+
"jose": "^6.1.1",
65+
"json-schema-typed": "^8.0.2",
66+
"pkce-challenge": "^5.0.0",
67+
"raw-body": "^3.0.0",
68+
"zod": "^3.25 || ^4.0",
69+
"zod-to-json-schema": "^3.25.0"
70+
},
71+
"peerDependencies": {
72+
"@cfworker/json-schema": "^4.1.1",
73+
"zod": "^3.25 || ^4.0"
74+
},
75+
"peerDependenciesMeta": {
76+
"@cfworker/json-schema": {
77+
"optional": true
78+
},
79+
"zod": {
80+
"optional": false
81+
}
82+
},
83+
"devDependencies": {
84+
"@modelcontextprotocol/tsconfig": "workspace:^",
85+
"@modelcontextprotocol/vitest-config": "workspace:^",
86+
"@cfworker/json-schema": "^4.1.1",
87+
"@eslint/js": "^9.39.1",
88+
"@types/content-type": "^1.1.8",
89+
"@types/cors": "^2.8.17",
90+
"@types/cross-spawn": "^6.0.6",
91+
"@types/eventsource": "^1.1.15",
92+
"@types/express": "^5.0.0",
93+
"@types/express-serve-static-core": "^5.1.0",
94+
"@types/node": "^22.12.0",
95+
"@types/supertest": "^6.0.2",
96+
"@types/ws": "^8.5.12",
97+
"@typescript/native-preview": "^7.0.0-dev.20251103.1",
98+
"eslint": "^9.8.0",
99+
"eslint-config-prettier": "^10.1.8",
100+
"eslint-plugin-n": "^17.23.1",
101+
"prettier": "3.6.2",
102+
"supertest": "^7.0.0",
103+
"tsx": "^4.16.5",
104+
"typescript": "^5.5.4",
105+
"typescript-eslint": "^8.48.1",
106+
"vitest": "^4.0.8",
107+
"ws": "^8.18.0"
108+
}
109+
}

0 commit comments

Comments
 (0)