@emseepea/create-tool-server 0.0.1 → 0.0.3
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 +50 -11
- package/{dist → initializer-dist}/template/package.json +6 -5
- package/{dist/template/src/server.ts → initializer-dist/template/src/capabilities/tool.get-bean-details.ts} +4 -27
- package/initializer-dist/template/src/server.ts +22 -0
- package/package.json +28 -13
- /package/{dist → initializer-dist}/LICENSE +0 -0
- /package/{dist → initializer-dist}/create.mjs +0 -0
- /package/{dist → initializer-dist}/template/README.md +0 -0
- /package/{dist → initializer-dist}/template/eval/meaning.test.mjs +0 -0
- /package/{dist → initializer-dist}/template/test/server.test.mjs +0 -0
- /package/{dist → initializer-dist}/template/tsconfig.json +0 -0
package/README.md
CHANGED
|
@@ -1,22 +1,61 @@
|
|
|
1
1
|
# `@emseepea/create-tool-server`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
tool. The package builds its starter from the maintained
|
|
5
|
-
[first public tool example](https://github.com/emseepea/emseepea/tree/main/examples/basic-no-ui).
|
|
6
|
-
|
|
7
|
-
## Create the Project
|
|
8
|
-
|
|
9
|
-
This initializer is queued for the next pre-alpha release and is not yet
|
|
10
|
-
available from npm.
|
|
3
|
+
This directory is both the maintained example and its public npm initializer.
|
|
11
4
|
|
|
12
5
|
```sh
|
|
13
6
|
npm init @emseepea/tool-server@next -- my-server
|
|
14
7
|
```
|
|
15
8
|
|
|
9
|
+
<!-- generated-project-readme -->
|
|
10
|
+
|
|
11
|
+
## Your First Public Tool
|
|
12
|
+
|
|
13
|
+
Choose this example when you want the smallest working server with one public,
|
|
14
|
+
read-only tool and no web page.
|
|
15
|
+
|
|
16
|
+
The `get-bean-details` tool returns useful details about one sample coffee. Em
|
|
17
|
+
See Pea checks the question and result before returning them through the public
|
|
18
|
+
`@emseepea/server` API.
|
|
19
|
+
|
|
20
|
+
## What This Example Includes
|
|
21
|
+
|
|
22
|
+
- Model Context Protocol (MCP) `2026-07-28` over `POST /mcp`
|
|
23
|
+
- one public, read-only tool with sample data
|
|
24
|
+
- checks for tool input and output
|
|
25
|
+
- local use on your computer only
|
|
26
|
+
|
|
27
|
+
It does not include sign-in, saved sessions, live progress, changes to data, or
|
|
28
|
+
production network setup.
|
|
29
|
+
|
|
30
|
+
## Run
|
|
31
|
+
|
|
32
|
+
From this directory:
|
|
33
|
+
|
|
16
34
|
```sh
|
|
17
|
-
cd my-server
|
|
18
35
|
npm install
|
|
19
|
-
npm
|
|
20
|
-
npm run lint
|
|
36
|
+
npm run build
|
|
21
37
|
npm start
|
|
22
38
|
```
|
|
39
|
+
|
|
40
|
+
The endpoint is `http://127.0.0.1:3000/mcp` and the health check is
|
|
41
|
+
`http://127.0.0.1:3000/healthz`.
|
|
42
|
+
|
|
43
|
+
## Check This Example
|
|
44
|
+
|
|
45
|
+
[Ordinary tests](test/) live in `test/`.
|
|
46
|
+
The [AI tool-choice and understanding test](eval/meaning.test.mjs) lives separately in `eval/`.
|
|
47
|
+
The commands below run each suite independently.
|
|
48
|
+
|
|
49
|
+
Run its build and MCP checks:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
npm test
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Check that Claude chooses the details tool and understands its result:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
npm run test:llm
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
If Claude is not already signed in, run `claude auth login` first.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emseepea-starter",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"
|
|
4
|
+
"description": "Create an Em See Pea server with one public tool.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
@@ -13,10 +13,6 @@
|
|
|
13
13
|
"test:llm:built": "emseepea-test eval",
|
|
14
14
|
"lint": "oxlint src test eval"
|
|
15
15
|
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@emseepea/server": "0.0.4",
|
|
18
|
-
"zod": "4.4.3"
|
|
19
|
-
},
|
|
20
16
|
"devDependencies": {
|
|
21
17
|
"@emseepea/testing": "0.2.1",
|
|
22
18
|
"@types/node": "24.13.3",
|
|
@@ -25,5 +21,10 @@
|
|
|
25
21
|
},
|
|
26
22
|
"engines": {
|
|
27
23
|
"node": ">=22"
|
|
24
|
+
},
|
|
25
|
+
"private": true,
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@emseepea/server": "0.2.1",
|
|
28
|
+
"zod": "4.4.3"
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineTool,
|
|
1
|
+
import { defineTool, type CapabilityModuleFactory } from "@emseepea/server";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
const beanNames = ["Harbour Dawn", "Highland Bloom"] as const;
|
|
@@ -29,14 +29,12 @@ const beans: Record<(typeof beanNames)[number], z.input<typeof beanDetailsSchema
|
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
export default (() => defineTool({
|
|
33
33
|
name: "get-bean-details",
|
|
34
34
|
access: "public",
|
|
35
35
|
title: "Coffee Bean Details",
|
|
36
36
|
description: "Get origin, processing, roast, and tasting details for a sample coffee bean.",
|
|
37
|
-
inputSchema: z.object({
|
|
38
|
-
name: z.enum(beanNames),
|
|
39
|
-
}),
|
|
37
|
+
inputSchema: z.object({ name: z.enum(beanNames) }),
|
|
40
38
|
outputSchema: beanDetailsSchema,
|
|
41
39
|
handler: ({ name }) => {
|
|
42
40
|
const data = beans[name];
|
|
@@ -46,25 +44,4 @@ const getBeanDetails = defineTool({
|
|
|
46
44
|
data,
|
|
47
45
|
};
|
|
48
46
|
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const handler = createEmseepea({
|
|
52
|
-
name: "emseepea-basic-no-ui",
|
|
53
|
-
version: "0.0.0",
|
|
54
|
-
instructions: "Use get-bean-details for information about a sample coffee bean.",
|
|
55
|
-
tools: [getBeanDetails],
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
const running = await serveEmseepea(handler, {
|
|
59
|
-
port: Number.parseInt(process.env.PORT ?? "3000", 10),
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
console.log(`Em See Pea basic no-UI example listening at ${running.url}`);
|
|
63
|
-
|
|
64
|
-
async function shutdown(): Promise<void> {
|
|
65
|
-
await running.close();
|
|
66
|
-
process.exitCode = 0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
process.once("SIGINT", () => void shutdown());
|
|
70
|
-
process.once("SIGTERM", () => void shutdown());
|
|
47
|
+
})) satisfies CapabilityModuleFactory;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createEmseepea, discoverCapabilities, serveEmseepea } from "@emseepea/server";
|
|
2
|
+
|
|
3
|
+
const handler = createEmseepea({
|
|
4
|
+
name: "emseepea-basic-no-ui",
|
|
5
|
+
version: "0.0.0",
|
|
6
|
+
instructions: "Use get-bean-details for information about a sample coffee bean.",
|
|
7
|
+
...await discoverCapabilities(new URL("./capabilities/", import.meta.url)),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const running = await serveEmseepea(handler, {
|
|
11
|
+
port: Number.parseInt(process.env.PORT ?? "3000", 10),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
console.log(`Em See Pea basic no-UI example listening at ${running.url}`);
|
|
15
|
+
|
|
16
|
+
async function shutdown(): Promise<void> {
|
|
17
|
+
await running.close();
|
|
18
|
+
process.exitCode = 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
process.once("SIGINT", () => void shutdown());
|
|
22
|
+
process.once("SIGTERM", () => void shutdown());
|
package/package.json
CHANGED
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emseepea/create-tool-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Create an Em See Pea server with one public tool.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
6
|
+
"type": "module",
|
|
7
|
+
"starterDependencies": ["@emseepea/server", "zod"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "npm run build:example && npm run build:initializer",
|
|
10
|
+
"build:example": "tsc -p tsconfig.json",
|
|
11
|
+
"build:initializer": "node ../../scripts/build-initializer.mjs",
|
|
12
|
+
"start": "node dist/server.js",
|
|
13
|
+
"test": "npm run build && npm run test:built",
|
|
14
|
+
"test:built": "node --test test/*.test.mjs",
|
|
15
|
+
"test:llm": "npm run build && npm run test:llm:built",
|
|
16
|
+
"test:llm:built": "emseepea-test eval",
|
|
17
|
+
"lint": "oxlint src test eval",
|
|
18
|
+
"prepack": "npm run build:initializer"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@emseepea/server": "0.2.1",
|
|
22
|
+
"zod": "4.4.3",
|
|
23
|
+
"@emseepea/testing": "0.2.1",
|
|
24
|
+
"@types/node": "24.13.3",
|
|
25
|
+
"typescript": "6.0.3",
|
|
26
|
+
"oxlint": "1.80.0"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=22"
|
|
10
30
|
},
|
|
31
|
+
"repository": { "type": "git", "url": "git+https://github.com/emseepea/emseepea.git", "directory": "examples/basic-no-ui" },
|
|
11
32
|
"homepage": "https://emseepea.github.io/emseepea/examples/",
|
|
12
33
|
"bugs": "https://github.com/emseepea/emseepea/issues",
|
|
13
34
|
"publishConfig": { "access": "public", "provenance": true, "tag": "next" },
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"files": ["dist"],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "node ../../scripts/build-initializer.mjs",
|
|
19
|
-
"prepack": "npm run build"
|
|
20
|
-
},
|
|
21
|
-
"engines": { "node": ">=22" }
|
|
35
|
+
"bin": { "create-tool-server": "./initializer-dist/create.mjs" },
|
|
36
|
+
"files": ["initializer-dist"]
|
|
22
37
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|