MCP ExplorerExplorer

Nighty Mcp

@p2xaion 10 months ago
4 MIT
FreeCommunity
AI Systems
#discord#node-js
make nightyscript(s) with openrouter api

Overview

What is Nighty Mcp

Nighty-mcp is a local server that utilizes OpenRouter’s API to generate code for Nighty scripts, acting as a bridge between Nighty and various AI models.

Use cases

Use cases for nighty-mcp include generating code snippets for applications, automating repetitive coding tasks, and enhancing development workflows by integrating AI-driven code suggestions.

How to use

To use nighty-mcp, clone the repository, install dependencies with npm, add your OpenRouter API key to the .env file, and start the server. Send POST requests to /generate with a JSON body containing your code generation prompt.

Key features

Key features include code generation using OpenRouter’s API, support for multiple AI models, automatic code block formatting, error handling and logging, and context-aware generation using project documentation.

Where to use

Nighty-mcp can be used in software development environments where code generation is needed, particularly for projects utilizing Nighty scripts and AI models.

Content

Nighty Code Generation Server

Ask DeepWiki

A local server that uses OpenRouter’s API to generate code for Nighty scripts. This server acts as a bridge between Nighty and various AI models available through OpenRouter.

Features

  • AI-Powered Coding: Leverage dozens of models via OpenRouter for code generation and fixing.
  • Live Log Viewer: A web-based UI at http://localhost:3000/logs shows all server requests, including pending tasks, AI response times, and generated file paths.
  • Code Versioning: Automatically saves every generated script to a versions/ directory, preventing data loss.
  • Context-Aware Prompts: Uses local documentation files (context/) to provide the AI with relevant context for more accurate code generation.

Setup

  1. Prerequisites: Make sure you have Node.js (v16+) installed.

  2. Clone the Repository:

    git clone https://github.com/p2xai/nighty-mcp.git
    cd nighty-mcp
    
  3. Install Dependencies:

    npm install
    
  4. Configure Environment:

    • Create a .env file by copying the example: cp .env.example .env
    • Open the .env file and add your OpenRouter API key.
    • (Optional) Set the SCRIPTS_PATH to your desired output directory for generated scripts.
  5. Start the Server:

    node server.js
    

    The server will now be running at http://localhost:3000.

Usage

Live Log Viewer

Navigate to http://localhost:3000/logs in your browser to see a live, auto-updating table of all server activity. Requests to /generate and /fixcode will appear instantly as “pending” and update upon completion.

API Endpoints

The server exposes the following endpoints for programmatic use:

  • POST /generate: Generates a new script.
  • POST /fixcode: Fixes an existing piece of code.
  • GET /api/logs: Returns the raw log data as JSON.

Example Request Body:

License

This project is licensed under the MIT License. See the LICENSE file for details.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers