Skip to content

pashaarshad/MCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Website & Image Generator MCP Server

This project is a Model Context Protocol (MCP) server that gives AI agents (like Claude, Cursor, or your own chat bot) the ability to:

  1. 🎨 Generate Images: Create AI images using Pollinations.ai (Free!).
  2. 💾 Create Websites: Save HTML/CSS/JS files directly to your computer.

🚀 Getting Started

1. Installation

Run the following command to install the necessary dependencies:

npm install

2. Running the Server in "Inspector Mode"

The Inspector allows you to test the tools manually without needing an AI client yet. It's like a control panel for your server.

npm run server:inspect

This will open a URL (usually http://localhost:5173) in your browser.


🛠️ Available Tools

1. generate-image

Generates an image from a text description and saves it to websites/assets/.

  • prompt: Describe the image (e.g., "A futuristic city with flying cars").
  • filename: The name of the file (e.g., "city.jpg").

2. save-file

Saves text content (HTML, CSS, Code) to a file in the websites/ folder.

  • filename: The name of the file (e.g., "index.html").
  • content: The actual code or text.

🎓 How to Test (Step-by-Step)

Goal: Create a simple webpage with a generated image.

  1. Start the Inspector (npm run server:inspect) and open the link in your browser.
  2. Generate an Image:
    • Go to Tools > generate-image.
    • prompt: "A cute robot waving hello, 3d render"
    • filename: "robot.jpg"
    • Click Run.
  3. Create the Webpage:
    • Go to Tools > save-file.
    • filename: "index.html"
    • content:
      <html>
        <body>
          <h1>Hello from MCP!</h1>
          <img src="assets/robot.jpg" width="400" />
        </body>
      </html>
    • Click Run.
  4. View Result:
    • Open the websites folder on your desktop.
    • Double-click index.html. You should see your page with the robot image!

📁 Project Structure

  • src/server.ts: The main code for the MCP server and tools.
  • websites/: The folder where generated files and images are saved.
  • package.json: Project configuration and scripts.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors