- Explore MCP Servers
- nighty-mcp
Nighty Mcp
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.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
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.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Nighty Code Generation Server
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/logsshows 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
-
Prerequisites: Make sure you have Node.js (v16+) installed.
-
Clone the Repository:
git clone https://github.com/p2xai/nighty-mcp.git cd nighty-mcp -
Install Dependencies:
npm install -
Configure Environment:
- Create a
.envfile by copying the example:cp .env.example .env - Open the
.envfile and add your OpenRouter API key. - (Optional) Set the
SCRIPTS_PATHto your desired output directory for generated scripts.
- Create a
-
Start the Server:
node server.jsThe 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.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










