LM Studio Creative Story Writer

LM Studio Creative Story Writer

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

Category
Visit Server

README

<div align="center">

šŸŽ­ LM Studio Creative Story Writer

Model Context Protocol (MCP) Server for Local LLMs

MCP Protocol Python 3.10+ LM Studio License: MIT

<p align="center"> <b>An official MCP Server that turns local LM Studio models into imaginative storytellers, automatically generating and saving creative stories as text files.</b> </p>

</div>


🌟 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured