@agentailor/create-mcp-server 0.4.0 → 0.4.1
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.
|
@@ -6,13 +6,16 @@ export function getPackageJsonTemplate(projectName, options) {
|
|
|
6
6
|
const commonDevDependencies = {
|
|
7
7
|
typescript: '^5.9.3',
|
|
8
8
|
'@modelcontextprotocol/inspector': '^0.18.0',
|
|
9
|
+
'@types/node': '^25.0.3',
|
|
9
10
|
};
|
|
10
11
|
const zodDependency = { zod: '^4.3.5' };
|
|
12
|
+
const dotEnvDependency = { dotenv: '^17.2.3' };
|
|
11
13
|
if (framework === 'fastmcp') {
|
|
12
14
|
// FastMCP dependencies - simpler setup
|
|
13
15
|
dependencies = {
|
|
14
16
|
fastmcp: '^3.26.8',
|
|
15
17
|
...zodDependency,
|
|
18
|
+
...dotEnvDependency,
|
|
16
19
|
};
|
|
17
20
|
devDependencies = {
|
|
18
21
|
...commonDevDependencies,
|
|
@@ -24,14 +27,13 @@ export function getPackageJsonTemplate(projectName, options) {
|
|
|
24
27
|
'@modelcontextprotocol/sdk': '^1.25.1',
|
|
25
28
|
express: '^5.2.1',
|
|
26
29
|
...zodDependency,
|
|
30
|
+
...dotEnvDependency,
|
|
27
31
|
};
|
|
28
32
|
if (withOAuth) {
|
|
29
|
-
dependencies['dotenv'] = '^17.2.3';
|
|
30
33
|
dependencies['jose'] = '^6.1.3';
|
|
31
34
|
}
|
|
32
35
|
devDependencies = {
|
|
33
36
|
'@types/express': '^5.0.6',
|
|
34
|
-
'@types/node': '^25.0.3',
|
|
35
37
|
...commonDevDependencies,
|
|
36
38
|
};
|
|
37
39
|
}
|
|
@@ -17,6 +17,11 @@ describe('common templates', () => {
|
|
|
17
17
|
expect(pkg.dependencies['@modelcontextprotocol/sdk']).toBeDefined();
|
|
18
18
|
expect(pkg.dependencies['express']).toBeDefined();
|
|
19
19
|
});
|
|
20
|
+
it('should include dotenv for SDK', () => {
|
|
21
|
+
const template = getPackageJsonTemplate(projectName);
|
|
22
|
+
const pkg = JSON.parse(template);
|
|
23
|
+
expect(pkg.dependencies['dotenv']).toBeDefined();
|
|
24
|
+
});
|
|
20
25
|
it('should use FastMCP package when framework is fastmcp', () => {
|
|
21
26
|
const template = getPackageJsonTemplate(projectName, { framework: 'fastmcp' });
|
|
22
27
|
const pkg = JSON.parse(template);
|
|
@@ -24,10 +29,14 @@ describe('common templates', () => {
|
|
|
24
29
|
expect(pkg.dependencies['@modelcontextprotocol/sdk']).toBeUndefined();
|
|
25
30
|
expect(pkg.dependencies['express']).toBeUndefined();
|
|
26
31
|
});
|
|
27
|
-
it('should include
|
|
28
|
-
const template = getPackageJsonTemplate(projectName, { framework: '
|
|
32
|
+
it('should include dotenv for FastMCP', () => {
|
|
33
|
+
const template = getPackageJsonTemplate(projectName, { framework: 'fastmcp' });
|
|
29
34
|
const pkg = JSON.parse(template);
|
|
30
35
|
expect(pkg.dependencies['dotenv']).toBeDefined();
|
|
36
|
+
});
|
|
37
|
+
it('should include jose dependency when withOAuth is true for SDK', () => {
|
|
38
|
+
const template = getPackageJsonTemplate(projectName, { framework: 'sdk', withOAuth: true });
|
|
39
|
+
const pkg = JSON.parse(template);
|
|
31
40
|
expect(pkg.dependencies['jose']).toBeDefined();
|
|
32
41
|
});
|
|
33
42
|
it('should not include @types/express for FastMCP', () => {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export function getIndexTemplate(options) {
|
|
2
2
|
const stateless = options?.stateless ?? false;
|
|
3
3
|
const statelessConfig = stateless ? '\n stateless: true,' : '';
|
|
4
|
-
return `
|
|
4
|
+
return `
|
|
5
|
+
import 'dotenv/config';
|
|
6
|
+
import { server } from './server.js';
|
|
5
7
|
|
|
6
8
|
const PORT = Number(process.env.PORT) || 3000;
|
|
7
9
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export function getIndexTemplate(options) {
|
|
2
2
|
const withOAuth = options?.withOAuth ?? false;
|
|
3
3
|
const imports = withOAuth
|
|
4
|
-
? `import
|
|
4
|
+
? `import 'dotenv/config';
|
|
5
|
+
import { type Request, type Response } from 'express';
|
|
5
6
|
import { randomUUID } from 'node:crypto';
|
|
6
7
|
import { createMcpExpressApp } from '@modelcontextprotocol/sdk/server/express.js';
|
|
7
8
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Options parameter added for type consistency with stateful template (OAuth not supported in stateless)
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
3
|
export function getIndexTemplate(options) {
|
|
4
|
-
return `import
|
|
4
|
+
return `import 'dotenv/config';
|
|
5
|
+
import { type Request, type Response } from 'express';
|
|
5
6
|
import { createMcpExpressApp } from '@modelcontextprotocol/sdk/server/express.js';
|
|
6
7
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
7
8
|
import { getServer } from './server.js';
|