@agentailor/create-mcp-server 0.8.0 → 0.10.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.
@@ -1,109 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { getServerTemplate, getIndexTemplate, getReadmeTemplate } from './index.js';
3
- describe('fastmcp templates', () => {
4
- const projectName = 'test-project';
5
- describe('getServerTemplate', () => {
6
- it('should include project name in server config', () => {
7
- const template = getServerTemplate(projectName);
8
- expect(template).toContain(`name: '${projectName}'`);
9
- });
10
- it('should import FastMCP', () => {
11
- const template = getServerTemplate(projectName);
12
- expect(template).toContain("from 'fastmcp'");
13
- expect(template).toContain('FastMCP');
14
- });
15
- it('should include example prompt', () => {
16
- const template = getServerTemplate(projectName);
17
- expect(template).toContain('greeting-template');
18
- expect(template).toContain('addPrompt');
19
- });
20
- it('should include example tool', () => {
21
- const template = getServerTemplate(projectName);
22
- expect(template).toContain('start-notification-stream');
23
- expect(template).toContain('addTool');
24
- });
25
- it('should include example resource', () => {
26
- const template = getServerTemplate(projectName);
27
- expect(template).toContain('greeting-resource');
28
- expect(template).toContain('addResource');
29
- });
30
- it('should use zod for parameter validation', () => {
31
- const template = getServerTemplate(projectName);
32
- expect(template).toContain("from 'zod'");
33
- expect(template).toContain('z.object');
34
- });
35
- });
36
- describe('getIndexTemplate', () => {
37
- it('should import server from server.ts', () => {
38
- const template = getIndexTemplate();
39
- expect(template).toContain("from './server.js'");
40
- });
41
- it('should use httpStream transport', () => {
42
- const template = getIndexTemplate();
43
- expect(template).toContain("transportType: 'httpStream'");
44
- });
45
- it('should use PORT from environment variable', () => {
46
- const template = getIndexTemplate();
47
- expect(template).toContain('process.env.PORT');
48
- });
49
- it('should NOT include stateless option by default', () => {
50
- const template = getIndexTemplate();
51
- expect(template).not.toContain('stateless: true');
52
- });
53
- it('should include stateless option when specified', () => {
54
- const template = getIndexTemplate({ stateless: true });
55
- expect(template).toContain('stateless: true');
56
- });
57
- it('should use stdio transportType when transport is stdio', () => {
58
- const template = getIndexTemplate({ transport: 'stdio' });
59
- expect(template).toContain('transportType: "stdio"');
60
- expect(template).not.toContain('httpStream');
61
- expect(template).not.toContain('PORT');
62
- });
63
- });
64
- describe('getReadmeTemplate', () => {
65
- it('should include project name', () => {
66
- const template = getReadmeTemplate(projectName);
67
- expect(template).toContain(`# ${projectName}`);
68
- });
69
- it('should mention FastMCP', () => {
70
- const template = getReadmeTemplate(projectName);
71
- expect(template).toContain('FastMCP');
72
- expect(template).toContain('github.com/punkpeye/fastmcp');
73
- });
74
- it('should include npm commands by default', () => {
75
- const template = getReadmeTemplate(projectName);
76
- expect(template).toContain('npm install');
77
- expect(template).toContain('npm run dev');
78
- });
79
- it('should use pnpm commands when specified', () => {
80
- const template = getReadmeTemplate(projectName, { packageManager: 'pnpm' });
81
- expect(template).toContain('pnpm install');
82
- expect(template).toContain('pnpm dev');
83
- });
84
- it('should describe stateful mode by default', () => {
85
- const template = getReadmeTemplate(projectName);
86
- expect(template).toContain('stateful');
87
- });
88
- it('should describe stateless mode when specified', () => {
89
- const template = getReadmeTemplate(projectName, { stateless: true });
90
- expect(template).toContain('stateless');
91
- });
92
- it('should NOT include HTTP endpoint section for stdio', () => {
93
- const template = getReadmeTemplate(projectName, { transport: 'stdio' });
94
- expect(template).not.toContain('POST /mcp');
95
- expect(template).not.toContain('GET /health');
96
- });
97
- it('should include MCP Inspector CLI commands for stdio', () => {
98
- const template = getReadmeTemplate(projectName, { transport: 'stdio' });
99
- expect(template).toContain('inspect:tools');
100
- expect(template).toContain('inspect:prompts');
101
- expect(template).toContain('inspect:resources');
102
- });
103
- it('should NOT include Docker section for stdio', () => {
104
- const template = getReadmeTemplate(projectName, { transport: 'stdio' });
105
- expect(template).not.toContain('docker build');
106
- expect(template).not.toContain('Dockerfile');
107
- });
108
- });
109
- });