export function createBasicTemplate(name) {
return {
'package.json': `{
"name": "@your-username/${name}",
"version": "1.0.0",
"description": "MCP server for ${name}",
"main": "index.js",
"type": "module",
"scripts": {
"start": "node index.js"
},
"keywords": ["mcp", "smithery"],
"author": "Your Name",
"license": "MIT",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.7.0"
}
}`,
'index.js': `import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
// Create a new MCP server
const server = new Server(
{ name: "${name}", version: "1.0.0" },
{
capabilities: {
tools: {
example_tool: {
description: "An example tool",
parameters: {
type: "object",
properties: {
input: {
type: "string",
description: "Input parameter"
}
},
required: ["input"]
},
handler: async (params) => {
return { result: \`Processed: \${params.input}\` };
}
}
}
}
}
);
// Start the server with stdio transport
const transport = new StdioServerTransport();
await server.connect(transport);
`,
'Dockerfile': `FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
CMD ["node", "index.js"]
`,
'smithery.yaml': `startCommand:
type: stdio
configSchema:
type: object
properties:
exampleConfig:
type: string
description: Example configuration parameter
required: []
commandFunction: |
function generateCommand(config) {
return {
command: "node",
args: ["index.js"],
env: {}
};
}
`
};
}