@nekzus/mcp-server 0.0.0-development

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 ADDED
@@ -0,0 +1,171 @@
1
+ # MCP Server
2
+
3
+ [![Github Workflow](https://github.com/nekzus/mcp-server/actions/workflows/publish.yml/badge.svg?event=push)](https://github.com/Nekzus/mcp-server/actions/workflows/publish.yml)
4
+ [![npm-version](https://img.shields.io/npm/v/@nekzus/mcp-server.svg)](https://www.npmjs.com/package/@nekzus/mcp-server)
5
+ [![npm-month](https://img.shields.io/npm/dm/@nekzus/mcp-server.svg)](https://www.npmjs.com/package/@nekzus/mcp-server)
6
+ [![npm-total](https://img.shields.io/npm/dt/@nekzus/mcp-server.svg?style=flat)](https://www.npmjs.com/package/@nekzus/mcp-server)
7
+ [![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/maseortega)
8
+
9
+ <div align="center">
10
+
11
+ **A Model Context Protocol (MCP) server that provides utility tools for
12
+ development and testing** </br>_This implementation is built on top of the
13
+ official MCP SDK and offers an extensible architecture for adding new tools_
14
+
15
+ </div>
16
+
17
+ ## 🌟 Features
18
+
19
+ - 🔄 MCP Protocol Implementation
20
+ - 🛠️ Integrated Utility Tools
21
+ - 📝 Schema Validation with Zod
22
+ - 🚀 ESM Support
23
+ - 🔒 Strict TypeScript Types
24
+ - 🧩 Extensible Architecture for New Tools
25
+
26
+ ## 📦 Installation
27
+
28
+ ```bash
29
+ # Global installation (recommended for CLI usage)
30
+ npm install -g @nekzus/mcp-server
31
+
32
+ # Local installation
33
+ npm install @nekzus/mcp-server
34
+ ```
35
+
36
+ ## 🛠️ Available Tools
37
+
38
+ ### 1. greeting
39
+
40
+ Generates a personalized greeting message.
41
+
42
+ **Parameters:**
43
+
44
+ - `name` (string): Recipient's name
45
+
46
+ **Example:**
47
+
48
+ ```typescript
49
+ // Result: 👋 Hello John! Welcome to the MCP server!
50
+ {
51
+ name: "John";
52
+ }
53
+ ```
54
+
55
+ ### 2. card
56
+
57
+ Gets a random card from a standard poker deck.
58
+
59
+ **Parameters:**
60
+
61
+ - No parameters required
62
+
63
+ **Example:**
64
+
65
+ ```typescript
66
+ // Result: 🎴 You drew: Ace of ♠️ Spades
67
+ {}
68
+ ```
69
+
70
+ ### 3. datetime
71
+
72
+ Gets the current date and time for a specific timezone.
73
+
74
+ **Parameters:**
75
+
76
+ - `timeZone` (string, optional): Timezone identifier (e.g., "America/New_York")
77
+ - `locale` (string, optional): Locale identifier (e.g., "en-US")
78
+
79
+ **Example:**
80
+
81
+ ```typescript
82
+ // Result:
83
+ // 🗓️ Date: March 20, 2024
84
+ // ⏰ Time: 7:25:25 PM
85
+ // 🌍 Timezone: America/New_York
86
+ {
87
+ timeZone: "America/New_York",
88
+ locale: "en-US"
89
+ }
90
+ ```
91
+
92
+ ## 🚀 Usage
93
+
94
+ ### As MCP Server
95
+
96
+ 1. **Global Installation:**
97
+
98
+ ```bash
99
+ npm install -g @nekzus/mcp-server
100
+ ```
101
+
102
+ 2. **Execution:**
103
+
104
+ ```bash
105
+ npx @nekzus/mcp-server
106
+ ```
107
+
108
+ ### As a Dependency
109
+
110
+ ```typescript
111
+ import { McpUtilityServer } from "@nekzus/mcp-server";
112
+
113
+ const server = new McpUtilityServer();
114
+ server.start();
115
+ ```
116
+
117
+ ## 🔧 Development
118
+
119
+ ```bash
120
+ # Clone repository
121
+ git clone https://github.com/nekzus/mcp-server.git
122
+
123
+ # Install dependencies
124
+ npm install
125
+
126
+ # Development mode
127
+ npm run dev
128
+
129
+ # Build
130
+ npm run build
131
+
132
+ # Run
133
+ npm start
134
+ ```
135
+
136
+ ## 📁 Project Structure
137
+
138
+ ```
139
+ src/
140
+ ├── types/ # Type definitions
141
+ │ └── index.ts # Shared types
142
+ ├── utils/ # Utilities
143
+ │ ├── cards.ts # Card functions
144
+ │ ├── datetime.ts # Date/time functions
145
+ │ └── schema.ts # Schema conversion
146
+ ├── tools/ # Tool implementations
147
+ │ └── index.ts # Tools registry
148
+ └── index.ts # Main entry point
149
+ ```
150
+
151
+ ## 🔍 Technical Details
152
+
153
+ - **Transport:** Uses `StdioServerTransport` for communication
154
+ - **Validation:** Converts JSON schemas to Zod for input validation
155
+ - **Types:** Fully typed implementation with TypeScript
156
+ - **Error Handling:** Robust error handling and resource cleanup
157
+ - **Signals:** Handles SIGTERM and SIGINT signals for graceful shutdown
158
+
159
+ ## 📄 License
160
+
161
+ MIT © [nekzus]
162
+
163
+ ## 👤 Author
164
+
165
+ **Nekzus**
166
+
167
+ - GitHub: [@nekzus](https://github.com/nekzus)
168
+
169
+ ## 🌟 Support
170
+
171
+ Give a ⭐️ if this project helped you!
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import 'dotenv/config';
3
+ export declare class McpUtilityServer {
4
+ private readonly server;
5
+ private readonly transport;
6
+ private readonly tools;
7
+ constructor();
8
+ private registerTool;
9
+ private initializeTools;
10
+ start(): Promise<void>;
11
+ private cleanup;
12
+ }
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAKA,OAAO,eAAe,CAAC;AAMvB,qBAAa,gBAAgB;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuB;IACjD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;;IAkBxC,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,eAAe;IAQV,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAsBrB,OAAO;CAUxB"}
package/dist/index.js ADDED
@@ -0,0 +1,93 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import 'dotenv/config';
5
+ import availableTools from './tools/index.js';
6
+ import { SchemaConverter } from './utils/schema.js';
7
+ export class McpUtilityServer {
8
+ server;
9
+ transport;
10
+ tools;
11
+ constructor() {
12
+ this.server = new McpServer({
13
+ name: '@nekzus/mcp-server',
14
+ version: '1.0.0',
15
+ description: 'MCP Server implementation providing utility functions and tools for development and testing'
16
+ }, {
17
+ capabilities: {
18
+ resources: {},
19
+ tools: {}
20
+ }
21
+ });
22
+ this.transport = new StdioServerTransport();
23
+ this.tools = availableTools;
24
+ }
25
+ registerTool(tool) {
26
+ try {
27
+ console.log(`[Tool Registration] Registering tool: ${tool.name}`);
28
+ const zodSchema = SchemaConverter.toZod(tool.inputSchema);
29
+ const handler = tool.handler;
30
+ this.server.tool(tool.name, tool.description || '', zodSchema.shape, async (args, extra) => {
31
+ const result = await handler(args, extra);
32
+ return {
33
+ content: [{
34
+ type: 'text',
35
+ text: JSON.stringify(result)
36
+ }]
37
+ };
38
+ });
39
+ console.log(`[Tool Registration] Successfully registered: ${tool.name}`);
40
+ }
41
+ catch (error) {
42
+ console.error(`[Tool Registration] Failed to register tool ${tool.name}:`, error);
43
+ throw error;
44
+ }
45
+ }
46
+ initializeTools() {
47
+ console.log(`[Server] Initializing ${this.tools.length} tools...`);
48
+ for (const tool of this.tools) {
49
+ this.registerTool(tool);
50
+ }
51
+ console.log('[Server] Tool initialization completed successfully');
52
+ }
53
+ async start() {
54
+ try {
55
+ this.initializeTools();
56
+ await this.server.connect(this.transport);
57
+ console.log('[Server] MCP Utility Server is running');
58
+ console.log('[Server] Available tools:', this.tools.map(t => t.name).join(', '));
59
+ // Handle termination signals
60
+ process.on('SIGTERM', () => this.cleanup());
61
+ process.on('SIGINT', () => this.cleanup());
62
+ // Handle stdin close
63
+ process.stdin.on('close', () => {
64
+ console.log('[Server] Input stream closed');
65
+ this.cleanup();
66
+ });
67
+ }
68
+ catch (error) {
69
+ console.error('[Server] Failed to start MCP Utility Server:', error);
70
+ throw error;
71
+ }
72
+ }
73
+ async cleanup() {
74
+ try {
75
+ await this.transport.close();
76
+ console.log('[Server] MCP Utility Server stopped gracefully');
77
+ process.exit(0);
78
+ }
79
+ catch (error) {
80
+ console.error('[Server] Error during cleanup:', error);
81
+ process.exit(1);
82
+ }
83
+ }
84
+ }
85
+ // Auto-start server if this is the main module
86
+ if (import.meta.url === new URL(import.meta.url).href) {
87
+ const server = new McpUtilityServer();
88
+ server.start().catch((error) => {
89
+ console.error('[Server] Fatal error:', error);
90
+ process.exit(1);
91
+ });
92
+ }
93
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAmB,MAAM,mBAAmB,CAAC;AAIrE,MAAM,OAAO,gBAAgB;IACR,MAAM,CAAY;IAClB,SAAS,CAAuB;IAChC,KAAK,CAAkB;IAExC;QACI,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC;YACxB,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,6FAA6F;SAC7G,EAAE;YACC,YAAY,EAAE;gBACV,SAAS,EAAE,EAAE;gBACb,KAAK,EAAE,EAAE;aACZ;SACJ,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC5C,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC;IAChC,CAAC;IAEO,YAAY,CAAC,IAAU;QAC3B,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,yCAAyC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAClE,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,WAAyB,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,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;IACtC,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3B,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
2
+ export declare const greetingTool: Tool;
3
+ export declare const cardTool: Tool;
4
+ export declare const dateTimeTool: Tool;
5
+ declare const availableTools: readonly [{
6
+ [x: string]: unknown;
7
+ name: string;
8
+ inputSchema: {
9
+ [x: string]: unknown;
10
+ type: "object";
11
+ properties?: {
12
+ [x: string]: unknown;
13
+ } | undefined;
14
+ };
15
+ description?: string | undefined;
16
+ }, {
17
+ [x: string]: unknown;
18
+ name: string;
19
+ inputSchema: {
20
+ [x: string]: unknown;
21
+ type: "object";
22
+ properties?: {
23
+ [x: string]: unknown;
24
+ } | undefined;
25
+ };
26
+ description?: string | undefined;
27
+ }, {
28
+ [x: string]: unknown;
29
+ name: string;
30
+ inputSchema: {
31
+ [x: string]: unknown;
32
+ type: "object";
33
+ properties?: {
34
+ [x: string]: unknown;
35
+ } | undefined;
36
+ };
37
+ description?: string | undefined;
38
+ }];
39
+ export default availableTools;
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAS5E,eAAO,MAAM,YAAY,EAAE,IAgC1B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,IA+BtB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,IAuC1B,CAAC;AAGF,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAkD,CAAC;AACvE,eAAe,cAAc,CAAC"}
@@ -0,0 +1,114 @@
1
+ import { getRandomCard } from '../utils/cards.js';
2
+ import { getCurrentDateTime } from '../utils/datetime.js';
3
+ export const greetingTool = {
4
+ name: 'greeting',
5
+ description: 'Generate a personalized greeting message for the specified person',
6
+ inputSchema: {
7
+ type: 'object',
8
+ properties: {
9
+ name: { type: 'string', description: 'Name of the recipient for the greeting' }
10
+ },
11
+ required: ['name']
12
+ },
13
+ handler: async (args, _extra) => {
14
+ try {
15
+ return {
16
+ content: [
17
+ {
18
+ type: 'text',
19
+ text: `👋 Hello ${args.name}! Welcome to the MCP server!`
20
+ }
21
+ ]
22
+ };
23
+ }
24
+ catch (err) {
25
+ return {
26
+ content: [
27
+ {
28
+ type: 'text',
29
+ text: `Error generating greeting for ${args.name}`
30
+ }
31
+ ],
32
+ isError: true
33
+ };
34
+ }
35
+ }
36
+ };
37
+ export const cardTool = {
38
+ name: 'card',
39
+ description: 'Draw a random card from a standard 52-card poker deck',
40
+ inputSchema: {
41
+ type: 'object',
42
+ properties: {},
43
+ required: []
44
+ },
45
+ handler: async (_args, _extra) => {
46
+ try {
47
+ const card = getRandomCard();
48
+ return {
49
+ content: [
50
+ {
51
+ type: 'text',
52
+ text: `🎴 You drew: ${card.value} of ${card.suit}`
53
+ }
54
+ ]
55
+ };
56
+ }
57
+ catch (err) {
58
+ return {
59
+ content: [
60
+ {
61
+ type: 'text',
62
+ text: 'Error drawing card from deck'
63
+ }
64
+ ],
65
+ isError: true
66
+ };
67
+ }
68
+ }
69
+ };
70
+ export const dateTimeTool = {
71
+ name: 'datetime',
72
+ description: 'Get current date and time for a specific timezone and locale',
73
+ inputSchema: {
74
+ type: 'object',
75
+ properties: {
76
+ timeZone: {
77
+ type: 'string',
78
+ description: 'Timezone identifier (e.g., America/New_York, Europe/London, Asia/Tokyo)'
79
+ },
80
+ locale: {
81
+ type: 'string',
82
+ description: 'Locale identifier (e.g., en-US, es-ES, fr-FR)'
83
+ }
84
+ }
85
+ },
86
+ handler: async (args, _extra) => {
87
+ try {
88
+ const { date, time, timeZone } = getCurrentDateTime(args);
89
+ return {
90
+ content: [
91
+ {
92
+ type: 'text',
93
+ text: `🗓️ Date: ${date}\n⏰ Time: ${time}\n🌍 Timezone: ${timeZone}`
94
+ }
95
+ ]
96
+ };
97
+ }
98
+ catch (err) {
99
+ return {
100
+ content: [
101
+ {
102
+ type: 'text',
103
+ text: 'Error retrieving date and time information'
104
+ }
105
+ ],
106
+ isError: true
107
+ };
108
+ }
109
+ }
110
+ };
111
+ // Export all available tools
112
+ const availableTools = [greetingTool, cardTool, dateTimeTool];
113
+ export default availableTools;
114
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAO1D,MAAM,CAAC,MAAM,YAAY,GAAS;IAC9B,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,mEAAmE;IAChF,WAAW,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;SAClF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACP;IACf,OAAO,EAAE,KAAK,EAAE,IAAsB,EAAE,MAA2B,EAA4B,EAAE;QAC7F,IAAI,CAAC;YACD,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,YAAY,IAAI,CAAC,IAAI,8BAA8B;qBAC5D;iBACJ;aACJ,CAAC;QACN,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ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IAAI,EAAE,QAAQ,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YAC1D,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,aAAa,IAAI,aAAa,IAAI,kBAAkB,QAAQ,EAAE;qBACvE;iBACJ;aACJ,CAAC;QACN,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,4CAA4C;qBACrD;iBACJ;gBACD,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC;CACJ,CAAC;AAEF,6BAA6B;AAC7B,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,QAAQ,EAAE,YAAY,CAAU,CAAC;AACvE,eAAe,cAAc,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface Card {
2
+ value: string;
3
+ suit: string;
4
+ }
5
+ export interface ServerResponse<T> {
6
+ content: Array<{
7
+ type: string;
8
+ text: string;
9
+ data?: T;
10
+ }>;
11
+ }
12
+ export type Suit = '♠️ Spades' | '♥️ Hearts' | '♦️ Diamonds' | '♣️ Clubs';
13
+ export type Value = 'Ace' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | 'J' | 'Q' | 'K';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC7B,OAAO,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,CAAC,CAAC;KACZ,CAAC,CAAC;CACN;AAED,MAAM,MAAM,IAAI,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;AAC1E,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { Card, Suit, Value } from '../types/index.js';
2
+ export declare const SUITS: Suit[];
3
+ export declare const VALUES: Value[];
4
+ export declare function getRandomCard(): Card;
5
+ //# sourceMappingURL=cards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../src/utils/cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,KAAK,EAAE,IAAI,EAA0D,CAAC;AACnF,eAAO,MAAM,MAAM,EAAE,KAAK,EAAyE,CAAC;AAEpG,wBAAgB,aAAa,IAAI,IAAI,CAQpC"}
@@ -0,0 +1,11 @@
1
+ export const SUITS = ['♠️ Spades', '♥️ Hearts', '♦️ Diamonds', '♣️ Clubs'];
2
+ export const VALUES = ['Ace', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];
3
+ export function getRandomCard() {
4
+ const randomSuit = SUITS[Math.floor(Math.random() * SUITS.length)];
5
+ const randomValue = VALUES[Math.floor(Math.random() * VALUES.length)];
6
+ return {
7
+ suit: randomSuit,
8
+ value: randomValue
9
+ };
10
+ }
11
+ //# sourceMappingURL=cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cards.js","sourceRoot":"","sources":["../../src/utils/cards.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAW,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;AACnF,MAAM,CAAC,MAAM,MAAM,GAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAEpG,MAAM,UAAU,aAAa;IACzB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACnE,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtE,OAAO;QACH,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,WAAW;KACrB,CAAC;AACN,CAAC"}
@@ -0,0 +1,12 @@
1
+ interface DateTimeOptions {
2
+ timeZone?: string;
3
+ locale?: string;
4
+ }
5
+ interface DateTimeResult {
6
+ date: string;
7
+ time: string;
8
+ timeZone: string;
9
+ }
10
+ export declare function getCurrentDateTime(options?: DateTimeOptions): DateTimeResult;
11
+ export {};
12
+ //# sourceMappingURL=datetime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetime.d.ts","sourceRoot":"","sources":["../../src/utils/datetime.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,cAAc;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,eAAoB,GAAG,cAAc,CA4BhF"}
@@ -0,0 +1,23 @@
1
+ export function getCurrentDateTime(options = {}) {
2
+ const { timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone, locale = 'en-US' } = options;
3
+ const now = new Date();
4
+ const dateFormatter = new Intl.DateTimeFormat(locale, {
5
+ timeZone,
6
+ year: 'numeric',
7
+ month: 'long',
8
+ day: 'numeric'
9
+ });
10
+ const timeFormatter = new Intl.DateTimeFormat(locale, {
11
+ timeZone,
12
+ hour: '2-digit',
13
+ minute: '2-digit',
14
+ second: '2-digit',
15
+ hour12: true
16
+ });
17
+ return {
18
+ date: dateFormatter.format(now),
19
+ time: timeFormatter.format(now),
20
+ timeZone
21
+ };
22
+ }
23
+ //# sourceMappingURL=datetime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetime.js","sourceRoot":"","sources":["../../src/utils/datetime.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,kBAAkB,CAAC,UAA2B,EAAE;IAC5D,MAAM,EACF,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ,EAC3D,MAAM,GAAG,OAAO,EACnB,GAAG,OAAO,CAAC;IAEZ,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IAEvB,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;QAClD,QAAQ;QACR,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,SAAS;KACjB,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;QAClD,QAAQ;QACR,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,IAAI;KACf,CAAC,CAAC;IAEH,OAAO;QACH,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC;QAC/B,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC;QAC/B,QAAQ;KACX,CAAC;AACN,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export interface JsonSchemaProperty {
3
+ type: string;
4
+ description?: string;
5
+ [key: string]: unknown;
6
+ }
7
+ export interface JsonSchema {
8
+ type: 'object';
9
+ properties?: Record<string, JsonSchemaProperty>;
10
+ required?: string[];
11
+ [key: string]: unknown;
12
+ }
13
+ export declare class SchemaConverter {
14
+ private static convertProperty;
15
+ static toZod(schema: JsonSchema): z.ZodObject<any>;
16
+ }
17
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/utils/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,qBAAa,eAAe;IACxB,OAAO,CAAC,MAAM,CAAC,eAAe;IAa9B,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC;CAgBrD"}
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ export class SchemaConverter {
3
+ static convertProperty(prop) {
4
+ switch (prop.type) {
5
+ case 'string':
6
+ return prop.description ? z.string().describe(prop.description) : z.string();
7
+ case 'number':
8
+ return z.number();
9
+ case 'boolean':
10
+ return z.boolean();
11
+ default:
12
+ return z.any();
13
+ }
14
+ }
15
+ static toZod(schema) {
16
+ if (schema.type !== 'object') {
17
+ throw new Error('Only object schemas are supported');
18
+ }
19
+ const shape = {};
20
+ if (schema.properties) {
21
+ Object.entries(schema.properties).forEach(([key, prop]) => {
22
+ shape[key] = this.convertProperty(prop);
23
+ });
24
+ }
25
+ const zodSchema = z.object(shape);
26
+ return schema.required?.length ? zodSchema.required() : zodSchema;
27
+ }
28
+ }
29
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/utils/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,MAAM,OAAO,eAAe;IAChB,MAAM,CAAC,eAAe,CAAC,IAAwB;QACnD,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAChB,KAAK,QAAQ;gBACT,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YACjF,KAAK,QAAQ;gBACT,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,SAAS;gBACV,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;YACvB;gBACI,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;QACvB,CAAC;IACL,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,MAAkB;QAC3B,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACzD,CAAC;QAED,MAAM,KAAK,GAA8B,EAAE,CAAC;QAE5C,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;gBACtD,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC,CAAC,CAAC;QACP,CAAC;QAED,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE,CAAC;CACJ"}
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "@nekzus/mcp-server",
3
+ "version": "0.0.0-development",
4
+ "description": "Personal MCP Server implementation providing extensible utility functions and tools for development and testing purposes",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "mcp-server": "dist/index.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "dev": "tsx src/index.ts",
19
+ "start": "node dist/index.js",
20
+ "test": "jest --passWithNoTests",
21
+ "lint": "eslint . --ext .ts",
22
+ "format": "prettier --write \"src/**/*.ts\"",
23
+ "commit": "git-cz",
24
+ "semantic-release": "semantic-release --branches main",
25
+ "prepare": "npm run build",
26
+ "prepublishOnly": "npm test && npm run lint",
27
+ "preversion": "npm run lint",
28
+ "version": "npm run format && git add -A src",
29
+ "postversion": "git push && git push --tags"
30
+ },
31
+ "keywords": [
32
+ "mcp",
33
+ "server",
34
+ "typescript",
35
+ "greetings",
36
+ "cards",
37
+ "games"
38
+ ],
39
+ "author": "nekzus",
40
+ "license": "MIT",
41
+ "directories": {
42
+ "lib": "dist",
43
+ "bin": "dist/index.js",
44
+ "types": "dist/index.d.ts",
45
+ "files": [
46
+ "dist",
47
+ "README.md",
48
+ "LICENSE"
49
+ ]
50
+ },
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "https://github.com/Nekzus/mcp-server.git"
54
+ },
55
+ "bugs": {
56
+ "url": "https://github.com/Nekzus/mcp-server/issues"
57
+ },
58
+ "homepage": "https://github.com/Nekzus/mcp-server#readme",
59
+ "dependencies": {
60
+ "@modelcontextprotocol/sdk": "1.7.0",
61
+ "dotenv": "16.4.7",
62
+ "zod": "3.24.2"
63
+ },
64
+ "devDependencies": {
65
+ "semantic-release": "^24.2.3",
66
+ "cz-conventional-changelog": "3.3.0",
67
+ "@types/jest": "29.5.14",
68
+ "@types/node": "22.13.10",
69
+ "@typescript-eslint/eslint-plugin": "8.27.0",
70
+ "@typescript-eslint/parser": "8.27.0",
71
+ "eslint": "9.22.0",
72
+ "jest": "^29.7.0",
73
+ "prettier": "3.5.3",
74
+ "ts-jest": "29.2.6",
75
+ "tsx": "4.19.3",
76
+ "typescript": "5.8.2"
77
+ },
78
+ "engines": {
79
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
80
+ },
81
+ "config": {
82
+ "commitizen": {
83
+ "path": "./node_modules/cz-conventional-changelog"
84
+ }
85
+ },
86
+ "publishConfig": {
87
+ "access": "public"
88
+ }
89
+ }