# Directory Structure
```
├── .gitignore
├── glama.json
├── icon.png
├── LICENSE
├── manifest.json
├── package-lock.json
├── package.json
├── README.md
├── src
│ └── server.js
├── tsconfig.json
└── website-generator-mcp-server.dxt
```
# Files
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
```
node_modules/
dist/
```
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
```markdown
# @b12/website-generator-mcp-server
B12's model context protocol server for generating websites with AI
<a href="https://glama.ai/mcp/servers/@b12io/website-generator-mcp-server">
<img width="380" height="200" src="https://glama.ai/mcp/servers/@b12io/website-generator-mcp-server/badge" alt="Website Generator MCP server" />
</a>
## Usage with Claude Desktop
### Prerequisites
- NodeJS
- MCP Client (like Claude Desktop App)
### Installation
To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"b12": {
"command": "npx",
"args": ["-y", "@b12/website-generator-mcp-server"]
}
}
}
```
****
```
--------------------------------------------------------------------------------
/glama.json:
--------------------------------------------------------------------------------
```json
{
"$schema": "https://glama.ai/mcp/schemas/server.json",
"maintainers": [
"thisisdhaas",
"adbharadwaj",
"zhadaev"
]
}
```
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
```json
{
"compilerOptions": {
"target": "ES2022",
"module": "Node16",
"moduleResolution": "Node16",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"src/**/*",
"server.ts"
],
"exclude": [
"node_modules"
]
}
```
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
```json
{
"name": "@b12/website-generator-mcp-server",
"version": "1.0.3",
"description": "Website generator MCP server by b12.io",
"main": "dist/server.js",
"files": ["dist"],
"bin": {
"b12-mcp-server": "dist/server.js"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.7.0"
},
"scripts": {
"start": "node server.js",
"build": "tsc && shx chmod +x dist/*.js"
},
"author": "b12io",
"license": "Apache-2.0",
"devDependencies": {
"@types/node": "^22.13.14",
"shx": "^0.4.0",
"typescript": "^5.8.2"
}
}
```
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
```json
{
"dxt_version": "0.1",
"name": "website-generator",
"display_name": "B12 Website Generator",
"version": "1.0.3",
"description": "Create a website in seconds! Generate, design, write code, and write copy for your website. Powered by B12. Contact: [email protected]",
"long_description": "This extension allows you to create a professional, engaging, and user-friendly website in seconds using AI. To create a website, you need to provide a name for your project/business, along with a description of the project/business (goals, structure, etc.).",
"author": {
"name": "B12.io",
"email": "[email protected]",
"url": "https://b12.io/"
},
"homepage": "https://b12.io/",
"icon": "icon.png",
"server": {
"type": "node",
"entry_point": "src/server.js",
"mcp_config": {
"command": "node",
"args": [
"${__dirname}/src/server.js"
],
"env": {}
}
},
"tools": [
{
"name": "generate_website",
"description": "Generates a website from a business/project name and short description, then presents a link (in markdown format) to sign up and see the website."
}
],
"keywords": [
"website",
"business",
"marketing",
"write code",
"write copy",
"site"
],
"license": "Apache-2.0"
}
```
--------------------------------------------------------------------------------
/src/server.js:
--------------------------------------------------------------------------------
```javascript
#!/usr/bin/env node
import { Server } from '@modelcontextprotocol/sdk/server/index.js'
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
import {
CallToolRequestSchema,
ListToolsRequestSchema,
} from '@modelcontextprotocol/sdk/types.js'
const server = new Server(
{
name: 'b12-website-generator',
version: '0.1.0',
},
{
capabilities: {
tools: {},
},
},
)
const WEBSITE_GENERATION_TOOL = {
name: 'generate_website',
// Make sure the description is in sync with tool description in manifest.json
description: 'Generates a website from a business/project name and short description, then presents a link (in markdown format) to sign up and see the website.',
annotations: {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: true,
title: 'Generate Website',
},
inputSchema: {
type: 'object',
properties: {
name: {
type: 'string',
description: 'The name of the business.'
},
description: {
type: 'string',
description: 'The short description of the business in less than 1000 characters.'
},
},
required: ['name', 'description']
}
}
server.setRequestHandler(ListToolsRequestSchema, async () => ({
tools: [WEBSITE_GENERATION_TOOL],
}))
server.setRequestHandler(CallToolRequestSchema, request => {
try {
const { name: toolName, arguments: args } = request.params
if (!args) {
throw new Error('Business name and description are not provided')
}
if (toolName === 'generate_website') {
const { name, description } = args
return {
content: [{
type: 'text',
text: `https://b12.io/signup/?utm_medium=chat&utm_source=mcp-server&intent=ai-websites&utm_content=website-generator&business_name=${encodeURIComponent(String(name))}&business_description=${encodeURIComponent(String(description))}`
}],
isError: false,
}
}
return {
content: [{ type: 'text', text: `Unknown tool: ${toolName}` }],
isError: true,
}
} catch (error) {
return {
content: [
{
type: 'text',
text: `Error: ${error instanceof Error ? error.message : String(error)}`,
},
],
isError: true,
}
}
})
async function runServer() {
const transport = new StdioServerTransport()
await server.connect(transport)
console.error('B12 Website generator MCP Server running on stdio')
}
runServer().catch((error) => {
console.error('Fatal error running server:', error)
process.exit(1)
})
```