gwanli 0.1.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/dist/cli.d.ts +2 -0
- package/dist/cli.js +15 -0
- package/dist/mcp.js +28 -0
- package/package.json +29 -0
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import { Command } from 'commander';
|
3
|
+
import { helloGwanli } from 'gwanli-core';
|
4
|
+
const program = new Command('gwanli');
|
5
|
+
program
|
6
|
+
.name('gwanli')
|
7
|
+
.description('Gwanli - Notion management CLI')
|
8
|
+
.version('0.1.0');
|
9
|
+
program
|
10
|
+
.command('hello')
|
11
|
+
.description('Say hello from Gwanli')
|
12
|
+
.action(() => {
|
13
|
+
console.log(helloGwanli());
|
14
|
+
});
|
15
|
+
program.parse();
|
package/dist/mcp.js
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
4
|
+
import { z } from "zod";
|
5
|
+
// Create an MCP server
|
6
|
+
const server = new McpServer({
|
7
|
+
name: "demo-server",
|
8
|
+
version: "1.0.0"
|
9
|
+
});
|
10
|
+
// Add an addition tool
|
11
|
+
server.registerTool("add", {
|
12
|
+
description: "Add two numbers",
|
13
|
+
inputSchema: { a: z.number(), b: z.number() }
|
14
|
+
}, async ({ a, b }) => ({
|
15
|
+
content: [{ type: "text", text: String(a + b) }]
|
16
|
+
}));
|
17
|
+
// Add a dynamic greeting resource
|
18
|
+
server.resource("greeting", new ResourceTemplate("greeting://{name}", { list: undefined }), {
|
19
|
+
description: "Dynamic greeting generator"
|
20
|
+
}, async (uri, variables) => ({
|
21
|
+
contents: [{
|
22
|
+
uri: uri.href,
|
23
|
+
text: `Hello, ${variables.name}!`
|
24
|
+
}]
|
25
|
+
}));
|
26
|
+
// Start receiving messages on stdin and sending messages on stdout
|
27
|
+
const transport = new StdioServerTransport();
|
28
|
+
await server.connect(transport);
|
package/package.json
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"name": "gwanli",
|
3
|
+
"version": "0.1.0",
|
4
|
+
"description": "Notion management with AI capabilities - CLI and MCP server",
|
5
|
+
"type": "module",
|
6
|
+
"main": "dist/cli.js",
|
7
|
+
"bin": {
|
8
|
+
"gwanli": "dist/cli.js",
|
9
|
+
"gwanli-mcp": "dist/mcp.js"
|
10
|
+
},
|
11
|
+
"files": [
|
12
|
+
"dist"
|
13
|
+
],
|
14
|
+
"scripts": {
|
15
|
+
"build": "tsc && cp ../gwanli-mcp/dist/index.js dist/mcp.js",
|
16
|
+
"clean": "rm -rf dist"
|
17
|
+
},
|
18
|
+
"author": "Ivan Leo & Timothy Chen",
|
19
|
+
"license": "MIT",
|
20
|
+
"dependencies": {
|
21
|
+
"commander": "^11.0.0",
|
22
|
+
"gwanli-core": "{\n gwanli-core: 0.1.0\n}",
|
23
|
+
"gwanli-mcp": "{\n gwanli-mcp: 0.1.0\n}"
|
24
|
+
},
|
25
|
+
"devDependencies": {
|
26
|
+
"@types/node": "^20.0.0",
|
27
|
+
"typescript": "^5.0.0"
|
28
|
+
}
|
29
|
+
}
|