cas-parser-node-mcp 1.4.1 → 1.7.2
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/LICENSE +1 -1
- package/README.md +29 -147
- package/auth.d.mts +6 -0
- package/auth.d.mts.map +1 -0
- package/auth.d.ts +6 -0
- package/auth.d.ts.map +1 -0
- package/auth.js +22 -0
- package/auth.js.map +1 -0
- package/auth.mjs +17 -0
- package/auth.mjs.map +1 -0
- package/code-tool-types.d.mts +7 -7
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts +7 -7
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool.d.mts +6 -3
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +6 -3
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +86 -133
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +86 -100
- package/code-tool.mjs.map +1 -1
- package/{tools/cas-generator/generate-cas-cas-generator.d.ts → docs-search-tool.d.mts} +23 -11
- package/docs-search-tool.d.mts.map +1 -0
- package/{tools/cas-generator/generate-cas-cas-generator.d.mts → docs-search-tool.d.ts} +23 -11
- package/docs-search-tool.d.ts.map +1 -0
- package/docs-search-tool.js +55 -0
- package/docs-search-tool.js.map +1 -0
- package/docs-search-tool.mjs +51 -0
- package/docs-search-tool.mjs.map +1 -0
- package/http.d.mts +9 -4
- package/http.d.mts.map +1 -1
- package/http.d.ts +9 -4
- package/http.d.ts.map +1 -1
- package/http.js +35 -48
- package/http.js.map +1 -1
- package/http.mjs +35 -48
- package/http.mjs.map +1 -1
- package/index.js +8 -40
- package/index.js.map +1 -1
- package/index.mjs +8 -40
- package/index.mjs.map +1 -1
- package/instructions.d.mts +2 -0
- package/instructions.d.mts.map +1 -0
- package/instructions.d.ts +2 -0
- package/instructions.d.ts.map +1 -0
- package/instructions.js +55 -0
- package/instructions.js.map +1 -0
- package/instructions.mjs +52 -0
- package/instructions.mjs.map +1 -0
- package/methods.d.mts +10 -0
- package/methods.d.mts.map +1 -0
- package/methods.d.ts +10 -0
- package/methods.d.ts.map +1 -0
- package/methods.js +167 -0
- package/methods.js.map +1 -0
- package/methods.mjs +163 -0
- package/methods.mjs.map +1 -0
- package/options.d.mts +6 -9
- package/options.d.mts.map +1 -1
- package/options.d.ts +6 -9
- package/options.d.ts.map +1 -1
- package/options.js +42 -360
- package/options.js.map +1 -1
- package/options.mjs +42 -360
- package/options.mjs.map +1 -1
- package/package.json +67 -79
- package/server.d.mts +10 -16
- package/server.d.mts.map +1 -1
- package/server.d.ts +10 -16
- package/server.d.ts.map +1 -1
- package/server.js +89 -101
- package/server.js.map +1 -1
- package/server.mjs +88 -96
- package/server.mjs.map +1 -1
- package/src/auth.ts +25 -0
- package/src/code-tool-types.ts +7 -5
- package/src/code-tool.ts +113 -117
- package/src/docs-search-tool.ts +68 -0
- package/src/http.ts +52 -52
- package/src/index.ts +9 -52
- package/src/instructions.ts +74 -0
- package/src/methods.ts +188 -0
- package/src/options.ts +55 -382
- package/src/server.ts +98 -117
- package/src/stdio.ts +4 -4
- package/src/{tools/types.ts → types.ts} +25 -5
- package/src/util.ts +25 -0
- package/stdio.d.mts +1 -1
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts +1 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.js +3 -3
- package/stdio.js.map +1 -1
- package/stdio.mjs +3 -3
- package/stdio.mjs.map +1 -1
- package/{tools/types.d.mts → types.d.mts} +10 -2
- package/types.d.mts.map +1 -0
- package/{tools/types.d.ts → types.d.ts} +10 -2
- package/types.d.ts.map +1 -0
- package/{tools/types.js → types.js} +12 -0
- package/types.js.map +1 -0
- package/{tools/types.mjs → types.mjs} +11 -0
- package/types.mjs.map +1 -0
- package/util.d.mts +4 -0
- package/util.d.mts.map +1 -0
- package/util.d.ts +4 -0
- package/util.d.ts.map +1 -0
- package/util.js +30 -0
- package/util.js.map +1 -0
- package/util.mjs +24 -0
- package/util.mjs.map +1 -0
- package/code-tool-paths.cjs +0 -6
- package/code-tool-paths.cjs.map +0 -1
- package/code-tool-paths.d.cts +0 -2
- package/code-tool-paths.d.cts.map +0 -1
- package/code-tool-worker.d.mts +0 -5
- package/code-tool-worker.d.mts.map +0 -1
- package/code-tool-worker.d.ts +0 -5
- package/code-tool-worker.d.ts.map +0 -1
- package/code-tool-worker.js +0 -45
- package/code-tool-worker.js.map +0 -1
- package/code-tool-worker.mjs +0 -40
- package/code-tool-worker.mjs.map +0 -1
- package/compat.d.mts +0 -58
- package/compat.d.mts.map +0 -1
- package/compat.d.ts +0 -58
- package/compat.d.ts.map +0 -1
- package/compat.js +0 -387
- package/compat.js.map +0 -1
- package/compat.mjs +0 -378
- package/compat.mjs.map +0 -1
- package/dynamic-tools.d.mts +0 -12
- package/dynamic-tools.d.mts.map +0 -1
- package/dynamic-tools.d.ts +0 -12
- package/dynamic-tools.d.ts.map +0 -1
- package/dynamic-tools.js +0 -135
- package/dynamic-tools.js.map +0 -1
- package/dynamic-tools.mjs +0 -132
- package/dynamic-tools.mjs.map +0 -1
- package/filtering.d.mts +0 -2
- package/filtering.d.mts.map +0 -1
- package/filtering.d.ts +0 -2
- package/filtering.d.ts.map +0 -1
- package/filtering.js +0 -20
- package/filtering.js.map +0 -1
- package/filtering.mjs +0 -13
- package/filtering.mjs.map +0 -1
- package/headers.d.mts +0 -4
- package/headers.d.mts.map +0 -1
- package/headers.d.ts +0 -4
- package/headers.d.ts.map +0 -1
- package/headers.js +0 -10
- package/headers.js.map +0 -1
- package/headers.mjs +0 -6
- package/headers.mjs.map +0 -1
- package/src/code-tool-paths.cts +0 -3
- package/src/code-tool-worker.ts +0 -46
- package/src/compat.ts +0 -483
- package/src/dynamic-tools.ts +0 -159
- package/src/filtering.ts +0 -14
- package/src/headers.ts +0 -10
- package/src/tools/cas-generator/generate-cas-cas-generator.ts +0 -67
- package/src/tools/cas-parser/cams-kfintech-cas-parser.ts +0 -47
- package/src/tools/cas-parser/cdsl-cas-parser.ts +0 -47
- package/src/tools/cas-parser/nsdl-cas-parser.ts +0 -47
- package/src/tools/cas-parser/smart-parse-cas-parser.ts +0 -47
- package/src/tools/index.ts +0 -79
- package/src/tools.ts +0 -1
- package/tools/cas-generator/generate-cas-cas-generator.d.mts.map +0 -1
- package/tools/cas-generator/generate-cas-cas-generator.d.ts.map +0 -1
- package/tools/cas-generator/generate-cas-cas-generator.js +0 -62
- package/tools/cas-generator/generate-cas-cas-generator.js.map +0 -1
- package/tools/cas-generator/generate-cas-cas-generator.mjs +0 -58
- package/tools/cas-generator/generate-cas-cas-generator.mjs.map +0 -1
- package/tools/cas-parser/cams-kfintech-cas-parser.d.mts +0 -45
- package/tools/cas-parser/cams-kfintech-cas-parser.d.mts.map +0 -1
- package/tools/cas-parser/cams-kfintech-cas-parser.d.ts +0 -45
- package/tools/cas-parser/cams-kfintech-cas-parser.d.ts.map +0 -1
- package/tools/cas-parser/cams-kfintech-cas-parser.js +0 -43
- package/tools/cas-parser/cams-kfintech-cas-parser.js.map +0 -1
- package/tools/cas-parser/cams-kfintech-cas-parser.mjs +0 -39
- package/tools/cas-parser/cams-kfintech-cas-parser.mjs.map +0 -1
- package/tools/cas-parser/cdsl-cas-parser.d.mts +0 -45
- package/tools/cas-parser/cdsl-cas-parser.d.mts.map +0 -1
- package/tools/cas-parser/cdsl-cas-parser.d.ts +0 -45
- package/tools/cas-parser/cdsl-cas-parser.d.ts.map +0 -1
- package/tools/cas-parser/cdsl-cas-parser.js +0 -43
- package/tools/cas-parser/cdsl-cas-parser.js.map +0 -1
- package/tools/cas-parser/cdsl-cas-parser.mjs +0 -39
- package/tools/cas-parser/cdsl-cas-parser.mjs.map +0 -1
- package/tools/cas-parser/nsdl-cas-parser.d.mts +0 -45
- package/tools/cas-parser/nsdl-cas-parser.d.mts.map +0 -1
- package/tools/cas-parser/nsdl-cas-parser.d.ts +0 -45
- package/tools/cas-parser/nsdl-cas-parser.d.ts.map +0 -1
- package/tools/cas-parser/nsdl-cas-parser.js +0 -43
- package/tools/cas-parser/nsdl-cas-parser.js.map +0 -1
- package/tools/cas-parser/nsdl-cas-parser.mjs +0 -39
- package/tools/cas-parser/nsdl-cas-parser.mjs.map +0 -1
- package/tools/cas-parser/smart-parse-cas-parser.d.mts +0 -45
- package/tools/cas-parser/smart-parse-cas-parser.d.mts.map +0 -1
- package/tools/cas-parser/smart-parse-cas-parser.d.ts +0 -45
- package/tools/cas-parser/smart-parse-cas-parser.d.ts.map +0 -1
- package/tools/cas-parser/smart-parse-cas-parser.js +0 -43
- package/tools/cas-parser/smart-parse-cas-parser.js.map +0 -1
- package/tools/cas-parser/smart-parse-cas-parser.mjs +0 -39
- package/tools/cas-parser/smart-parse-cas-parser.mjs.map +0 -1
- package/tools/index.d.mts +0 -10
- package/tools/index.d.mts.map +0 -1
- package/tools/index.d.ts +0 -10
- package/tools/index.d.ts.map +0 -1
- package/tools/index.js +0 -63
- package/tools/index.js.map +0 -1
- package/tools/index.mjs +0 -56
- package/tools/index.mjs.map +0 -1
- package/tools/types.d.mts.map +0 -1
- package/tools/types.d.ts.map +0 -1
- package/tools/types.js.map +0 -1
- package/tools/types.mjs.map +0 -1
- package/tools.d.mts +0 -2
- package/tools.d.mts.map +0 -1
- package/tools.d.ts +0 -2
- package/tools.d.ts.map +0 -1
- package/tools.js +0 -18
- package/tools.js.map +0 -1
- package/tools.mjs +0 -2
- package/tools.mjs.map +0 -1
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2026 Cas Parser
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ You can run the MCP Server directly via `npx`:
|
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
export CAS_PARSER_API_KEY="My API Key"
|
|
13
|
+
export CAS_PARSER_ENVIRONMENT="production"
|
|
13
14
|
npx -y cas-parser-node-mcp@latest
|
|
14
15
|
```
|
|
15
16
|
|
|
@@ -25,106 +26,55 @@ For clients with a configuration JSON, it might look something like this:
|
|
|
25
26
|
"mcpServers": {
|
|
26
27
|
"cas_parser_node_api": {
|
|
27
28
|
"command": "npx",
|
|
28
|
-
"args": ["-y", "cas-parser-node-mcp"
|
|
29
|
+
"args": ["-y", "cas-parser-node-mcp"],
|
|
29
30
|
"env": {
|
|
30
|
-
"CAS_PARSER_API_KEY": "My API Key"
|
|
31
|
+
"CAS_PARSER_API_KEY": "My API Key",
|
|
32
|
+
"CAS_PARSER_ENVIRONMENT": "production"
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
### Cursor
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
If you use Cursor, you can install the MCP server by using the button below. You will need to set your environment variables
|
|
42
|
+
in Cursor's `mcp.json`, which can be found in Cursor Settings > Tools & MCP > New MCP Server.
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
2. Exposing a set of tools to dynamically discover and invoke endpoints from the API
|
|
44
|
+
[](https://cursor.com/en-US/install-mcp?name=cas-parser-node-mcp&config=eyJuYW1lIjoiY2FzLXBhcnNlci1ub2RlLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2Nhcy1wYXJzZXIuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)
|
|
43
45
|
|
|
44
|
-
###
|
|
46
|
+
### VS Code
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
context window.
|
|
48
|
+
If you use MCP, you can install the MCP server by clicking the link below. You will need to set your environment variables
|
|
49
|
+
in VS Code's `mcp.json`, which can be found via Command Palette > MCP: Open User Configuration.
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-node-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcas-parser.stlmcp.com%22%2C%22headers%22%3A%7B%22x-api-key%22%3A%22My%20API%20Key%22%7D%7D)
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
- `--resource` includes all tools under a specific resource, and can have wildcards, e.g. `my.resource*`
|
|
54
|
-
- `--operation` includes just read (get/list) or just write operations
|
|
53
|
+
### Claude Code
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
If you use Claude Code, you can install the MCP server by running the command below in your terminal. You will need to set your
|
|
56
|
+
environment variables in Claude Code's `.claude.json`, which can be found in your home directory.
|
|
57
57
|
|
|
58
|
-
If you specify `--tools=dynamic` to the MCP server, instead of exposing one tool per endpoint in the API, it will
|
|
59
|
-
expose the following tools:
|
|
60
|
-
|
|
61
|
-
1. `list_api_endpoints` - Discovers available endpoints, with optional filtering by search query
|
|
62
|
-
2. `get_api_endpoint_schema` - Gets detailed schema information for a specific endpoint
|
|
63
|
-
3. `invoke_api_endpoint` - Executes any endpoint with the appropriate parameters
|
|
64
|
-
|
|
65
|
-
This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all
|
|
66
|
-
of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to
|
|
67
|
-
search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it
|
|
68
|
-
can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore,
|
|
69
|
-
you can opt-in to explicit tools, the dynamic tools, or both.
|
|
70
|
-
|
|
71
|
-
See more information with `--help`.
|
|
72
|
-
|
|
73
|
-
All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. `--no-tool`).
|
|
74
|
-
|
|
75
|
-
Use `--list` to see the list of available tools, or see below.
|
|
76
|
-
|
|
77
|
-
### Specifying the MCP Client
|
|
78
|
-
|
|
79
|
-
Different clients have varying abilities to handle arbitrary tools and schemas.
|
|
80
|
-
|
|
81
|
-
You can specify the client you are using with the `--client` argument, and the MCP server will automatically
|
|
82
|
-
serve tools and schemas that are more compatible with that client.
|
|
83
|
-
|
|
84
|
-
- `--client=<type>`: Set all capabilities based on a known MCP client
|
|
85
|
-
|
|
86
|
-
- Valid values: `openai-agents`, `claude`, `claude-code`, `cursor`
|
|
87
|
-
- Example: `--client=cursor`
|
|
88
|
-
|
|
89
|
-
Additionally, if you have a client not on the above list, or the client has gotten better
|
|
90
|
-
over time, you can manually enable or disable certain capabilities:
|
|
91
|
-
|
|
92
|
-
- `--capability=<name>`: Specify individual client capabilities
|
|
93
|
-
- Available capabilities:
|
|
94
|
-
- `top-level-unions`: Enable support for top-level unions in tool schemas
|
|
95
|
-
- `valid-json`: Enable JSON string parsing for arguments
|
|
96
|
-
- `refs`: Enable support for $ref pointers in schemas
|
|
97
|
-
- `unions`: Enable support for union types (anyOf) in schemas
|
|
98
|
-
- `formats`: Enable support for format validations in schemas (e.g. date-time, email)
|
|
99
|
-
- `tool-name-length=N`: Set maximum tool name length to N characters
|
|
100
|
-
- Example: `--capability=top-level-unions --capability=tool-name-length=40`
|
|
101
|
-
- Example: `--capability=top-level-unions,tool-name-length=40`
|
|
102
|
-
|
|
103
|
-
### Examples
|
|
104
|
-
|
|
105
|
-
1. Filter for read operations on cards:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
--resource=cards --operation=read
|
|
109
58
|
```
|
|
110
|
-
|
|
111
|
-
2. Exclude specific tools while including others:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
--resource=cards --no-tool=create_cards
|
|
59
|
+
claude mcp add cas_parser_node_mcp_api --header "x-api-key: My API Key" --transport http https://cas-parser.stlmcp.com
|
|
115
60
|
```
|
|
116
61
|
|
|
117
|
-
|
|
62
|
+
## Code Mode
|
|
118
63
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
64
|
+
This MCP server is built on the "Code Mode" tool scheme. In this MCP Server,
|
|
65
|
+
your agent will write code against the TypeScript SDK, which will then be executed in an
|
|
66
|
+
isolated sandbox. To accomplish this, the server will expose two tools to your agent:
|
|
122
67
|
|
|
123
|
-
|
|
68
|
+
- The first tool is a docs search tool, which can be used to generically query for
|
|
69
|
+
documentation about your API/SDK.
|
|
124
70
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
71
|
+
- The second tool is a code tool, where the agent can write code against the TypeScript SDK.
|
|
72
|
+
The code will be executed in a sandbox environment without web or filesystem access. Then,
|
|
73
|
+
anything the code returns or prints will be returned to the agent as the result of the
|
|
74
|
+
tool call.
|
|
75
|
+
|
|
76
|
+
Using this scheme, agents are capable of performing very complex tasks deterministically
|
|
77
|
+
and repeatably.
|
|
128
78
|
|
|
129
79
|
## Running remotely
|
|
130
80
|
|
|
@@ -149,71 +99,3 @@ A configuration JSON for this server might look like this, assuming the server i
|
|
|
149
99
|
}
|
|
150
100
|
}
|
|
151
101
|
```
|
|
152
|
-
|
|
153
|
-
The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL.
|
|
154
|
-
For example, to exclude specific tools while including others, use the URL:
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Or, to configure for the Cursor client, with a custom max tool name length, use the URL:
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
http://localhost:3000?client=cursor&capability=tool-name-length%3D40
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## Importing the tools and server individually
|
|
167
|
-
|
|
168
|
-
```js
|
|
169
|
-
// Import the server, generated endpoints, or the init function
|
|
170
|
-
import { server, endpoints, init } from "cas-parser-node-mcp/server";
|
|
171
|
-
|
|
172
|
-
// import a specific tool
|
|
173
|
-
import camsKfintechCasParser from "cas-parser-node-mcp/tools/cas-parser/cams-kfintech-cas-parser";
|
|
174
|
-
|
|
175
|
-
// initialize the server and all endpoints
|
|
176
|
-
init({ server, endpoints });
|
|
177
|
-
|
|
178
|
-
// manually start server
|
|
179
|
-
const transport = new StdioServerTransport();
|
|
180
|
-
await server.connect(transport);
|
|
181
|
-
|
|
182
|
-
// or initialize your own server with specific tools
|
|
183
|
-
const myServer = new McpServer(...);
|
|
184
|
-
|
|
185
|
-
// define your own endpoint
|
|
186
|
-
const myCustomEndpoint = {
|
|
187
|
-
tool: {
|
|
188
|
-
name: 'my_custom_tool',
|
|
189
|
-
description: 'My custom tool',
|
|
190
|
-
inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })),
|
|
191
|
-
},
|
|
192
|
-
handler: async (client: client, args: any) => {
|
|
193
|
-
return { myResponse: 'Hello world!' };
|
|
194
|
-
})
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
// initialize the server with your custom endpoints
|
|
198
|
-
init({ server: myServer, endpoints: [camsKfintechCasParser, myCustomEndpoint] });
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
## Available Tools
|
|
202
|
-
|
|
203
|
-
The following tools are available in this MCP server.
|
|
204
|
-
|
|
205
|
-
### Resource `CAS Parser`:
|
|
206
|
-
|
|
207
|
-
- `cams_kfintech_cas_parser` (`write`): This endpoint specifically parses CAMS/KFintech CAS (Consolidated Account Statement) PDF files and returns data in a unified format.
|
|
208
|
-
Use this endpoint when you know the PDF is from CAMS or KFintech.
|
|
209
|
-
- `cdsl_cas_parser` (`write`): This endpoint specifically parses CDSL CAS (Consolidated Account Statement) PDF files and returns data in a unified format.
|
|
210
|
-
Use this endpoint when you know the PDF is from CDSL.
|
|
211
|
-
- `nsdl_cas_parser` (`write`): This endpoint specifically parses NSDL CAS (Consolidated Account Statement) PDF files and returns data in a unified format.
|
|
212
|
-
Use this endpoint when you know the PDF is from NSDL.
|
|
213
|
-
- `smart_parse_cas_parser` (`write`): This endpoint parses CAS (Consolidated Account Statement) PDF files from NSDL, CDSL, or CAMS/KFintech and returns data in a unified format.
|
|
214
|
-
It auto-detects the CAS type and transforms the data into a consistent structure regardless of the source.
|
|
215
|
-
|
|
216
|
-
### Resource `CAS Generator`:
|
|
217
|
-
|
|
218
|
-
- `generate_cas_cas_generator` (`write`): This endpoint generates CAS (Consolidated Account Statement) documents by submitting a mailback request to the specified CAS authority.
|
|
219
|
-
Currently only supports KFintech, with plans to support CAMS, CDSL, and NSDL in the future.
|
package/auth.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IncomingMessage } from 'node:http';
|
|
2
|
+
import { ClientOptions } from 'cas-parser-node';
|
|
3
|
+
import { McpOptions } from "./options.mjs";
|
|
4
|
+
export declare const parseClientAuthHeaders: (req: IncomingMessage, required?: boolean) => Partial<ClientOptions>;
|
|
5
|
+
export declare const getStainlessApiKey: (req: IncomingMessage, mcpOptions: McpOptions) => string | undefined;
|
|
6
|
+
//# sourceMappingURL=auth.d.mts.map
|
package/auth.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.mts","sourceRoot":"","sources":["src/auth.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,iBAAiB;OACxC,EAAE,UAAU,EAAE;AAErB,eAAO,MAAM,sBAAsB,GAAI,KAAK,eAAe,EAAE,WAAW,OAAO,KAAG,OAAO,CAAC,aAAa,CAItG,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,eAAe,EAAE,YAAY,UAAU,KAAG,MAAM,GAAG,SAY1F,CAAC"}
|
package/auth.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IncomingMessage } from 'node:http';
|
|
2
|
+
import { ClientOptions } from 'cas-parser-node';
|
|
3
|
+
import { McpOptions } from "./options.js";
|
|
4
|
+
export declare const parseClientAuthHeaders: (req: IncomingMessage, required?: boolean) => Partial<ClientOptions>;
|
|
5
|
+
export declare const getStainlessApiKey: (req: IncomingMessage, mcpOptions: McpOptions) => string | undefined;
|
|
6
|
+
//# sourceMappingURL=auth.d.ts.map
|
package/auth.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["src/auth.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,iBAAiB;OACxC,EAAE,UAAU,EAAE;AAErB,eAAO,MAAM,sBAAsB,GAAI,KAAK,eAAe,EAAE,WAAW,OAAO,KAAG,OAAO,CAAC,aAAa,CAItG,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,eAAe,EAAE,YAAY,UAAU,KAAG,MAAM,GAAG,SAY1F,CAAC"}
|
package/auth.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getStainlessApiKey = exports.parseClientAuthHeaders = void 0;
|
|
5
|
+
const parseClientAuthHeaders = (req, required) => {
|
|
6
|
+
const apiKey = Array.isArray(req.headers['x-api-key']) ? req.headers['x-api-key'][0] : req.headers['x-api-key'];
|
|
7
|
+
return { apiKey };
|
|
8
|
+
};
|
|
9
|
+
exports.parseClientAuthHeaders = parseClientAuthHeaders;
|
|
10
|
+
const getStainlessApiKey = (req, mcpOptions) => {
|
|
11
|
+
// Try to get the key from the x-stainless-api-key header
|
|
12
|
+
const headerKey = Array.isArray(req.headers['x-stainless-api-key']) ?
|
|
13
|
+
req.headers['x-stainless-api-key'][0]
|
|
14
|
+
: req.headers['x-stainless-api-key'];
|
|
15
|
+
if (headerKey && typeof headerKey === 'string') {
|
|
16
|
+
return headerKey;
|
|
17
|
+
}
|
|
18
|
+
// Fall back to value set in the mcpOptions (e.g. from environment variable), if provided
|
|
19
|
+
return mcpOptions.stainlessApiKey;
|
|
20
|
+
};
|
|
21
|
+
exports.getStainlessApiKey = getStainlessApiKey;
|
|
22
|
+
//# sourceMappingURL=auth.js.map
|
package/auth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["src/auth.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAM/E,MAAM,sBAAsB,GAAG,CAAC,GAAoB,EAAE,QAAkB,EAA0B,EAAE;IACzG,MAAM,MAAM,GACV,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACnG,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC;AAJW,QAAA,sBAAsB,0BAIjC;AAEK,MAAM,kBAAkB,GAAG,CAAC,GAAoB,EAAE,UAAsB,EAAsB,EAAE;IACrG,yDAAyD;IACzD,MAAM,SAAS,GACb,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACjD,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACvC,IAAI,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC/C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,yFAAyF;IACzF,OAAO,UAAU,CAAC,eAAe,CAAC;AACpC,CAAC,CAAC;AAZW,QAAA,kBAAkB,sBAY7B"}
|
package/auth.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
export const parseClientAuthHeaders = (req, required) => {
|
|
3
|
+
const apiKey = Array.isArray(req.headers['x-api-key']) ? req.headers['x-api-key'][0] : req.headers['x-api-key'];
|
|
4
|
+
return { apiKey };
|
|
5
|
+
};
|
|
6
|
+
export const getStainlessApiKey = (req, mcpOptions) => {
|
|
7
|
+
// Try to get the key from the x-stainless-api-key header
|
|
8
|
+
const headerKey = Array.isArray(req.headers['x-stainless-api-key']) ?
|
|
9
|
+
req.headers['x-stainless-api-key'][0]
|
|
10
|
+
: req.headers['x-stainless-api-key'];
|
|
11
|
+
if (headerKey && typeof headerKey === 'string') {
|
|
12
|
+
return headerKey;
|
|
13
|
+
}
|
|
14
|
+
// Fall back to value set in the mcpOptions (e.g. from environment variable), if provided
|
|
15
|
+
return mcpOptions.stainlessApiKey;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=auth.mjs.map
|
package/auth.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.mjs","sourceRoot":"","sources":["src/auth.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAMtF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAoB,EAAE,QAAkB,EAA0B,EAAE;IACzG,MAAM,MAAM,GACV,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACnG,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAoB,EAAE,UAAsB,EAAsB,EAAE;IACrG,yDAAyD;IACzD,MAAM,SAAS,GACb,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACjD,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACvC,IAAI,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC/C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,yFAAyF;IACzF,OAAO,UAAU,CAAC,eAAe,CAAC;AACpC,CAAC,CAAC"}
|
package/code-tool-types.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ClientOptions } from 'cas-parser-node';
|
|
2
2
|
export type WorkerInput = {
|
|
3
|
-
|
|
3
|
+
project_name: string;
|
|
4
4
|
code: string;
|
|
5
|
+
client_opts: ClientOptions;
|
|
6
|
+
intent?: string | undefined;
|
|
5
7
|
};
|
|
6
|
-
export type
|
|
8
|
+
export type WorkerOutput = {
|
|
9
|
+
is_error: boolean;
|
|
7
10
|
result: unknown | null;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
export type WorkerError = {
|
|
12
|
-
message: string | undefined;
|
|
11
|
+
log_lines: string[];
|
|
12
|
+
err_lines: string[];
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=code-tool-types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,iBAAiB;AAE/C,MAAM,MAAM,WAAW,GAAG;IACxB,
|
|
1
|
+
{"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,iBAAiB;AAE/C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
|
package/code-tool-types.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ClientOptions } from 'cas-parser-node';
|
|
2
2
|
export type WorkerInput = {
|
|
3
|
-
|
|
3
|
+
project_name: string;
|
|
4
4
|
code: string;
|
|
5
|
+
client_opts: ClientOptions;
|
|
6
|
+
intent?: string | undefined;
|
|
5
7
|
};
|
|
6
|
-
export type
|
|
8
|
+
export type WorkerOutput = {
|
|
9
|
+
is_error: boolean;
|
|
7
10
|
result: unknown | null;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
export type WorkerError = {
|
|
12
|
-
message: string | undefined;
|
|
11
|
+
log_lines: string[];
|
|
12
|
+
err_lines: string[];
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=code-tool-types.d.ts.map
|
package/code-tool-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,iBAAiB;AAE/C,MAAM,MAAM,WAAW,GAAG;IACxB,
|
|
1
|
+
{"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,iBAAiB;AAE/C,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
|
package/code-tool.d.mts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpTool } from "./types.mjs";
|
|
2
|
+
import { SdkMethod } from "./methods.mjs";
|
|
2
3
|
/**
|
|
3
4
|
* A tool that runs code against a copy of the SDK.
|
|
4
5
|
*
|
|
5
|
-
* Instead of exposing every endpoint as
|
|
6
|
+
* Instead of exposing every endpoint as its own tool, which uses up too many tokens for LLMs to use at once,
|
|
6
7
|
* we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
|
|
7
8
|
* a generic endpoint that can be used to invoke any endpoint with the provided arguments.
|
|
8
9
|
*
|
|
9
10
|
* @param endpoints - The endpoints to include in the list.
|
|
10
11
|
*/
|
|
11
|
-
export declare function codeTool(
|
|
12
|
+
export declare function codeTool({ blockedMethods }: {
|
|
13
|
+
blockedMethods: SdkMethod[] | undefined;
|
|
14
|
+
}): McpTool;
|
|
12
15
|
//# sourceMappingURL=code-tool.d.mts.map
|
package/code-tool.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAEL,OAAO,EAKR;OAIM,EAAE,SAAS,EAAE;AAsBpB;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;CAAE,GAAG,OAAO,CAiGjG"}
|
package/code-tool.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpTool } from "./types.js";
|
|
2
|
+
import { SdkMethod } from "./methods.js";
|
|
2
3
|
/**
|
|
3
4
|
* A tool that runs code against a copy of the SDK.
|
|
4
5
|
*
|
|
5
|
-
* Instead of exposing every endpoint as
|
|
6
|
+
* Instead of exposing every endpoint as its own tool, which uses up too many tokens for LLMs to use at once,
|
|
6
7
|
* we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
|
|
7
8
|
* a generic endpoint that can be used to invoke any endpoint with the provided arguments.
|
|
8
9
|
*
|
|
9
10
|
* @param endpoints - The endpoints to include in the list.
|
|
10
11
|
*/
|
|
11
|
-
export declare function codeTool(
|
|
12
|
+
export declare function codeTool({ blockedMethods }: {
|
|
13
|
+
blockedMethods: SdkMethod[] | undefined;
|
|
14
|
+
}): McpTool;
|
|
12
15
|
//# sourceMappingURL=code-tool.d.ts.map
|
package/code-tool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAEL,OAAO,EAKR;OAIM,EAAE,SAAS,EAAE;AAsBpB;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;CAAE,GAAG,OAAO,CAiGjG"}
|