@shuji-bonji/rxjs-mcp 0.4.1 → 0.5.0
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/CHANGELOG.md +27 -0
- package/README.ja.md +11 -0
- package/README.md +12 -0
- package/dist/index.js +34 -89
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +11 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +67 -0
- package/dist/server.js.map +1 -0
- package/dist/types.d.ts +2 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.5.0] - 2026-09-02
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **MCP TypeScript SDK を v1 から v2 へ移行** — 依存を `@modelcontextprotocol/sdk@^1.25.0` から `@modelcontextprotocol/server@^2.0.0` に差し替えた。v1 の単一パッケージは v2 で `server` / `client` / `core` / フレームワーク別アダプタに分割され、`@modelcontextprotocol/sdk/server/index.js` のような深いパスは解決しなくなった。本サーバーは stdio 専用なので `@modelcontextprotocol/server` 1 つで足りる。
|
|
13
|
+
- **stdio の起動を `serveStdio(factory)` に変更** — `new Server(...)` + `new StdioServerTransport()` + `server.connect(transport)` の手組みをやめた。`serveStdio` は transport とプロトコル世代の決定を持ち、接続ごとに factory から 1 インスタンスを固定する。返る `StdioServerHandle.close()` を SIGINT / SIGTERM のハンドラに置いた。
|
|
14
|
+
- **ツール登録を `registerTool()` に変更** — `setRequestHandler(ListToolsRequestSchema, ...)` と `setRequestHandler(CallToolRequestSchema, ...)` の 2 本立て、および `toolHandlers` の表引きを廃止し、6 ツールを `server.registerTool(name, config, handler)` で登録する。未知のツール名の判定と入力スキーマの検証は SDK 側が行うため、`McpError` / `ErrorCode` の使用箇所は無くなった。
|
|
15
|
+
- **`zod` を `^3.23.0` から `^4.2.0` へ** — v2 は zod 3 を受け付けない。zod 3 のままでも `npm install` も `tsc` も通り、サーバーは起動して接続まで成功するが、最初の `tools/list` が `fromJsonSchema()` を指すエラーを返す。型検査でもユニットテストでも捕まらない経路のため、宣言レンジごと更新した。4.0〜4.1 では変換に SDK 内蔵の zod が使われ、`.describe()` の説明文が JSON Schema から消えるため、下限は 4.2.0 以上が必要。
|
|
16
|
+
- **`zod-to-json-schema` を削除** — v2 は `inputSchema` に渡された zod オブジェクト(Standard Schema)から JSON Schema を生成する。`zodToJsonSchema(schema, { target: 'openApi3' })` の呼び出しは不要になった。実行時依存は 4 個から 2 個 (`@modelcontextprotocol/server`, `rxjs`, `zod`) に減った。
|
|
17
|
+
- **`ToolResponse` を interface から型エイリアスへ** — v2 のツール結果型は `_meta` の通過のために `[x: string]: unknown` を持つ。暗黙のインデックスシグネチャが付くのは型エイリアスだけで、interface のままでは `registerTool` のコールバック型に一致しない。
|
|
18
|
+
- **`ToolDefinition.outputSchema` を削除** — どのツールも宣言しておらず、v1 では `tools/list` に `undefined` が乗っているだけだった。v2 では登録側から渡さないため、残すと「書いても効かないフィールド」になる。`structuredContent` を返すかどうかは別途決める。
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **`src/server.ts`** — `createServer(): McpServer` を `src/index.ts` から切り出して export した。stdio の入口が `serveStdio` に渡す factory であると同時に、プロトコルテストが `createMcpHandler` 経由でプロセス内から叩く対象でもある。`src/index.ts` は stdio の起動とシャットダウンだけになった。
|
|
23
|
+
- **`instructions`** — `initialize` の応答としてクライアントへ返す射程の宣言を追加した。README はモデルが読まず、ツールの `description` はそのツールを検討する時点まで読まれない。`instructions` はツールを 1 つも呼ばないうちにクライアントのシステムコンテキストに載る。書いたのは「しないこと」で、(1) `execute_stream` は RxJS 以外のモジュールを持たない worker で動くため呼び出し元のプロジェクトのコードは動かない、(2) `lint_rxjs` と `detect_memory_leak` は型情報を持たない正規表現照合であり、指摘が 0 件であることはコードが正しいことの証拠にならない、(3) `analyze_operators` / `suggest_pattern` が参照するのは RxJS 7.8.2 に固定した同梱データで、報告されないオペレーターは「データに無い」であって「RxJS に無い」ではない、の 3 点。
|
|
24
|
+
- **`src/server.test.ts`** — 実物の `Client` を in-process で繋いで検証する 6 ケース。`tools/list` が 6 ツールを JSON Schema 付きで返すこと、`.describe()` の説明文が残ること、`annotations` が届くこと、`instructions` が `initialize` の応答に載ること、`z.enum` が拒否する引数がハンドラ到達前に `isError: true` で返ること、`tools/call` で実際にストリームが動くことを見る。zod 変換の失敗は `tsc` でも既存のユニットテストでも検出できないため、このファイルが移行の合格基準を担う。
|
|
25
|
+
- **`@modelcontextprotocol/client`** を devDependencies に追加(上記テスト用。実行時依存ではない)。
|
|
26
|
+
- **`.claude-plugin/plugin.json`** — shuji-bonji marketplace から `/plugin install` できるようにした。`mcpServers` のキーは `rxjs` で、`npx -y @shuji-bonji/rxjs-mcp@latest` を起動する。`claude_desktop_config.json` に手で書いていた設定と同じキー名なので、プラグイン経由に切り替えてもツール名は変わらない。
|
|
27
|
+
|
|
28
|
+
### Compatibility
|
|
29
|
+
|
|
30
|
+
- MCP クライアントから見た挙動は変わらない。ツール名 6 つ、入力スキーマ、`annotations`、返すテキストのいずれも変更なし。
|
|
31
|
+
- `serveStdio` は既定で 2025 世代のプロトコル改訂を話すクライアントも同じ factory から serve する(`legacy: 'serve'`)。`protocolVersion: '2024-11-05'` で `initialize` する既存の統合テスト(`src/tools/mcp-integration.test.ts` の 8 件、`test-mcp-server.mjs` の 7 件)は、いずれも `dist/index.js` を実際に spawn したまま無修正で通る。
|
|
32
|
+
- Node.js 要件は `>=22.0.0` のまま(v2 の下限は 20)。CI の Node 22 / 24 のマトリクスも変更なし。
|
|
33
|
+
- 各ツールのハンドラ内に残っている `inputSchema.parse(args)` は、SDK 側の検証と二重になる。ユニットテストがハンドラを直接呼び、`takeCount` や `timeout` の既定値をこの `parse` から得ているため残した。
|
|
34
|
+
|
|
8
35
|
## [0.4.1] - 2026-05-17
|
|
9
36
|
|
|
10
37
|
### Changed
|
package/README.ja.md
CHANGED
|
@@ -70,6 +70,11 @@ ClaudeなどのAIアシスタントから直接RxJSストリームを実行、
|
|
|
70
70
|
|
|
71
71
|
## インストール
|
|
72
72
|
|
|
73
|
+
### 必要環境
|
|
74
|
+
|
|
75
|
+
- **Node.js >= 22**(`engines.node`)。本サーバーが使う MCP TypeScript SDK v2 の
|
|
76
|
+
要件は Node.js >= 20 だが、メンテナンス中の LTS に揃えるため上限側に寄せている。
|
|
77
|
+
|
|
73
78
|
```bash
|
|
74
79
|
# グローバルインストール
|
|
75
80
|
npm install -g @shuji-bonji/rxjs-mcp
|
|
@@ -335,6 +340,12 @@ RxJS MCP Serverは以下と組み合わせて使用できます:
|
|
|
335
340
|
└─────────────────┘
|
|
336
341
|
```
|
|
337
342
|
|
|
343
|
+
本サーバーは **MCP TypeScript SDK v2**
|
|
344
|
+
(`@modelcontextprotocol/server@^2.0.0`、プロトコル改訂 2026-07-28) の上に構築している。
|
|
345
|
+
トランスポートは stdio のみで、`src/index.ts` が `src/server.ts` の `createServer()`
|
|
346
|
+
ファクトリを `serveStdio()` に渡す。`serveStdio()` は 2025 世代のプロトコル改訂を話す
|
|
347
|
+
クライアントも同じファクトリから serve する。
|
|
348
|
+
|
|
338
349
|
## コントリビューション
|
|
339
350
|
|
|
340
351
|
コントリビューションを歓迎します!お気軽にPRを送ってください。
|
package/README.md
CHANGED
|
@@ -71,6 +71,12 @@ Execute, debug, and visualize RxJS streams directly from AI assistants like Clau
|
|
|
71
71
|
|
|
72
72
|
## Installation
|
|
73
73
|
|
|
74
|
+
### Requirements
|
|
75
|
+
|
|
76
|
+
- **Node.js >= 22** (`engines.node`). The MCP TypeScript SDK v2 this server is
|
|
77
|
+
built on requires Node.js >= 20; this package sets the higher floor to stay on
|
|
78
|
+
a maintained LTS line.
|
|
79
|
+
|
|
74
80
|
```bash
|
|
75
81
|
# Install globally
|
|
76
82
|
npm install -g @shuji-bonji/rxjs-mcp
|
|
@@ -358,6 +364,12 @@ Future Meta-MCP integration will allow seamless coordination between these tools
|
|
|
358
364
|
└─────────────────┘
|
|
359
365
|
```
|
|
360
366
|
|
|
367
|
+
The server is built on the **MCP TypeScript SDK v2**
|
|
368
|
+
(`@modelcontextprotocol/server@^2.0.0`, protocol revision 2026-07-28). It speaks
|
|
369
|
+
stdio only: `src/index.ts` hands the `createServer()` factory in `src/server.ts`
|
|
370
|
+
to `serveStdio()`, which also serves clients that still speak the 2025 protocol
|
|
371
|
+
revisions.
|
|
372
|
+
|
|
361
373
|
## Documentation Reference System
|
|
362
374
|
|
|
363
375
|
Since v0.3.0, `analyze_operators` outputs three-tier documentation links for each operator and creation function:
|
package/dist/index.js
CHANGED
|
@@ -1,102 +1,47 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const tools = [
|
|
27
|
-
executeStreamTool.definition,
|
|
28
|
-
generateMarbleTool.definition,
|
|
29
|
-
analyzeOperatorsTool.definition,
|
|
30
|
-
detectMemoryLeakTool.definition,
|
|
31
|
-
suggestPatternTool.definition,
|
|
32
|
-
lintRxjsTool.definition,
|
|
33
|
-
];
|
|
34
|
-
// Tool handlers mapping
|
|
35
|
-
const toolHandlers = {
|
|
36
|
-
'execute_stream': executeStreamTool.handler,
|
|
37
|
-
'generate_marble': generateMarbleTool.handler,
|
|
38
|
-
'analyze_operators': analyzeOperatorsTool.handler,
|
|
39
|
-
'detect_memory_leak': detectMemoryLeakTool.handler,
|
|
40
|
-
'suggest_pattern': suggestPatternTool.handler,
|
|
41
|
-
'lint_rxjs': lintRxjsTool.handler,
|
|
42
|
-
};
|
|
43
|
-
// Handle list tools request
|
|
44
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
45
|
-
return {
|
|
46
|
-
tools: tools.map(tool => ({
|
|
47
|
-
name: tool.name,
|
|
48
|
-
description: tool.description,
|
|
49
|
-
inputSchema: zodToJsonSchema(tool.inputSchema, { target: 'openApi3' }),
|
|
50
|
-
outputSchema: tool.outputSchema,
|
|
51
|
-
annotations: tool.annotations,
|
|
52
|
-
})),
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
// Handle tool execution request
|
|
56
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
57
|
-
const { name, arguments: args } = request.params;
|
|
58
|
-
const handler = toolHandlers[name];
|
|
59
|
-
if (!handler) {
|
|
60
|
-
throw new McpError(ErrorCode.MethodNotFound, `Tool "${name}" not found. Available tools: ${Object.keys(toolHandlers).join(', ')}`);
|
|
61
|
-
}
|
|
2
|
+
import { serveStdio } from '@modelcontextprotocol/server/stdio';
|
|
3
|
+
import { createServer, SERVER_NAME, SERVER_VERSION } from './server.js';
|
|
4
|
+
/**
|
|
5
|
+
* Handle returned by `serveStdio`. Closed on shutdown so the transport is torn
|
|
6
|
+
* down before the process exits.
|
|
7
|
+
*/
|
|
8
|
+
let stdioHandle;
|
|
9
|
+
/**
|
|
10
|
+
* Start the server on stdio.
|
|
11
|
+
*
|
|
12
|
+
* `serveStdio` owns the transport and the protocol era decision: the opening
|
|
13
|
+
* exchange selects the era, one instance from the factory is pinned for the
|
|
14
|
+
* lifetime of the connection, and clients speaking the 2025 revisions are
|
|
15
|
+
* served from the same factory (`legacy: 'serve'` is the default).
|
|
16
|
+
*/
|
|
17
|
+
function runStdio() {
|
|
18
|
+
stdioHandle = serveStdio(() => createServer(), {
|
|
19
|
+
onerror: (error) => console.error(`stdio transport error: ${error.message}`),
|
|
20
|
+
});
|
|
21
|
+
// stdout is the JSON-RPC channel, so every log line goes to stderr.
|
|
22
|
+
console.error(`${SERVER_NAME} v${SERVER_VERSION} running on stdio`);
|
|
23
|
+
}
|
|
24
|
+
async function gracefulShutdown(signal) {
|
|
25
|
+
console.error(`Received ${signal}, shutting down RxJS MCP Server...`);
|
|
62
26
|
try {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
content: result.content,
|
|
66
|
-
};
|
|
27
|
+
await stdioHandle?.close();
|
|
28
|
+
process.exit(0);
|
|
67
29
|
}
|
|
68
30
|
catch (error) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
73
|
-
throw new McpError(ErrorCode.InternalError, `Tool "${name}" failed: ${errorMessage}`);
|
|
31
|
+
console.error('Shutdown error:', error);
|
|
32
|
+
process.exit(1);
|
|
74
33
|
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
34
|
+
}
|
|
35
|
+
function main() {
|
|
36
|
+
process.on('SIGINT', () => void gracefulShutdown('SIGINT'));
|
|
37
|
+
process.on('SIGTERM', () => void gracefulShutdown('SIGTERM'));
|
|
79
38
|
try {
|
|
80
|
-
|
|
81
|
-
console.error('RxJS MCP Server started successfully');
|
|
39
|
+
runStdio();
|
|
82
40
|
}
|
|
83
41
|
catch (error) {
|
|
84
42
|
console.error('Failed to start RxJS MCP Server:', error);
|
|
85
43
|
process.exit(1);
|
|
86
44
|
}
|
|
87
45
|
}
|
|
88
|
-
|
|
89
|
-
process.on('SIGINT', async () => {
|
|
90
|
-
console.error('Shutting down RxJS MCP Server...');
|
|
91
|
-
process.exit(0);
|
|
92
|
-
});
|
|
93
|
-
process.on('SIGTERM', async () => {
|
|
94
|
-
console.error('Shutting down RxJS MCP Server...');
|
|
95
|
-
process.exit(0);
|
|
96
|
-
});
|
|
97
|
-
// Run the server
|
|
98
|
-
main().catch((error) => {
|
|
99
|
-
console.error('Fatal error:', error);
|
|
100
|
-
process.exit(1);
|
|
101
|
-
});
|
|
46
|
+
main();
|
|
102
47
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAA0B,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAExE;;;GAGG;AACH,IAAI,WAA0C,CAAC;AAE/C;;;;;;;GAOG;AACH,SAAS,QAAQ;IACf,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,EAAE;QAC7C,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,0BAA0B,KAAK,CAAC,OAAO,EAAE,CAAC;KAC7E,CAAC,CAAC;IAEH,oEAAoE;IACpE,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,KAAK,cAAc,mBAAmB,CAAC,CAAC;AACtE,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,MAAc;IAC5C,OAAO,CAAC,KAAK,CAAC,YAAY,MAAM,oCAAoC,CAAC,CAAC;IACtE,IAAI,CAAC;QACH,MAAM,WAAW,EAAE,KAAK,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,IAAI;IACX,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;IAE9D,IAAI,CAAC;QACH,QAAQ,EAAE,CAAC;IACb,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
export declare const SERVER_NAME = "rxjs-mcp";
|
|
3
|
+
export declare const SERVER_VERSION: string;
|
|
4
|
+
/**
|
|
5
|
+
* Create and configure the MCP server.
|
|
6
|
+
*
|
|
7
|
+
* This is the factory the stdio entry point hands to `serveStdio`, and the
|
|
8
|
+
* same factory the protocol tests drive in-process through `createMcpHandler`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createServer(): McpServer;
|
|
11
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAczD,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC,eAAO,MAAM,cAAc,QAAU,CAAC;AAoCtC;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAsBxC"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { executeStreamTool } from './tools/execute-stream.js';
|
|
4
|
+
import { generateMarbleTool } from './tools/marble-diagram.js';
|
|
5
|
+
import { analyzeOperatorsTool } from './tools/analyze-operators.js';
|
|
6
|
+
import { detectMemoryLeakTool } from './tools/memory-leak.js';
|
|
7
|
+
import { suggestPatternTool } from './tools/suggest-pattern.js';
|
|
8
|
+
import { lintRxjsTool } from './tools/lint-rxjs.js';
|
|
9
|
+
import { RXJS_VERSION_TAG } from './types.js';
|
|
10
|
+
// Read version from package.json (single source of truth)
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
const { version } = require('../package.json');
|
|
13
|
+
export const SERVER_NAME = 'rxjs-mcp';
|
|
14
|
+
export const SERVER_VERSION = version;
|
|
15
|
+
/**
|
|
16
|
+
* Returned to the client in the `initialize` response, so it is read before
|
|
17
|
+
* any tool is chosen — earlier than the README and earlier than any tool
|
|
18
|
+
* description. What it has to prevent is this server being read as an
|
|
19
|
+
* authority on the caller's project: `execute_stream` runs a snippet in a
|
|
20
|
+
* worker that has RxJS and nothing else, `lint_rxjs` and `detect_memory_leak`
|
|
21
|
+
* match text rather than types, and the operator data is a bundled snapshot
|
|
22
|
+
* rather than a live view of rxjs.dev. Each of those reads as a general
|
|
23
|
+
* capability when only the tool names are seen.
|
|
24
|
+
*/
|
|
25
|
+
const INSTRUCTIONS = [
|
|
26
|
+
'This server executes and inspects RxJS snippets in isolation. It does NOT run the caller\'s project.',
|
|
27
|
+
'',
|
|
28
|
+
'What it does NOT do:',
|
|
29
|
+
`- It does not read, write, or import files from the caller's workspace. execute_stream evaluates the snippet in a worker thread whose only module is RxJS ${RXJS_VERSION_TAG} — no DOM, no network, no project dependencies. A snippet that imports from the project will not run here.`,
|
|
30
|
+
'- lint_rxjs and detect_memory_leak match source text with regular expressions. They have no type information, so they do not replace running eslint-plugin-rxjs-x in the project, and a result with no findings is not evidence that the code is correct.',
|
|
31
|
+
`- analyze_operators and suggest_pattern read a bundled dataset pinned to RxJS ${RXJS_VERSION_TAG}. An operator this server does not report is an operator the dataset does not carry, NOT an operator that does not exist in RxJS.`,
|
|
32
|
+
'- It does not fetch rxjs.dev at call time. The Official / Source / Guide links in the output are built from the operator name.',
|
|
33
|
+
'',
|
|
34
|
+
'Tool results carry links to rxjs.dev (authoritative, for humans), the pinned GitHub source (JSDoc and implementation, readable by a model), and a bilingual guide. Follow the source link when the exact semantics of an operator decide the answer.',
|
|
35
|
+
].join('\n');
|
|
36
|
+
/**
|
|
37
|
+
* Every tool this server exposes, in the order they are advertised.
|
|
38
|
+
*/
|
|
39
|
+
const tools = [
|
|
40
|
+
executeStreamTool,
|
|
41
|
+
generateMarbleTool,
|
|
42
|
+
analyzeOperatorsTool,
|
|
43
|
+
detectMemoryLeakTool,
|
|
44
|
+
suggestPatternTool,
|
|
45
|
+
lintRxjsTool,
|
|
46
|
+
];
|
|
47
|
+
/**
|
|
48
|
+
* Create and configure the MCP server.
|
|
49
|
+
*
|
|
50
|
+
* This is the factory the stdio entry point hands to `serveStdio`, and the
|
|
51
|
+
* same factory the protocol tests drive in-process through `createMcpHandler`.
|
|
52
|
+
*/
|
|
53
|
+
export function createServer() {
|
|
54
|
+
const server = new McpServer({
|
|
55
|
+
name: SERVER_NAME,
|
|
56
|
+
version: SERVER_VERSION,
|
|
57
|
+
}, { instructions: INSTRUCTIONS });
|
|
58
|
+
for (const { definition, handler } of tools) {
|
|
59
|
+
server.registerTool(definition.name, {
|
|
60
|
+
description: definition.description,
|
|
61
|
+
inputSchema: definition.inputSchema,
|
|
62
|
+
annotations: definition.annotations,
|
|
63
|
+
}, async (args) => handler(args));
|
|
64
|
+
}
|
|
65
|
+
return server;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js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B;QACE,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,cAAc;KACxB,EACD,EAAE,YAAY,EAAE,YAAY,EAAE,CAC/B,CAAC;IAEF,KAAK,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,KAAK,EAAE,CAAC;QAC5C,MAAM,CAAC,YAAY,CACjB,UAAU,CAAC,IAAI,EACf;YACE,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,WAAW,EAAE,UAAU,CAAC,WAAW;SACpC,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAC9B,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export
|
|
2
|
+
export type ToolResponse = {
|
|
3
3
|
content: Array<{
|
|
4
4
|
type: 'text';
|
|
5
5
|
text: string;
|
|
6
6
|
}>;
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
export type ToolHandler = (args: unknown) => Promise<ToolResponse>;
|
|
9
9
|
export interface ToolDefinition {
|
|
10
10
|
name: string;
|
|
11
11
|
description: string;
|
|
12
12
|
inputSchema: z.ZodType<any>;
|
|
13
|
-
outputSchema?: any;
|
|
14
13
|
annotations?: {
|
|
15
14
|
readOnlyHint?: boolean;
|
|
16
15
|
destructiveHint?: boolean;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,MAAM,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ED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA0DA,+CAA+C;AAC/C,gBAAgB;AAChB,+CAA+C;AAE/C,qEAAqE;AACrE,MAAM,CAAC,MAAM,cAAc,GAAG,6EAA6E,CAAC;AAE5G,wFAAwF;AACxF,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAEpD,wFAAwF;AACxF,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,MAAM,CAAC,MAAM,eAAe,GAAG,0CAA0C,gBAAgB,eAAe,CAAC;AAGzG,+CAA+C;AAC/C,cAAc;AACd,+CAA+C;AAE/C,uEAAuE;AACvE,MAAM,UAAU,gBAAgB,CAAC,IAA6B,EAAE,IAAY;IAC1E,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACxB,OAAO,GAAG,iBAAiB,uBAAuB,IAAI,EAAE,CAAC;IAC3D,CAAC;IACD,OAAO,GAAG,iBAAiB,kBAAkB,IAAI,EAAE,CAAC;AACtD,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,GAAG,eAAe,IAAI,IAAI,EAAE,CAAC;AACtC,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,GAAG,cAAc,IAAI,IAAI,KAAK,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuji-bonji/rxjs-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "RxJS MCP Server - Execute, debug, and visualize RxJS streams for AI assistants",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"prepare": "npm run build"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@modelcontextprotocol/
|
|
55
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
56
56
|
"rxjs": "^7.8.2",
|
|
57
|
-
"zod": "^
|
|
58
|
-
"zod-to-json-schema": "^3.25.0"
|
|
57
|
+
"zod": "^4.2.0"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
60
|
"@eslint/js": "^9.0.0",
|
|
61
|
+
"@modelcontextprotocol/client": "^2.0.0",
|
|
62
62
|
"@types/node": "^20.19.27",
|
|
63
63
|
"eslint": "^9.0.0",
|
|
64
64
|
"eslint-plugin-rxjs-x": "^0.7.0",
|