@cutoptim/mcp 0.1.0 → 0.1.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/LICENSE +21 -21
- package/README.md +77 -73
- package/dist/core.gen.d.ts +7 -0
- package/dist/core.gen.js +7 -1
- package/dist/tools.gen.js +745 -28
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +61 -61
- package/server.json +49 -45
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 CutOptim
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CutOptim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,73 +1,77 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="https://cutoptim.com/engine"><img src="https://raw.githubusercontent.com/cutoptim/engine-mcp/main/.github/logo.png" width="88" height="88" alt="CutOptim"></a>
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
<h1 align="center">CutOptim MCP server</h1>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
Cutting optimization as tools for AI assistants: <b>2D panels</b>, <b>1D bars</b>, <b>timber</b> and <b>true-shape nesting</b>,<br>
|
|
9
|
-
through the <a href="https://cutoptim.com/engine">CutOptim Engine API</a> and the Model Context Protocol.
|
|
10
|
-
</p>
|
|
11
|
-
|
|
12
|
-
<p align="center">
|
|
13
|
-
<a href="https://cutoptim.com/engine/reference/guides/mcp">MCP guide</a> ·
|
|
14
|
-
<a href="https://cutoptim.com/engine/reference">API reference</a> ·
|
|
15
|
-
<a href="https://cutoptim.com/dashboard?api=test#api-keys">Get a free test key</a>
|
|
16
|
-
</p>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
|
56
|
-
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
and
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://cutoptim.com/engine"><img src="https://raw.githubusercontent.com/cutoptim/engine-mcp/main/.github/logo.png" width="88" height="88" alt="CutOptim"></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">CutOptim MCP server</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Cutting optimization as tools for AI assistants: <b>2D panels</b>, <b>1D bars</b>, <b>timber</b> and <b>true-shape nesting</b>,<br>
|
|
9
|
+
through the <a href="https://cutoptim.com/engine">CutOptim Engine API</a> and the Model Context Protocol.
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://cutoptim.com/engine/reference/guides/mcp">MCP guide</a> ·
|
|
14
|
+
<a href="https://cutoptim.com/engine/reference">API reference</a> ·
|
|
15
|
+
<a href="https://cutoptim.com/dashboard?api=test#api-keys">Get a free test key</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="https://mcprush.com/to/cutoptim-engine-mcp?ref=badge"><img src="https://mcprush.com/badge/cutoptim-engine-mcp/card.svg" alt="CutOptim Engine MCP server"></a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Two ways to connect
|
|
25
|
+
|
|
26
|
+
**Hosted (no install)** — point your MCP client at `https://api.cutoptim.com/mcp` with the header
|
|
27
|
+
`Authorization: Bearer <your API key>`. Configurations for Claude Code, Cursor, VS Code and Claude Desktop are in the
|
|
28
|
+
[MCP guide](https://cutoptim.com/engine/reference/guides/mcp).
|
|
29
|
+
|
|
30
|
+
**Local (this package, stdio)** — runs on your machine and calls the same API with your key:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"cutoptim": {
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["-y", "@cutoptim/mcp"],
|
|
38
|
+
"env": { "CUTOPTIM_API_KEY": "co_test_YOUR_KEY" }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Claude Code: `claude mcp add cutoptim --env CUTOPTIM_API_KEY=co_test_YOUR_KEY -- npx -y @cutoptim/mcp`
|
|
45
|
+
|
|
46
|
+
| Variable | Meaning |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `CUTOPTIM_API_KEY` | your key: `co_live_…`, `co_test_…` (never billed) or the public demo key. Without one, only the `validate_*` tools work. |
|
|
49
|
+
| `CUTOPTIM_BASE_URL` | default `https://api.cutoptim.com` |
|
|
50
|
+
|
|
51
|
+
Node 18 or newer.
|
|
52
|
+
|
|
53
|
+
## Tools
|
|
54
|
+
|
|
55
|
+
| Tool | What it does | Cost |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `optimize_2d` | rectangular parts from sheets: layout, cut plan, yield | one API call |
|
|
58
|
+
| `optimize_1d` | lengths from bars, tubes, profiles | one API call |
|
|
59
|
+
| `optimize_wood` | timber parts by cross-section | one API call |
|
|
60
|
+
| `optimize_nest` | free-form polygon parts on sheets | one API call |
|
|
61
|
+
| `validate_2d` · `validate_1d` · `validate_wood` · `validate_nest` | check a request without solving it | free |
|
|
62
|
+
| `get_job` | read an async `engine: "max"` job | free |
|
|
63
|
+
| `get_usage` | calls used and left this month | free |
|
|
64
|
+
|
|
65
|
+
The arguments of each tool are exactly the request body of its endpoint — the schemas are generated from the
|
|
66
|
+
[OpenAPI document](https://cutoptim.com/engine/openapi.json). Every result carries a short summary for the assistant
|
|
67
|
+
and the API's JSON answer as `structuredContent`.
|
|
68
|
+
|
|
69
|
+
## Quota and billing
|
|
70
|
+
|
|
71
|
+
One tool call is one Engine API call: the same key, quota, rate limits and billing as calling the REST API yourself.
|
|
72
|
+
The client sends an `Idempotency-Key` with every optimize call, so its own retries are never charged twice.
|
|
73
|
+
|
|
74
|
+
## License and support
|
|
75
|
+
|
|
76
|
+
MIT. This repository is published from the CutOptim monorepo; report a bug in
|
|
77
|
+
[Issues](https://github.com/cutoptim/engine-mcp/issues) or write to support@cutoptim.com.
|
package/dist/core.gen.d.ts
CHANGED
|
@@ -40,6 +40,13 @@ export interface ApiAnswer {
|
|
|
40
40
|
export type ApiCall = (req: ApiRequest, signal?: AbortSignal) => Promise<ApiAnswer>;
|
|
41
41
|
export declare const SERVER_NAME = "cutoptim";
|
|
42
42
|
export declare const SERVER_INSTRUCTIONS: string;
|
|
43
|
+
/** Shown by MCP clients and registries next to the server name; the same icons as sdks/mcp/server.json. */
|
|
44
|
+
export declare const SERVER_WEBSITE = "https://cutoptim.com/engine/reference/guides/mcp";
|
|
45
|
+
export declare const SERVER_ICONS: {
|
|
46
|
+
src: string;
|
|
47
|
+
mimeType: string;
|
|
48
|
+
sizes: string[];
|
|
49
|
+
}[];
|
|
43
50
|
export declare function createCutOptimMcpServer(opts: {
|
|
44
51
|
tools: ToolDef[];
|
|
45
52
|
call: ApiCall;
|
package/dist/core.gen.js
CHANGED
|
@@ -18,12 +18,18 @@ export const SERVER_INSTRUCTIONS = 'CutOptim cutting optimization: 2D panels (op
|
|
|
18
18
|
'All sizes are unit-agnostic numbers: keep one unit (e.g. mm) across parts, stock and kerf. ' +
|
|
19
19
|
'engine "max" runs asynchronously: the answer is a jobId, poll it with get_job. ' +
|
|
20
20
|
'get_usage shows the calls left this month. Reference: https://cutoptim.com/engine/reference';
|
|
21
|
+
/** Shown by MCP clients and registries next to the server name; the same icons as sdks/mcp/server.json. */
|
|
22
|
+
export const SERVER_WEBSITE = 'https://cutoptim.com/engine/reference/guides/mcp';
|
|
23
|
+
export const SERVER_ICONS = [
|
|
24
|
+
{ src: 'https://cutoptim.com/logo-square.png', mimeType: 'image/png', sizes: ['512x512'] },
|
|
25
|
+
{ src: 'https://cutoptim.com/logo-square.svg', mimeType: 'image/svg+xml', sizes: ['any'] },
|
|
26
|
+
];
|
|
21
27
|
/** Export strings that are elided from the JSON text block (they stay in structuredContent). */
|
|
22
28
|
const EXPORT_FIELDS = ['svg', 'dxf', 'csv', 'pdf', 'labelsPdf'];
|
|
23
29
|
const MAX_TABLE_ROWS = 25;
|
|
24
30
|
export function createCutOptimMcpServer(opts) {
|
|
25
31
|
const byName = new Map(opts.tools.map((t) => [t.name, t]));
|
|
26
|
-
const server = new Server({ name: SERVER_NAME, title: 'CutOptim Engine', version: opts.version }, { capabilities: { tools: {} }, instructions: SERVER_INSTRUCTIONS });
|
|
32
|
+
const server = new Server({ name: SERVER_NAME, title: 'CutOptim Engine', version: opts.version, websiteUrl: SERVER_WEBSITE, icons: SERVER_ICONS }, { capabilities: { tools: {} }, instructions: SERVER_INSTRUCTIONS });
|
|
27
33
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
28
34
|
tools: opts.tools.map((t) => ({
|
|
29
35
|
name: t.name, title: t.title, description: t.description,
|