Initial project structure for MCP interceptors (#3)
Establishes a multi-language monorepo structure for MCP interceptors with Python and TypeScript SDKs alongside the existing Go implementation. Implements an efficient CI/CD system that only tests what changes. #### 🏗️ SDK Scaffolding - **Python SDK** (`python/sdk/`): Modern Python package using `pyproject.toml`, aligned with official MCP Python SDK patterns - **TypeScript SDK** (`typescript/sdk/`): ESM-based package structure, compatible with official MCP TypeScript SDK - **Monorepo structure**: Consistent `{language}/sdk/` pattern across all implementations #### 🚀 CI/CD Pipeline - **Path-based workflow triggering**: Only runs CI for languages that actually changed - Change Python → only Python CI runs - Change multiple languages → only those CIs run - **Status check workflow**: Single required check that dynamically validates based on changes - **Comment triggers**: Maintainers can run all checks with `/test all` PR comment
This commit is contained in:
parent
dd925ba134
commit
20974b6fa0
9 changed files with 900 additions and 3 deletions
24
typescript/sdk/.eslintrc.json
Normal file
24
typescript/sdk/.eslintrc.json
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module",
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
||||
],
|
||||
"env": {
|
||||
"node": true,
|
||||
"es2022": true
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/explicit-module-boundary-types": "error",
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
|
||||
}
|
||||
}
|
||||
1
typescript/sdk/.nvmrc
Normal file
1
typescript/sdk/.nvmrc
Normal file
|
|
@ -0,0 +1 @@
|
|||
20
|
||||
40
typescript/sdk/README.md
Normal file
40
typescript/sdk/README.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# MCP Interceptors TypeScript SDK
|
||||
|
||||
TypeScript implementation of the Model Context Protocol (MCP) interceptor framework.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @ext-modelcontextprotocol/interceptors
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```typescript
|
||||
import { Interceptor } from '@ext-modelcontextprotocol/interceptors';
|
||||
|
||||
// The MCP SDK is available as a peer dependency
|
||||
import { Client, Server } from '@modelcontextprotocol/sdk';
|
||||
|
||||
// Example usage will be added as the implementation progresses
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
# Build
|
||||
npm run build
|
||||
|
||||
# Run tests
|
||||
npm test
|
||||
|
||||
# Lint
|
||||
npm run lint
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Apache License 2.0 - See LICENSE file in the root directory for details.
|
||||
56
typescript/sdk/package.json
Normal file
56
typescript/sdk/package.json
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
"name": "@ext-modelcontextprotocol/interceptors",
|
||||
"version": "0.1.0",
|
||||
"description": "TypeScript SDK for Model Context Protocol interceptors",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"lint": "eslint src --ext .ts",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"keywords": [
|
||||
"mcp",
|
||||
"model-context-protocol",
|
||||
"interceptors"
|
||||
],
|
||||
"author": "The MCP Interceptors Authors",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/modelcontextprotocol/ext-interceptors.git",
|
||||
"directory": "typescript/sdk"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/modelcontextprotocol/ext-interceptors/issues"
|
||||
},
|
||||
"homepage": "https://github.com/modelcontextprotocol/ext-interceptors",
|
||||
"files": [
|
||||
"dist",
|
||||
"src",
|
||||
"README.md"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0",
|
||||
"eslint": "^8.0.0",
|
||||
"typescript": "^5.0.0",
|
||||
"vitest": "^2.0.0"
|
||||
}
|
||||
}
|
||||
12
typescript/sdk/src/index.ts
Normal file
12
typescript/sdk/src/index.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2025 The MCP Interceptors Authors. All rights reserved.
|
||||
// Use of this source code is governed by a Apache-2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* MCP Interceptors TypeScript SDK
|
||||
*
|
||||
* Implements MCP Interceptors based on SEP-1763:
|
||||
* https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1763
|
||||
*/
|
||||
|
||||
export * from './interceptors.js';
|
||||
11
typescript/sdk/src/interceptors.test.ts
Normal file
11
typescript/sdk/src/interceptors.test.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2025 The MCP Interceptors Authors. All rights reserved.
|
||||
// Use of this source code is governed by a Apache-2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
describe('Interceptors', () => {
|
||||
it('should be defined', () => {
|
||||
expect(true).toBe(true);
|
||||
});
|
||||
});
|
||||
12
typescript/sdk/src/interceptors.ts
Normal file
12
typescript/sdk/src/interceptors.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2025 The MCP Interceptors Authors. All rights reserved.
|
||||
// Use of this source code is governed by a Apache-2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* Core interceptor functionality for MCP
|
||||
*
|
||||
* Based on SEP-1763:
|
||||
* https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1763
|
||||
*/
|
||||
|
||||
// Placeholder for interceptor implementation
|
||||
22
typescript/sdk/tsconfig.json
Normal file
22
typescript/sdk/tsconfig.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "NodeNext",
|
||||
"lib": ["esnext"],
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"moduleResolution": "NodeNext",
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
10
typescript/sdk/vitest.config.js
Normal file
10
typescript/sdk/vitest.config.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
include: ['src/**/*.test.ts', 'test/**/*.test.ts'],
|
||||
exclude: ['**/node_modules/**', '**/dist/**']
|
||||
}
|
||||
});
|
||||
Loading…
Reference in a new issue