🎭 LM Studio Creative Story Writer

Model Context Protocol (MCP) Server for Local LLMs

MCP ProtocolPython 3.10+LM StudioLicense: MIT

An official MCP Server that turns local LM Studio models into imaginative storytellers, automatically generating and saving creative stories as text files.

🌟 Key Features

  • πŸ€– LM Studio Integration: Uses LM Studio's local OpenAI-compatible API server (http://localhost:1234/v1).
  • ✍️ Creative Prompt Engineering: System prompts specifically optimized for rich sensory descriptions, immersive pacing, and engaging narratives.
  • πŸ’Ύ Automatic File Saving: Generates formatted .txt files complete with topic headers, genre, and generation timestamps.
  • 🎭 Genre Customization: Easily specify genres such as Sci-Fi, Fantasy, Mystery, Cyberpunk, or Horror.
  • ⚑ FastMCP Protocol: Built with the official lightweight FastMCP library for seamless integration with MCP clients (LM Studio, Claude Desktop, Cursor, etc.).

πŸ—οΈ Architecture Flowchart

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        MCP Protocol       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  MCP Client     β”‚  ◄─────────────────────►  β”‚   story_server   β”‚
β”‚ (LM Studio Host β”‚                           β”‚   (FastMCP)      β”‚
β”‚ / Claude / CLI) β”‚                           β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                    β”‚
                                                       β”‚ OpenAI API
                                                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      Writes File         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Local Disk      β”‚  ◄─────────────────────  β”‚    LM Studio     β”‚
β”‚ (story_file.txt) β”‚                          β”‚  (Local Server)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‹ Prerequisites

Before running the server, ensure you have:

  1. Python 3.10+: Download from python.org.
  2. LM Studio: Download from lmstudio.ai.
  3. Local LLM Model: Download a model in LM Studio (e.g., Llama 3, Mistral 7B, or Qwen 2.5).

βš™οΈ Installation & Setup

  1. Clone the Repository:

    git clone https://github.com/KVS-Manvith/VTU25374-MCP.git
    cd VTU25374-MCP
    
  2. Create and Activate a Virtual Environment (Optional but Recommended):

    # On Windows:
    python -m venv venv
    .\venv\Scripts\activate
    
    # On macOS/Linux:
    python3 -m venv venv
    source venv/bin/activate
    
  3. Install Dependencies:

    pip install -r requirements.txt
    

πŸš€ How to Run

Step 1: Start LM Studio Local Server

  1. Launch LM Studio.
  2. Select and load your model at the top dropdown.
  3. Open the Local Server tab (< / > icon on the left sidebar).
  4. Click Start Server (Server will start on http://localhost:1234).

Step 2: Test via FastMCP Dev Inspector

You can test the tool interactively in your browser:

mcp dev story_server.py

This opens an interactive dashboard where you can call the write_and_save_story tool with custom parameters!

Step 3: Register in LM Studio MCP Client

  1. In LM Studio, navigate to Settings -> MCP / Tools.
  2. Add the server configuration to your mcp.json:
    {
      "mcpServers": {
        "creative-story-writer": {
          "command": "python",
          "args": ["C:/path/to/VTU25374-MCP/story_server.py"]
        }
      }
    }
    
  3. Save the config. In your LM Studio chat, you can now instruct the assistant:

    "Write a sci-fi story about a forgotten space station and save it as space_station.txt using the story writer tool."

πŸ› οΈ Tool Definition

write_and_save_story

Parameter Type Default Description
topic string (Required) The main idea, theme, or prompt for the story.
filename string "creative_story.txt" The name of the file to save the story into.
genre string "general fiction" Target genre (e.g. sci-fi, fantasy, mystery, horror).

πŸ“‚ Project Structure

VTU25374-MCP/
β”œβ”€β”€ story_server.py     # Main MCP server script
β”œβ”€β”€ requirements.txt    # Python dependencies
β”œβ”€β”€ README.md           # Documentation
β”œβ”€β”€ LICENSE             # MIT License
β”œβ”€β”€ .gitignore          # Git ignore rules
└── sample_story.txt    # Example generated story output

πŸ“ License

This project is licensed under the MIT License.

MCP Server Β· Populars

MCP Server Β· New

    Bevel-Software

    hexis

    Git-backed skills, tools & context for AI agents

    Community Bevel-Software
    jonashertner

    OpenCaseLaw

    Open Swiss legal corpus + MCP server: 1M+ court decisions (1875–today), 21k laws, 10M-edge citation graph, 42 MCP tools. CC0 data, MIT code. Live at mcp.opencaselaw.ch

    Community jonashertner
    SystemCraftsman

    Strimzi Kafka CLI

    Command Line Interface for the Strimzi Kafka Operator

    Community SystemCraftsman
    DROOdotFOO

    Raxol

    Write one app, render it to a terminal, a browser, or as agent tools. The terminal for your Gundam.

    Community DROOdotFOO
    morluto

    REA: Reverse Engineer Anything

    Reverse engineer anything with agents, from app behavior down to native binaries.

    Community morluto