@rsconcept/rstool-mcp 0.3.0 → 0.3.1
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/README.md +3 -2
- package/dist/bin/server.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{server-CWm4FZFL.js → server-CM8yRC3G.js} +11 -1
- package/dist/server-CM8yRC3G.js.map +1 -0
- package/package.json +2 -2
- package/src/server.test.ts +1 -0
- package/src/tools.ts +10 -0
- package/dist/server-CWm4FZFL.js.map +0 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ Restart Cursor; the tools appear under the **rstool** server. Pin a version if y
|
|
|
44
44
|
"mcpServers": {
|
|
45
45
|
"rstool": {
|
|
46
46
|
"command": "npx",
|
|
47
|
-
"args": ["-y", "@rsconcept/rstool-mcp@0.
|
|
47
|
+
"args": ["-y", "@rsconcept/rstool-mcp@0.3.0"],
|
|
48
48
|
"env": {
|
|
49
49
|
"RSTOOL_PERSISTENCE_DIR": "C:/path/to/rstool-sessions"
|
|
50
50
|
}
|
|
@@ -79,6 +79,7 @@ Edit `claude_desktop_config.json` (`~/Library/Application Support/Claude/` on ma
|
|
|
79
79
|
| `ensure_session` | `ensureSession` | Return active session or create one. |
|
|
80
80
|
| `create_session` | `createSession` | Optional `initial` seed. |
|
|
81
81
|
| `set_current_session` | `setCurrentSession` | Switch active session. |
|
|
82
|
+
| `get_current_session` | `getCurrentSession` | Current session handle, or `null`. |
|
|
82
83
|
| `apply_schema_patch` | `applySchemaPatch` | Primary schema edit path. |
|
|
83
84
|
| `get_session_state` | `getSessionState` | `detail=summary` (default) or `full`. |
|
|
84
85
|
| `analyze_expression` | `analyzeExpression` | Scratch analysis. |
|
|
@@ -117,7 +118,7 @@ const tool = new RSToolAgent();
|
|
|
117
118
|
const server = buildRSToolMcpServer({
|
|
118
119
|
tool,
|
|
119
120
|
name: "my-rstool-mcp",
|
|
120
|
-
version: "0.
|
|
121
|
+
version: "0.3.0",
|
|
121
122
|
});
|
|
122
123
|
```
|
|
123
124
|
|
package/dist/bin/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as buildRSToolMcpServer } from "../server-
|
|
2
|
+
import { t as buildRSToolMcpServer } from "../server-CM8yRC3G.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
//#region src/bin/server.ts
|
|
5
5
|
async function main() {
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TOOL_DEFINITIONS, t as buildRSToolMcpServer } from "./server-
|
|
1
|
+
import { n as TOOL_DEFINITIONS, t as buildRSToolMcpServer } from "./server-CM8yRC3G.js";
|
|
2
2
|
export { TOOL_DEFINITIONS, buildRSToolMcpServer };
|
|
@@ -99,6 +99,16 @@ const TOOL_DEFINITIONS = [
|
|
|
99
99
|
},
|
|
100
100
|
invoke: (tool, args) => tool.setCurrentSession(String(args.sessionId))
|
|
101
101
|
},
|
|
102
|
+
{
|
|
103
|
+
name: "get_current_session",
|
|
104
|
+
description: "Return the current active session, or null if none exists.",
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: "object",
|
|
107
|
+
properties: {},
|
|
108
|
+
additionalProperties: false
|
|
109
|
+
},
|
|
110
|
+
invoke: (tool) => tool.getCurrentSession()
|
|
111
|
+
},
|
|
102
112
|
{
|
|
103
113
|
name: "apply_schema_patch",
|
|
104
114
|
description: "Preferred schema edit path. Batch patch with inferred ids and cstType, dependency ordering, and compact summary.",
|
|
@@ -359,4 +369,4 @@ function buildRSToolMcpServer(options = {}) {
|
|
|
359
369
|
//#endregion
|
|
360
370
|
export { TOOL_DEFINITIONS as n, buildRSToolMcpServer as t };
|
|
361
371
|
|
|
362
|
-
//# sourceMappingURL=server-
|
|
372
|
+
//# sourceMappingURL=server-CM8yRC3G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-CM8yRC3G.js","names":[],"sources":["../src/tools.ts","../src/server.ts"],"sourcesContent":["/**\n * MCP tool definitions for the @rsconcept/rstool contract.\n */\n\nimport { type RSToolAgent } from \"@rsconcept/rstool\";\n\nexport interface ToolDefinition {\n name: string;\n description: string;\n inputSchema: {\n type: \"object\";\n properties: Record<string, unknown>;\n required?: string[];\n additionalProperties?: boolean;\n };\n invoke: (\n tool: RSToolAgent,\n args: Record<string, unknown>,\n ) => unknown | Promise<unknown>;\n}\n\nconst sessionId = {\n type: \"string\",\n description: \"Session id. Omit to use the current active session.\",\n};\n\nconst agentPatchSchema = {\n type: \"object\",\n description:\n \"Agent-friendly constituent patch. id and cstType are optional; cstType is inferred from alias prefixes X/C/S/D/A/F/P.\",\n properties: {\n id: { type: \"number\" },\n alias: { type: \"string\" },\n cstType: { type: \"string\" },\n definitionFormal: { type: \"string\" },\n term: { type: \"string\" },\n definitionText: { type: \"string\" },\n convention: { type: \"string\" },\n },\n required: [\"alias\"],\n};\n\nfunction optionalSessionId(args: Record<string, unknown>): string | undefined {\n const value = args.sessionId;\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n\nfunction omitSessionId(args: Record<string, unknown>): Record<string, unknown> {\n const { sessionId: _sessionId, ...rest } = args;\n return rest;\n}\n\nexport const TOOL_DEFINITIONS: ToolDefinition[] = [\n {\n name: \"ping\",\n description:\n \"Liveness check; returns {pong: true} and the active rstool contract version.\",\n inputSchema: {\n type: \"object\",\n properties: {},\n additionalProperties: false,\n },\n invoke: (tool) => ({ pong: true, contractVersion: tool.contractVersion }),\n },\n {\n name: \"list_methods\",\n description: \"List all rstool methods exposed as MCP tools.\",\n inputSchema: {\n type: \"object\",\n properties: {},\n additionalProperties: false,\n },\n invoke: () => TOOL_DEFINITIONS.map((definition) => definition.name),\n },\n {\n name: \"ensure_session\",\n description:\n \"Return the current active session, or create one if none exists. Optional initial seed is used only when creating.\",\n inputSchema: {\n type: \"object\",\n properties: {\n initial: {\n type: \"object\",\n properties: {\n alias: { type: \"string\" },\n title: { type: \"string\" },\n comment: { type: \"string\" },\n },\n additionalProperties: true,\n },\n },\n additionalProperties: false,\n },\n invoke: (tool, args) => tool.ensureSession(args.initial as never),\n },\n {\n name: \"create_session\",\n description:\n \"Create a fresh in-memory rstool session and set it as the current active session.\",\n inputSchema: {\n type: \"object\",\n properties: {\n initial: {\n type: \"object\",\n description:\n \"Optional partial SessionState seed (alias, title, comment).\",\n properties: {\n alias: { type: \"string\" },\n title: { type: \"string\" },\n comment: { type: \"string\" },\n },\n additionalProperties: false,\n },\n },\n additionalProperties: false,\n },\n invoke: (tool, args) => tool.createSession(args.initial as never),\n },\n {\n name: \"set_current_session\",\n description: \"Set the active session by id.\",\n inputSchema: {\n type: \"object\",\n properties: { sessionId },\n required: [\"sessionId\"],\n },\n invoke: (tool, args) => tool.setCurrentSession(String(args.sessionId)),\n },\n {\n name: \"get_current_session\",\n description: \"Return the current active session, or null if none exists.\",\n inputSchema: {\n type: \"object\",\n properties: {},\n additionalProperties: false,\n },\n invoke: (tool) => tool.getCurrentSession(),\n },\n {\n name: \"apply_schema_patch\",\n description:\n \"Preferred schema edit path. Batch patch with inferred ids and cstType, dependency ordering, and compact summary.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n initial: {\n type: \"object\",\n properties: {\n alias: { type: \"string\" },\n title: { type: \"string\" },\n comment: { type: \"string\" },\n },\n additionalProperties: true,\n },\n items: { type: \"array\", items: agentPatchSchema },\n mode: { type: \"string\", enum: [\"atomic\", \"best_effort\"] },\n commitMessage: { type: \"string\" },\n },\n required: [\"items\"],\n },\n invoke: (tool, args) =>\n tool.applySchemaPatch(\n omitSessionId(args) as never,\n optionalSessionId(args),\n ),\n },\n {\n name: \"get_session_state\",\n description:\n \"Return session state. detail=summary (default): compact metadata, aliases, diagnostics. detail=full: complete SessionState clone.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n detail: { type: \"string\", enum: [\"summary\", \"full\"] },\n },\n },\n invoke: (tool, args) =>\n tool.getSessionState(\n (args.detail as \"summary\" | \"full\" | undefined) ?? \"summary\",\n optionalSessionId(args),\n ),\n },\n {\n name: \"analyze_expression\",\n description:\n \"Parse and type-check a scratch expression without saving it. Does not record diagnostics unless recordDiagnostics=true.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n expression: { type: \"string\" },\n cstType: { type: \"string\" },\n recordDiagnostics: { type: \"boolean\" },\n },\n required: [\"expression\", \"cstType\"],\n },\n invoke: (tool, args) =>\n tool.analyzeExpression(\n omitSessionId(args) as never,\n optionalSessionId(args),\n ),\n },\n {\n name: \"list_diagnostics\",\n description:\n \"List active diagnostics for the session (one record set per constituent, not a historical log).\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n constituentId: { type: \"number\" },\n },\n },\n invoke: (tool, args) => {\n const constituentId = args.constituentId;\n const filters =\n typeof constituentId === \"number\" ? { constituentId } : undefined;\n return tool.listDiagnostics(filters, optionalSessionId(args));\n },\n },\n {\n name: \"commit_step\",\n description:\n \"Record a session revision with an optional human-readable message.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n message: { type: \"string\" },\n },\n },\n invoke: (tool, args) =>\n tool.commitStep(\n args.message as string | undefined,\n optionalSessionId(args),\n ),\n },\n {\n name: \"export_session\",\n description:\n \"Serialize the session to a JSON string suitable for import_data with kind=session.\",\n inputSchema: {\n type: \"object\",\n properties: { sessionId },\n },\n invoke: (tool, args) => tool.exportSession(optionalSessionId(args)),\n },\n {\n name: \"export_portal\",\n description:\n \"Export Portal Load-from-JSON payload. kind=schema|model; format=json (default string) or object.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n kind: { type: \"string\", enum: [\"schema\", \"model\"] },\n format: { type: \"string\", enum: [\"json\", \"object\"] },\n },\n required: [\"kind\"],\n },\n invoke: (tool, args) =>\n tool.exportPortal(omitSessionId(args) as never, optionalSessionId(args)),\n },\n {\n name: \"import_data\",\n description:\n \"Import a session from export_session JSON, Portal schema JSON, or GET /api/rsforms/:id/details. kind=auto (default) detects the shape.\",\n inputSchema: {\n type: \"object\",\n properties: {\n payload: {\n description:\n \"JSON string or parsed object (session export, Portal schema, or rsform details).\",\n },\n kind: {\n type: \"string\",\n enum: [\"auto\", \"session\", \"portal-schema\", \"portal-details\"],\n },\n },\n required: [\"payload\"],\n },\n invoke: (tool, args) =>\n tool.importData(args.payload as string | object, args.kind as never),\n },\n {\n name: \"set_model_values\",\n description:\n \"Set and/or clear interpretable model bindings. Pass set[] for bindings and clear[] for constituent ids to reset.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n set: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n target: { type: \"number\" },\n type: { type: \"string\" },\n value: {},\n },\n required: [\"target\", \"value\"],\n },\n },\n clear: { type: \"array\", items: { type: \"number\" } },\n },\n },\n invoke: (tool, args) =>\n tool.setModelValues(\n omitSessionId(args) as never,\n optionalSessionId(args),\n ),\n },\n {\n name: \"get_model_state\",\n description: \"Return the SessionModelState.\",\n inputSchema: {\n type: \"object\",\n properties: { sessionId },\n },\n invoke: (tool, args) => tool.getModelState(optionalSessionId(args)),\n },\n {\n name: \"evaluate\",\n description:\n \"Evaluate a scratch expression (expression + cstType) or a stored constituent (constituentId).\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n expression: { type: \"string\" },\n cstType: { type: \"string\" },\n constituentId: { type: \"number\" },\n },\n },\n invoke: (tool, args) =>\n tool.evaluate(omitSessionId(args) as never, optionalSessionId(args)),\n },\n {\n name: \"recalculate_model\",\n description: \"Recompute every inferrable constituent.\",\n inputSchema: {\n type: \"object\",\n properties: { sessionId },\n },\n invoke: (tool, args) => tool.recalculateModel(optionalSessionId(args)),\n },\n];\n","import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n} from \"@modelcontextprotocol/sdk/types.js\";\n\nimport { RSToolAgent } from \"@rsconcept/rstool\";\n\nimport { TOOL_DEFINITIONS, type ToolDefinition } from \"./tools\";\n\nexport interface BuildRSToolMcpServerOptions {\n /** Pre-built RSToolAgent. Defaults to a fresh in-memory instance. */\n tool?: RSToolAgent;\n /** Persist sessions to this directory (also reads RSTOOL_PERSISTENCE_DIR when set). */\n persistenceDir?: string;\n /** Server name advertised to MCP clients. */\n name?: string;\n /** Server version advertised to MCP clients. */\n version?: string;\n}\n\n/**\n * Build an MCP `McpServer` instance that exposes the `@rsconcept/rstool` contract.\n *\n * The returned server is not yet connected to a transport. Wrap it with a\n * `StdioServerTransport` (for local subprocess hosts like Cursor and Claude Desktop) or\n * an HTTP transport, then call `server.connect(transport)`.\n *\n * @example\n * ```ts\n * import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n * import { buildRSToolMcpServer } from '@rsconcept/rstool-mcp';\n *\n * const server = buildRSToolMcpServer();\n * await server.connect(new StdioServerTransport());\n * ```\n */\nexport function buildRSToolMcpServer(\n options: BuildRSToolMcpServerOptions = {},\n): McpServer {\n const persistenceDir =\n options.persistenceDir ?? process.env.RSTOOL_PERSISTENCE_DIR;\n const tool =\n options.tool ??\n new RSToolAgent(persistenceDir ? { persistenceDir } : undefined);\n const server = new McpServer(\n {\n name: options.name ?? \"rstool-mcp\",\n version: options.version ?? \"0.1.0\",\n },\n {\n capabilities: {\n tools: {},\n },\n },\n );\n\n const definitionByName = new Map<string, ToolDefinition>(\n TOOL_DEFINITIONS.map((definition) => [definition.name, definition]),\n );\n\n server.server.setRequestHandler(ListToolsRequestSchema, () =>\n Promise.resolve({\n tools: TOOL_DEFINITIONS.map((definition) => ({\n name: definition.name,\n description: definition.description,\n inputSchema: definition.inputSchema,\n })),\n }),\n );\n\n server.server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const definition = definitionByName.get(request.params.name);\n if (!definition) {\n return {\n isError: true,\n content: [\n {\n type: \"text\" as const,\n text: `Unknown rstool tool: ${request.params.name}`,\n },\n ],\n };\n }\n\n try {\n const result = await definition.invoke(\n tool,\n request.params.arguments ?? {},\n );\n const text =\n typeof result === \"string\" ? result : JSON.stringify(result, null, 2);\n return {\n content: [\n {\n type: \"text\" as const,\n text,\n },\n ],\n };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return {\n isError: true,\n content: [\n {\n type: \"text\" as const,\n text: `rstool error in ${definition.name}: ${message}`,\n },\n ],\n };\n }\n });\n\n return server;\n}\n"],"mappings":";;;;AAqBA,MAAM,YAAY;CAChB,MAAM;CACN,aAAa;AACf;AAEA,MAAM,mBAAmB;CACvB,MAAM;CACN,aACE;CACF,YAAY;EACV,IAAI,EAAE,MAAM,SAAS;EACrB,OAAO,EAAE,MAAM,SAAS;EACxB,SAAS,EAAE,MAAM,SAAS;EAC1B,kBAAkB,EAAE,MAAM,SAAS;EACnC,MAAM,EAAE,MAAM,SAAS;EACvB,gBAAgB,EAAE,MAAM,SAAS;EACjC,YAAY,EAAE,MAAM,SAAS;CAC/B;CACA,UAAU,CAAC,OAAO;AACpB;AAEA,SAAS,kBAAkB,MAAmD;CAC5E,MAAM,QAAQ,KAAK;CACnB,OAAO,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,QAAQ,KAAA;AACjE;AAEA,SAAS,cAAc,MAAwD;CAC7E,MAAM,EAAE,WAAW,YAAY,GAAG,SAAS;CAC3C,OAAO;AACT;AAEA,MAAa,mBAAqC;CAChD;EACE,MAAM;EACN,aACE;EACF,aAAa;GACX,MAAM;GACN,YAAY,CAAC;GACb,sBAAsB;EACxB;EACA,SAAS,UAAU;GAAE,MAAM;GAAM,iBAAiB,KAAK;EAAgB;CACzE;CACA;EACE,MAAM;EACN,aAAa;EACb,aAAa;GACX,MAAM;GACN,YAAY,CAAC;GACb,sBAAsB;EACxB;EACA,cAAc,iBAAiB,KAAK,eAAe,WAAW,IAAI;CACpE;CACA;EACE,MAAM;EACN,aACE;EACF,aAAa;GACX,MAAM;GACN,YAAY,EACV,SAAS;IACP,MAAM;IACN,YAAY;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AM,mBAAmB,WAAW,KAAK,IAAI;IAC/C,CACF;GACF;EACF;CACF,CAAC;CAED,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsconcept/rstool-mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Model Context Protocol (MCP) adapter that exposes the @rsconcept/rstool RSToolAgent contract over MCP stdio. Works with Cursor, Claude Desktop, and any MCP-capable host.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "IRBorisov",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
52
|
-
"@rsconcept/rstool": "^1.0.
|
|
52
|
+
"@rsconcept/rstool": "^1.0.1"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "^25.9.4",
|
package/src/server.test.ts
CHANGED
package/src/tools.ts
CHANGED
|
@@ -126,6 +126,16 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [
|
|
|
126
126
|
},
|
|
127
127
|
invoke: (tool, args) => tool.setCurrentSession(String(args.sessionId)),
|
|
128
128
|
},
|
|
129
|
+
{
|
|
130
|
+
name: "get_current_session",
|
|
131
|
+
description: "Return the current active session, or null if none exists.",
|
|
132
|
+
inputSchema: {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {},
|
|
135
|
+
additionalProperties: false,
|
|
136
|
+
},
|
|
137
|
+
invoke: (tool) => tool.getCurrentSession(),
|
|
138
|
+
},
|
|
129
139
|
{
|
|
130
140
|
name: "apply_schema_patch",
|
|
131
141
|
description:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-CWm4FZFL.js","names":[],"sources":["../src/tools.ts","../src/server.ts"],"sourcesContent":["/**\n * MCP tool definitions for the @rsconcept/rstool contract.\n */\n\nimport { type RSToolAgent } from \"@rsconcept/rstool\";\n\nexport interface ToolDefinition {\n name: string;\n description: string;\n inputSchema: {\n type: \"object\";\n properties: Record<string, unknown>;\n required?: string[];\n additionalProperties?: boolean;\n };\n invoke: (\n tool: RSToolAgent,\n args: Record<string, unknown>,\n ) => unknown | Promise<unknown>;\n}\n\nconst sessionId = {\n type: \"string\",\n description: \"Session id. Omit to use the current active session.\",\n};\n\nconst agentPatchSchema = {\n type: \"object\",\n description:\n \"Agent-friendly constituent patch. id and cstType are optional; cstType is inferred from alias prefixes X/C/S/D/A/F/P.\",\n properties: {\n id: { type: \"number\" },\n alias: { type: \"string\" },\n cstType: { type: \"string\" },\n definitionFormal: { type: \"string\" },\n term: { type: \"string\" },\n definitionText: { type: \"string\" },\n convention: { type: \"string\" },\n },\n required: [\"alias\"],\n};\n\nfunction optionalSessionId(args: Record<string, unknown>): string | undefined {\n const value = args.sessionId;\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n\nfunction omitSessionId(args: Record<string, unknown>): Record<string, unknown> {\n const { sessionId: _sessionId, ...rest } = args;\n return rest;\n}\n\nexport const TOOL_DEFINITIONS: ToolDefinition[] = [\n {\n name: \"ping\",\n description:\n \"Liveness check; returns {pong: true} and the active rstool contract version.\",\n inputSchema: {\n type: \"object\",\n properties: {},\n additionalProperties: false,\n },\n invoke: (tool) => ({ pong: true, contractVersion: tool.contractVersion }),\n },\n {\n name: \"list_methods\",\n description: \"List all rstool methods exposed as MCP tools.\",\n inputSchema: {\n type: \"object\",\n properties: {},\n additionalProperties: false,\n },\n invoke: () => TOOL_DEFINITIONS.map((definition) => definition.name),\n },\n {\n name: \"ensure_session\",\n description:\n \"Return the current active session, or create one if none exists. Optional initial seed is used only when creating.\",\n inputSchema: {\n type: \"object\",\n properties: {\n initial: {\n type: \"object\",\n properties: {\n alias: { type: \"string\" },\n title: { type: \"string\" },\n comment: { type: \"string\" },\n },\n additionalProperties: true,\n },\n },\n additionalProperties: false,\n },\n invoke: (tool, args) => tool.ensureSession(args.initial as never),\n },\n {\n name: \"create_session\",\n description:\n \"Create a fresh in-memory rstool session and set it as the current active session.\",\n inputSchema: {\n type: \"object\",\n properties: {\n initial: {\n type: \"object\",\n description:\n \"Optional partial SessionState seed (alias, title, comment).\",\n properties: {\n alias: { type: \"string\" },\n title: { type: \"string\" },\n comment: { type: \"string\" },\n },\n additionalProperties: false,\n },\n },\n additionalProperties: false,\n },\n invoke: (tool, args) => tool.createSession(args.initial as never),\n },\n {\n name: \"set_current_session\",\n description: \"Set the active session by id.\",\n inputSchema: {\n type: \"object\",\n properties: { sessionId },\n required: [\"sessionId\"],\n },\n invoke: (tool, args) => tool.setCurrentSession(String(args.sessionId)),\n },\n {\n name: \"apply_schema_patch\",\n description:\n \"Preferred schema edit path. Batch patch with inferred ids and cstType, dependency ordering, and compact summary.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n initial: {\n type: \"object\",\n properties: {\n alias: { type: \"string\" },\n title: { type: \"string\" },\n comment: { type: \"string\" },\n },\n additionalProperties: true,\n },\n items: { type: \"array\", items: agentPatchSchema },\n mode: { type: \"string\", enum: [\"atomic\", \"best_effort\"] },\n commitMessage: { type: \"string\" },\n },\n required: [\"items\"],\n },\n invoke: (tool, args) =>\n tool.applySchemaPatch(\n omitSessionId(args) as never,\n optionalSessionId(args),\n ),\n },\n {\n name: \"get_session_state\",\n description:\n \"Return session state. detail=summary (default): compact metadata, aliases, diagnostics. detail=full: complete SessionState clone.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n detail: { type: \"string\", enum: [\"summary\", \"full\"] },\n },\n },\n invoke: (tool, args) =>\n tool.getSessionState(\n (args.detail as \"summary\" | \"full\" | undefined) ?? \"summary\",\n optionalSessionId(args),\n ),\n },\n {\n name: \"analyze_expression\",\n description:\n \"Parse and type-check a scratch expression without saving it. Does not record diagnostics unless recordDiagnostics=true.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n expression: { type: \"string\" },\n cstType: { type: \"string\" },\n recordDiagnostics: { type: \"boolean\" },\n },\n required: [\"expression\", \"cstType\"],\n },\n invoke: (tool, args) =>\n tool.analyzeExpression(\n omitSessionId(args) as never,\n optionalSessionId(args),\n ),\n },\n {\n name: \"list_diagnostics\",\n description:\n \"List active diagnostics for the session (one record set per constituent, not a historical log).\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n constituentId: { type: \"number\" },\n },\n },\n invoke: (tool, args) => {\n const constituentId = args.constituentId;\n const filters =\n typeof constituentId === \"number\" ? { constituentId } : undefined;\n return tool.listDiagnostics(filters, optionalSessionId(args));\n },\n },\n {\n name: \"commit_step\",\n description:\n \"Record a session revision with an optional human-readable message.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n message: { type: \"string\" },\n },\n },\n invoke: (tool, args) =>\n tool.commitStep(\n args.message as string | undefined,\n optionalSessionId(args),\n ),\n },\n {\n name: \"export_session\",\n description:\n \"Serialize the session to a JSON string suitable for import_data with kind=session.\",\n inputSchema: {\n type: \"object\",\n properties: { sessionId },\n },\n invoke: (tool, args) => tool.exportSession(optionalSessionId(args)),\n },\n {\n name: \"export_portal\",\n description:\n \"Export Portal Load-from-JSON payload. kind=schema|model; format=json (default string) or object.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n kind: { type: \"string\", enum: [\"schema\", \"model\"] },\n format: { type: \"string\", enum: [\"json\", \"object\"] },\n },\n required: [\"kind\"],\n },\n invoke: (tool, args) =>\n tool.exportPortal(omitSessionId(args) as never, optionalSessionId(args)),\n },\n {\n name: \"import_data\",\n description:\n \"Import a session from export_session JSON, Portal schema JSON, or GET /api/rsforms/:id/details. kind=auto (default) detects the shape.\",\n inputSchema: {\n type: \"object\",\n properties: {\n payload: {\n description:\n \"JSON string or parsed object (session export, Portal schema, or rsform details).\",\n },\n kind: {\n type: \"string\",\n enum: [\"auto\", \"session\", \"portal-schema\", \"portal-details\"],\n },\n },\n required: [\"payload\"],\n },\n invoke: (tool, args) =>\n tool.importData(args.payload as string | object, args.kind as never),\n },\n {\n name: \"set_model_values\",\n description:\n \"Set and/or clear interpretable model bindings. Pass set[] for bindings and clear[] for constituent ids to reset.\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n set: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n target: { type: \"number\" },\n type: { type: \"string\" },\n value: {},\n },\n required: [\"target\", \"value\"],\n },\n },\n clear: { type: \"array\", items: { type: \"number\" } },\n },\n },\n invoke: (tool, args) =>\n tool.setModelValues(\n omitSessionId(args) as never,\n optionalSessionId(args),\n ),\n },\n {\n name: \"get_model_state\",\n description: \"Return the SessionModelState.\",\n inputSchema: {\n type: \"object\",\n properties: { sessionId },\n },\n invoke: (tool, args) => tool.getModelState(optionalSessionId(args)),\n },\n {\n name: \"evaluate\",\n description:\n \"Evaluate a scratch expression (expression + cstType) or a stored constituent (constituentId).\",\n inputSchema: {\n type: \"object\",\n properties: {\n sessionId,\n expression: { type: \"string\" },\n cstType: { type: \"string\" },\n constituentId: { type: \"number\" },\n },\n },\n invoke: (tool, args) =>\n tool.evaluate(omitSessionId(args) as never, optionalSessionId(args)),\n },\n {\n name: \"recalculate_model\",\n description: \"Recompute every inferrable constituent.\",\n inputSchema: {\n type: \"object\",\n properties: { sessionId },\n },\n invoke: (tool, args) => tool.recalculateModel(optionalSessionId(args)),\n },\n];\n","import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n} from \"@modelcontextprotocol/sdk/types.js\";\n\nimport { RSToolAgent } from \"@rsconcept/rstool\";\n\nimport { TOOL_DEFINITIONS, type ToolDefinition } from \"./tools\";\n\nexport interface BuildRSToolMcpServerOptions {\n /** Pre-built RSToolAgent. Defaults to a fresh in-memory instance. */\n tool?: RSToolAgent;\n /** Persist sessions to this directory (also reads RSTOOL_PERSISTENCE_DIR when set). */\n persistenceDir?: string;\n /** Server name advertised to MCP clients. */\n name?: string;\n /** Server version advertised to MCP clients. */\n version?: string;\n}\n\n/**\n * Build an MCP `McpServer` instance that exposes the `@rsconcept/rstool` contract.\n *\n * The returned server is not yet connected to a transport. Wrap it with a\n * `StdioServerTransport` (for local subprocess hosts like Cursor and Claude Desktop) or\n * an HTTP transport, then call `server.connect(transport)`.\n *\n * @example\n * ```ts\n * import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n * import { buildRSToolMcpServer } from '@rsconcept/rstool-mcp';\n *\n * const server = buildRSToolMcpServer();\n * await server.connect(new StdioServerTransport());\n * ```\n */\nexport function buildRSToolMcpServer(\n options: BuildRSToolMcpServerOptions = {},\n): McpServer {\n const persistenceDir =\n options.persistenceDir ?? process.env.RSTOOL_PERSISTENCE_DIR;\n const tool =\n options.tool ??\n new RSToolAgent(persistenceDir ? { persistenceDir } : undefined);\n const server = new McpServer(\n {\n name: options.name ?? \"rstool-mcp\",\n version: options.version ?? \"0.1.0\",\n },\n {\n capabilities: {\n tools: {},\n },\n },\n );\n\n const definitionByName = new Map<string, ToolDefinition>(\n TOOL_DEFINITIONS.map((definition) => [definition.name, definition]),\n );\n\n server.server.setRequestHandler(ListToolsRequestSchema, () =>\n Promise.resolve({\n tools: TOOL_DEFINITIONS.map((definition) => ({\n name: definition.name,\n description: definition.description,\n inputSchema: definition.inputSchema,\n })),\n }),\n );\n\n server.server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const definition = definitionByName.get(request.params.name);\n if (!definition) {\n return {\n isError: true,\n content: [\n {\n type: \"text\" as const,\n text: `Unknown rstool tool: ${request.params.name}`,\n },\n ],\n };\n }\n\n try {\n const result = await definition.invoke(\n tool,\n request.params.arguments ?? {},\n );\n const text =\n typeof result === \"string\" ? result : JSON.stringify(result, null, 2);\n return {\n content: [\n {\n type: \"text\" as const,\n text,\n },\n ],\n };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return {\n isError: true,\n content: [\n {\n type: \"text\" as const,\n text: `rstool error in ${definition.name}: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