ntfy-mcp-server 1.0.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.
Files changed (59) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +423 -0
  3. package/dist/config/index.d.ts +23 -0
  4. package/dist/config/index.js +111 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.js +108 -0
  7. package/dist/mcp-server/resources/ntfyResource/getNtfyTopic.d.ts +2 -0
  8. package/dist/mcp-server/resources/ntfyResource/getNtfyTopic.js +111 -0
  9. package/dist/mcp-server/resources/ntfyResource/index.d.ts +12 -0
  10. package/dist/mcp-server/resources/ntfyResource/index.js +72 -0
  11. package/dist/mcp-server/resources/ntfyResource/types.d.ts +27 -0
  12. package/dist/mcp-server/resources/ntfyResource/types.js +8 -0
  13. package/dist/mcp-server/server.d.ts +40 -0
  14. package/dist/mcp-server/server.js +245 -0
  15. package/dist/mcp-server/tools/ntfyTool/index.d.ts +11 -0
  16. package/dist/mcp-server/tools/ntfyTool/index.js +110 -0
  17. package/dist/mcp-server/tools/ntfyTool/ntfyMessage.d.ts +9 -0
  18. package/dist/mcp-server/tools/ntfyTool/ntfyMessage.js +289 -0
  19. package/dist/mcp-server/tools/ntfyTool/types.d.ts +252 -0
  20. package/dist/mcp-server/tools/ntfyTool/types.js +144 -0
  21. package/dist/mcp-server/utils/registrationHelper.d.ts +48 -0
  22. package/dist/mcp-server/utils/registrationHelper.js +63 -0
  23. package/dist/services/ntfy/constants.d.ts +37 -0
  24. package/dist/services/ntfy/constants.js +37 -0
  25. package/dist/services/ntfy/errors.d.ts +79 -0
  26. package/dist/services/ntfy/errors.js +134 -0
  27. package/dist/services/ntfy/index.d.ts +33 -0
  28. package/dist/services/ntfy/index.js +56 -0
  29. package/dist/services/ntfy/publisher.d.ts +66 -0
  30. package/dist/services/ntfy/publisher.js +229 -0
  31. package/dist/services/ntfy/subscriber.d.ts +81 -0
  32. package/dist/services/ntfy/subscriber.js +502 -0
  33. package/dist/services/ntfy/types.d.ts +161 -0
  34. package/dist/services/ntfy/types.js +4 -0
  35. package/dist/services/ntfy/utils.d.ts +85 -0
  36. package/dist/services/ntfy/utils.js +410 -0
  37. package/dist/types-global/errors.d.ts +35 -0
  38. package/dist/types-global/errors.js +39 -0
  39. package/dist/types-global/mcp.d.ts +30 -0
  40. package/dist/types-global/mcp.js +25 -0
  41. package/dist/types-global/tool.d.ts +61 -0
  42. package/dist/types-global/tool.js +99 -0
  43. package/dist/utils/errorHandler.d.ts +98 -0
  44. package/dist/utils/errorHandler.js +271 -0
  45. package/dist/utils/idGenerator.d.ts +94 -0
  46. package/dist/utils/idGenerator.js +149 -0
  47. package/dist/utils/index.d.ts +13 -0
  48. package/dist/utils/index.js +16 -0
  49. package/dist/utils/logger.d.ts +36 -0
  50. package/dist/utils/logger.js +92 -0
  51. package/dist/utils/rateLimiter.d.ts +115 -0
  52. package/dist/utils/rateLimiter.js +180 -0
  53. package/dist/utils/requestContext.d.ts +68 -0
  54. package/dist/utils/requestContext.js +91 -0
  55. package/dist/utils/sanitization.d.ts +224 -0
  56. package/dist/utils/sanitization.js +367 -0
  57. package/dist/utils/security.d.ts +26 -0
  58. package/dist/utils/security.js +27 -0
  59. package/package.json +47 -0
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @file security.ts
3
+ * @description Compatibility module that re-exports all security utilities
4
+ * from the modularized files. This ensures a clean modern architecture
5
+ * while maintaining a single import point for security-related functionality.
6
+ */
7
+ export * from './requestContext.js';
8
+ export * from './sanitization.js';
9
+ import { RateLimiter } from './rateLimiter.js';
10
+ declare const _default: {
11
+ configureContext: (config: Partial<import("./requestContext.js").ContextConfig>) => import("./requestContext.js").ContextConfig;
12
+ createRequestContext: (additionalContext?: Record<string, unknown>) => import("./rateLimiter.js").RequestContext;
13
+ generateSecureRandomString: (length?: number, chars?: string) => string;
14
+ sanitizeInput: {
15
+ string: (input: string, options?: import("./sanitization.js").SanitizeStringOptions) => string;
16
+ html: (input: string, config?: import("./sanitization.js").HtmlSanitizeConfig) => string;
17
+ url: (input: string, allowedProtocols?: string[]) => string;
18
+ path: (input: string, options?: import("./sanitization.js").PathSanitizeOptions) => string;
19
+ json: <T = unknown>(input: string, maxSize?: number) => T;
20
+ number: (input: number | string, min?: number, max?: number) => number;
21
+ };
22
+ sanitizeInputForLogging: (input: unknown) => unknown;
23
+ RateLimiter: typeof RateLimiter;
24
+ rateLimiter: RateLimiter;
25
+ };
26
+ export default _default;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @file security.ts
3
+ * @description Compatibility module that re-exports all security utilities
4
+ * from the modularized files. This ensures a clean modern architecture
5
+ * while maintaining a single import point for security-related functionality.
6
+ */
7
+ // Re-export everything from requestContext.ts
8
+ export * from './requestContext.js';
9
+ // Re-export everything from sanitization.ts
10
+ export * from './sanitization.js';
11
+ // Import the default exports from each module
12
+ import requestContext from './requestContext.js';
13
+ import sanitization from './sanitization.js';
14
+ import { rateLimiter, RateLimiter } from './rateLimiter.js';
15
+ // Re-export the combined default object
16
+ export default {
17
+ // Request context components
18
+ configureContext: requestContext.configureContext,
19
+ createRequestContext: requestContext.createRequestContext,
20
+ generateSecureRandomString: requestContext.generateSecureRandomString,
21
+ // Sanitization components
22
+ sanitizeInput: sanitization.sanitizeInput,
23
+ sanitizeInputForLogging: sanitization.sanitizeInputForLogging,
24
+ // Re-export rateLimiter for compatibility
25
+ RateLimiter,
26
+ rateLimiter
27
+ };
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "ntfy-mcp-server",
3
+ "version": "1.0.0",
4
+ "description": "A beginner-friendly foundation for building Model Context Protocol (MCP) servers (and in the future also clients) with TypeScript. This template provides a comprehensive starting point with production-ready utilities, well-structured code, and working examples for building an MCP server. Copy this repo to kickstart your own MCP server and set your **vibe code** session up for success!",
5
+ "main": "dist/index.js",
6
+ "type": "module",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "clean": "ts-node scripts/clean.ts",
13
+ "rebuild": "npm run clean && npm run build",
14
+ "tree": "ts-node scripts/tree.ts",
15
+ "start": "node dist/index.js",
16
+ "watch": "tail -f logs/combined.log"
17
+ },
18
+ "dependencies": {
19
+ "@modelcontextprotocol/sdk": "^1.8.0",
20
+ "@types/node": "^22.13.14",
21
+ "@types/sanitize-html": "^2.13.0",
22
+ "@types/validator": "^13.12.3",
23
+ "@types/xss-filters": "^1.2.0",
24
+ "dotenv": "^16.4.7",
25
+ "path-normalize": "^6.0.13",
26
+ "sanitize-html": "^2.15.0",
27
+ "ts-node": "^10.9.2",
28
+ "typescript": "^5.8.2",
29
+ "undici-types": "^7.5.0",
30
+ "validator": "^13.15.0",
31
+ "winston": "^3.17.0",
32
+ "winston-daily-rotate-file": "^5.0.0",
33
+ "xss-filters": "^1.2.7"
34
+ },
35
+ "keywords": [
36
+ "typescript",
37
+ "template",
38
+ "MCP",
39
+ "model-context-protocol",
40
+ "vibe-code",
41
+ "LLM",
42
+ "AI-integration",
43
+ "server"
44
+ ],
45
+ "author": "Casey Hand @cyanheads",
46
+ "license": "Apache-2.0"
47
+ }